|
OpenBSD Installation and Upgrading Installing and upgrading OpenBSD. |
|
Thread Tools | Display Modes |
|
|||
Writing armv7 image to a microSD card
I bought a Cubieboard 2 and want to run OpenBSD on it.
I have a 2 GB microSD card that I plugged in my desktop machine: Code:
umass0 at uhub1 port 3 configuration 1 interface 0 "SanDisk MobileMate Micro" rev 2.00/94.07 addr 3 umass0: using SCSI over Bulk-Only scsibus2 at umass0: 2 targets, initiator 0 sd3 at scsibus2 targ 1 lun 0: <Generic, STORAGE DEVICE, 9407> SCSI0 0/direct removable serial.0781b7b1000000027658 sd3: 1914MB, 512 bytes/sector, 3920896 sectors Code:
dd if=miniroot-cubie-57.fs of=/dev/rsd3c Code:
dd: /dev/rsd3c: Input/output error 1+0 records in 0+0 records out 0 bytes transferred in 0.000 secs (0 bytes/sec) Code:
fdisk /dev/sd3 disklabel /dev/sd3 Before I tried writing the image I successfully mounted the MSDOS partition that was on the card before and opened a few files. What may be the problem? If there is a problem with my card, what brand and model do you suggest getting that will work nicely with OpenBSD? Last edited by rarebird; 22nd July 2015 at 09:53 PM. |
|
|||
Thank you for your input.
2. I mentioned reading from the existing filesystem just to assert that the device appeared to be working but it fails when I try writing to it. 3. I managed to write a few sectors with dd so the MBR is gone but it only ever wrote 5-6 sectors. No, the card does not have any tabs. I will now go and buy myself a decent SD card and card reader and try it out. I hope it works! |
|
||||
I took a look at the cubie filesystem image. It includes a replacement MBR and a FAT filesystem, so a successful write operation to media on sd3 may be confirmed with:
|
|
||||
Here's my inspection of the 5.7-release image file. I used vnconfig(8) to address the image file as a logical disk drive.
Code:
# vnconfig vnd0 miniroot-cubie-57.fs # fdisk vnd0 Disk: vnd0 geometry: 368/1/100 [36864 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- *0: 0C 62 0 38 - 321 0 30 [ 6237: 25893 ] Win95 FAT32L 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: A6 0 0 65 - 321 0 30 [ 64: 32066 ] OpenBSD # disklabel vnd0 # /dev/rvnd0c: type: vnd disk: vnd device label: fictitious duid: 0000000000000000 flags: bytes/sector: 512 sectors/track: 100 tracks/cylinder: 1 sectors/cylinder: 100 cylinders: 368 total sectors: 36864 boundstart: 64 boundend: 32130 drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] c: 36864 0 unused i: 25893 6237 MSDOS # mount /dev/vnd0i /mnt # ls /mnt bsd.umg uenv.tx uenv.txt # umount /mnt # vnconfig -u vnd0 # |
|
|||
Code:
dd if=miniroot-cubie-57.fs of=/dev/rsd3c you can speed up the write by Quote:
Code:
dd if=miniroot-cubie-57.fs of=/dev/rsd3c bs=1m |
|
|||
Thank you so much! I was not aware of vnd(4) and vnconfig(8) until your post and I always thought how cool it would be if I could easily inspect what was inside the .fs images. You learn while you live!
I have indeed bought a new SD card and voila: Code:
# dd if=miniroot-cubie-57.fs of=/dev/rsd3c 36864+0 records in 36864+0 records out 18874368 bytes transferred in 122.610 secs (153938 bytes/sec) Code:
# mount /dev/sd3i /mnt/flashdrive0 # ls /mnt/flashdrive0 total 7 -rwxr-xr-x 1 root wheel 6.8M Mar 11 08:13 bsd.umg* -rwxr-xr-x 1 root wheel 19B Mar 11 08:13 uenv.tx* -rwxr-xr-x 1 root wheel 96B Mar 11 08:13 uenv.txt* |
|
|||
Quote:
Code:
# dd if=miniroot-cubie-57.fs of=/dev/rsd3c bs=1m 18+0 records in 18+0 records out 18874368 bytes transferred in 4.625 secs (4080805 bytes/sec) Code:
# dd if=miniroot-cubie-57.fs of=/dev/rsd3c 36864+0 records in 36864+0 records out 18874368 bytes transferred in 122.610 secs (153938 bytes/sec) |
|
|||
I tried one time and failed after which I went on vacation and didn't look further into it. I'll be trying again tomorrow morning and will post my progress here.
|
|
|||
As promised, I tried booting the snapshot version of OpenBSD on Cubieboard 2 and failed again.
After writing the miniroot-cubie-58.fs filesystem to an SD card I plug it into the board, start it up and the following message repeats itself over and over on a serial port: Code:
U-Boot SPL 2015.07 (Jul 23 2015 - 19:37:50) DRAM:Timeout initialising DRAM resetting ... U-Boot SPL 2015.07 (Jul 23 2015 - 19:37:50) DRAM:Timeout initialising DRAM resetting ... . . . After removing the extra cable the above problem goes away but still OpenBSD does not boot: Code:
HELLO! BOOT0 is starting! boot0 version : 3.0.0 dram size =1024 sum=0x01be1e3a src_sum=0x01be1e3a Ready to disable icache. Jump to secend Boot. [ 0.134] U-Boot 2011.09-rc1-00003-ge89ab14-dirty (Jan 03 2014 - 12:57:33) Allwinner Technology [ 0.143]version: 1.1.0 [ 0.146]pmbus: ready [ 0.251]PMU: AXP209 [ 0.255]PMU: AXP20x found [ 0.257]PMU: bat ratio = 100 [ 0.261]after set, dcdc2 =1400mv [ 0.264]PMU: dcdc2 1400 [ 0.267]PMU: pll1 912 Mhz boot_clock = 912 dcdc2_vol = 1400 [ 0.275]after set, dcdc2 =1400mv dcdc3_vol = 1250 ldo2_vol = 3000 ldo3_vol = 2800 ldo4_vol = 2800 power_start = 0 storage_type = -1 usb_recovery = 1 find power_sply to end fel key old mode run key detect no key found no key input dram_para_set start dram_para_set end [ 0.311]DRAM: 1 GiB relocation Offset is: 35b23000 donn't initialize ther user_gpio (main_key:boot_init_gpio) DRV_DISP_Init: opened [ 0.525]boot_disp.output_type=4 [ 0.529]boot_disp.output_mode=4 [ 0.532]boot_disp.auto_hpd=1 workmode = 0 [ 1.836]NAND: NAND_UbootInit NB1 : enter NAND_LogicInit nand : get id_number_ctl from script, 3 not burn nand partition table! NB1 : nand_info_init fail [ 5.450]nand init fail set to recovery try sprite_led_gpio config sprite_led_gpio start sunxi sprite begin screen_width = 800 screen_height = 480 bar x1: 200 y1: 200 bar x2: 600 y2: 280 read mbr failed sprite update error: no data part found read mbr failed sprite update error: read image start error sprite update error: current card sprite failed now hold the machine fail to find part named env Using default environment In: serial Out: serial Err: serial --------fastboot partitions-------- mbr not exist base bootcmd=run setargs_nand boot_normal bootcmd set setargs_nand key 0 recovery key high 6, low 4 cant find fstbt value no misc partition is found to be run cmd=run setargs_nand boot_normal the part isn't exist WORK_MODE_BOOT WORK_MODE_BOOT [ 5.544]Hit any key to stop autoboot: 0 cant find part named boot sunxi_flash - sunxi_flash sub-system Usage: sunxi_flash read command parmeters : parmeters 0 : addr to load(hex only) parmeters 1 : the name of the part to be load [parmeters 2] : the number of bytes to be load(hex only) if [parmeters 2] not exist, the number of bytes to be load is the size of the part indecated on partemeter 1 boota: bad boot image magic, maybe not a boot.img? sunxi# INSTALL.armv7 document says that miniroot-cubie-58.fs filesystem is for Cubieboard 1 while I have Cubieboard 2 so I suspect that I am using the wrong image. But where/how do I obtain Cubieboard 2 miniroot filesystem? armv7 page says that Cubieboard 2 is supported. I remember reading that the only difference between Cubie 1 and 2 is the CPU, i.e. A10 to A20 and the two are highly compatible so I guessed that Cubieboard 1 image should work. I appreciate any suggestions and pointers. |
|
|||
I have been playing around all day trying to boot OpenBSD from SD card but have had no success at all. I tried using several different versions of u-boot and it made no difference.
Eventually I decided to try booting it from the network so I grabbed the latest u-boot and put it on the SD card, set up DHCP and TFTP servers but my hopes were crushed immediately because it seems that some u-boot commands crash the board, i.e. the board restarts. For example: Code:
sun7i# setenv serverip 192.168.1.7 undefined instruction pc : [<ffff0024>] lr : [<4a011a30>] sp : 7fb65be0 ip : 00000000 fp : 7fb66648 r10: 0000000c r9 : 7fb65f0c r8 : 00000004 r7 : 00000003 r6 : 00000000 r5 : 7fb66610 r4 : 00000019 r3 : e3a00001 r2 : 00000001 r1 : 00000020 r0 : 00000000 Flags: nzCv IRQs off FIQs off Mode SVC_32 Resetting CPU ... resetting ... U-Boot SPL 2014.04-10733-gea1ac32 (Feb 22 2015 - 16:48:01) Board: Cubieboard2 DRAM: 1024 MiB CPU: 960000000Hz, AXI/AHB/APB: 3/2/2 spl: not an uImage at 1600 U-Boot 2014.04-10733-gea1ac32 (Feb 22 2015 - 16:48:01) Allwinner Technology CPU: Allwinner A20 (SUN7I) Board: Cubieboard2 I2C: ready DRAM: 1 GiB MMC: SUNXI SD/MMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: dwmac.1c50000 Hit any key to stop autoboot: 0 sun7i# |
|
||||
Just for fun, I have installed OpenBSD/armv7 in a Qemu virtual machine. The only ARM hardware I have are smartphones that can't run OpenBSD, so this will give me some familiarity with it.
A few months ago, there was a long thread in the arm@ mailing list regarding port building under Qemu being faster than on actual hardware. (While that might be true, the developers would prefer to find and debug problems on the real hardware.) The thread ended with snapshots containing kernels for virtual hardware: the ARM Versatile Express for Cortex-A15 emulation (qemu-system-arm -M vexpress-a15). It's a long thread. A working qemu-system-arm example is shown near the end. I used it to install from bsd.rd.VEXPRESS15.umg: http://marc.info/?t=143223172200002&r=1&w=2 Now that I have it up and running, I can see that it installed two MBR partitions -- a FAT partition and an OpenBSD MBR partition. The FAT partition, if I mount it, contains two files: the u-boot kernel images, bsd.umg and bsdrd.umg. The kernels themselves (without the u-boot wrappers) are also stored in the "a" disklabel partition. Last edited by jggimi; 16th August 2015 at 02:29 AM. Reason: clarity |
|
||||
I've built one port, shells/tcsh. The ports tree was NFS mounted (from the host amd64 system), with local disk for /usr/ports/pobj. Elapsed time was 78 times longer than a native build of the same port on the host.
Code:
native amd64: 10.880u 5.320s 0:16.10 100.6% 0+0k 953+1996io 2153pf+0w emulated armv7: 896.940u 287.380s 20:51.95 94.5% 0+0k 1575+8206io 2169pf+0w 1. u = time spent in user mode, in seconds 2. s = time spent in kernel mode, in seconds 3. nn:nn.nn = elapsed time in minutes:seconds.hundreths 4. cpu percentage (u+s/elapsed) 5. k = average shared text space+unshared data/stack space 6. io = number of input+output operations 7. pf+w = major page faults+context switches |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Video card instead of sound card | ripe | OpenBSD General | 12 | 2nd May 2013 04:02 PM |
wd0a: device timeout writing fsbn ... of .....-....... | daemonfowl | OpenBSD Installation and Upgrading | 8 | 7th April 2012 09:50 PM |
Writing a guitar tuner/metronome | claytonl | OpenBSD Packages and Ports | 4 | 21st August 2011 11:29 PM |
c++: writing to the *this pointer? | robbak | Programming | 2 | 23rd October 2009 06:12 PM |
Writing Papers in FreeBSD | kagayaki | General software and network | 4 | 14th July 2008 11:31 PM |