[Soekris] summary and patch for CF problems in booting the 4501

Luigi Rizzo rizzo at icir.org
Wed Feb 19 00:48:02 UTC 2003

recently I encountered problems in booting the Soekris4501 (bios
1.00a and 1.10) with some new CF cards (64MB and 256MB, respectively,
made by Samsung).
The same CF cards work fine when mounted on IDE-CF adapters to boot
a desktop PC.

After some investigation which consumed the best part of the day,
it turned out that the 4501 seems to have problems reading multiple
sectors at once on those particular CF cards (which is curious,
because I have booted successfully the soekris box with other 64M
I am unclear on where the problem is -- maybe the BIOS and the CF
disagree on the geometry, though the problem still occurs on
a 29-sector file (the natsemi.lzrom etherboot code) which
seems to fit in the first track.

A quick and dirty patch to fix the problem in the FreeBSD loader
(boot1) and the Etherboot loader (boot1a.bin) consists in forcing
the loader to load one sector at a time. Fortunately the code is
already structured to support something similar on crossing track
boundaries, so it suffices to replace the sequence:

                jb read.2                       #  this
                movb %ah,%al                    #  track
with the sequence
                movb $1, %al

right before the 'read.2' label.
The string to be replaced is	\0162\02\0210\0340
and the replacement is		\0260\01\0220\0220

A binary patch is the following (the location of the code changes
in /boot/boot1 and /boot/boot1a.bin):

    ofs=328		# for boot1
    ofs=335		# for boot1a.bin

    sh -c "echo -e '\0260\01\0220\0220'" | \
	    dd of=${file} bs=1 count=4 oseek=${ofs} conv=notrunc

I am not sure if this is a complete fix, i.e. there might be
other parts of the kernel which use the BIOS to access the
CF loading multiple sectors at once.


More information about the Soekris-tech mailing list