Subject: booting off CF card on soekris-like board (Geode SC1100 CPU)
To: NetBSD-current Users <current-users@netbsd.org>
From: =?ISO-8859-1?Q?Timo_Sch=F6ler?= <eclipser23@web.de>
List: port-i386
Date: 01/02/2005 22:08:14
[sorry for the empty subject posting! really need some coffee =8-D ]

hi list,

i'm trying to set up a soekris-like [1] board -- a PC Engines WRAP .1D 
[2] which features a CF slot -- so booting off CF card is desired.

i made a diskimage with the procedure below (and, yes, it's -current ;):

dd if=/dev/zero of=diskimage bs=16k count=1920

vnconfig -c -v /dev/rvnd0d diskimage

fdisk -0ua /dev/rvnd0d

fdisk: primary partition table invalid, no magic in sector 0
Disk: /dev/rvnd0d
NetBSD disklabel disk geometry:
cylinders: 30, heads: 64, sectors/track: 32 (2048 sectors/cylinder)
total sectors: 61440

BIOS disk geometry:
cylinders: 30, heads: 64, sectors/track: 32 (2048 sectors/cylinder)
total sectors: 61440

Do you want to change our idea of what BIOS thinks? [n] y

Geometries of known disks:
Disk 0: cylinders 1023, heads 255, sectors 63 (35694859 sectors, 
17429MB)

BIOS's idea of #cylinders: [0..1024 default: 30] 31
BIOS's idea of #heads: [0..256 default: 64] 32
BIOS's idea of #sectors: [1..63 default: 32] 63
Disk: /dev/rvnd0d
---8<---8<---8<---8<--- [cut here] ---8<---8<---8<---8<---

newfs /dev/vnd0a

mount /dev/vnd0a /mnt

cp /usr/mdec/boot /mnt

gzip -9 < ./mytestdir/netbsd > /mnt/netbsd.gz

installboot -v -o console=com0 -o speed=38400 /dev/rvnd0a 
/usr/mdec/bootxx_ffsv1

(this gives:

File system:         /dev/rvnd0a
File system type:    ffs (blocksize 8192, needswap 0)
Primary bootstrap:   /usr/mdec/bootxx_ffsv1
Secondary bootstrap: boot
Preserving 51 (0x33) bytes of the BPB

which looks okay to me...)

AFAIK, this *should* boot: installboot and the second stage bootloader 
are in place as well as the kernel; the geometry is that of the card as 
the board it's desired to run on sees it (i tried both geometries, the 
'Phys' and 'Log'):

01F0 Master 848A Hitachi XX.V.3.2.0.0
Phys C/H/S 489/4/32 Log C/H/S 31/32/63

after unmounting and unconfiguring the vnd, the image is dd'ed straight 
onto the CF card, which then is inserted into the boards CF slot.

powering up the board having a serial connection (this is the reason 
for the extra installboot options which can be seen above) i always end 
up here:

NetBSD/i386 ffsv1 Primary Bootstrap
Boot failed (errno  0): Invalid /boot file format.
No boot device available, press Enter to continue.

so it seems that the 1st stage of bootstrapping is okay, but it fails 
on the second stage.

i searched on google and several mailing lists (also of the openbsd and 
freebsd people running on soekris or similar boards) to no avail :(

has anybody a clue what i'm doing wrong? thanks in advance,

cheers,

timo

[1] Soekris -- http://www.soekris.com

[2] PC Engines WRAP -- http://www.pcengines.ch/wrap.htm