Date: Sat, 3 May 2003 07:59:32 -0700 From: Luigi Rizzo <rizzo@icir.org> To: Dirk-Willem van Gulik <dirkx@webweaving.org> Cc: freebsd-hackers@freebsd.org Subject: Re: CompactFlash / new GEOM / boot fails on certain brand / Soekris Message-ID: <20030503075932.A10701@xorpc.icir.org> In-Reply-To: <20030503123757.W62023-100000@foem>; from dirkx@webweaving.org on Sat, May 03, 2003 at 12:42:17PM %2B0200 References: <20030503123757.W62023-100000@foem>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 03, 2003 at 12:42:17PM +0200, Dirk-Willem van Gulik wrote: > > Not sure if I am chasing a FreeBSD problem or a deficiency in certain ATA > flash cards which lack, say sector 0, or something. > > On 5.0 release - on a soekris.com 4521. i had similar problems in the past with 4.7-based sources on a soekris 4501, and i tracked the problem to the bios returning an error when reading multiple sectors at once from the flash card. The same card works fine in a Lex System box and in a CF-ATA adapter on my desktop machine, so i don't know if the bios on the latter retries with single block reads or what. This is what i posted. The patch goes to /sys/boot/i386/boot2/boot1.s (it is inefficient because it always reads one sector at a time; at the time i believe i found a way to read the full track on the first attempt abd one sector on subsequent ones, but did not save the actual patch). hope this helps cheers luigi > From: Luigi Rizzo <rizzo@xorpc.icir.org> > To: soekris-tech@lists.soekris.com > Cc: small@freebsd.org > Bcc: Luigi Rizzo <rizzo@xorpc.icir.org> > Subject: summary and patch for CF problems in booting the 4501 > Message-ID: <20030218164802.A484@xorpc.icir.org> > > > 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 > nop > nop > > 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 > file="/boot/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. > > cheers > luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030503075932.A10701>