Boot0 testing (WAS: Re: nanobsd image boot issues)

Luigi Rizzo rizzo at iet.unipi.it
Tue May 5 10:57:30 UTC 2009


On Tue, May 05, 2009 at 11:58:35AM +0200, Rick van der Zwet wrote:
> Hi Luigi,
> 
> Down below a thread currently running at freebsd-embedded@ regarding
> the boot0 loader and it's weirdness. I don't seems to find a proper
> way of getting the boot0 loader to work on various (old) hardware,
> like Pentium I PC's with awardBios, which I need to get nanobsd to
> work properly on various types of hardware.

One problem I had with some old hardware was that the BIOS
could not read more than one sector at a time, and eventually
(but it was really long ago so i do not remember
the details well) I had to patch some code so that
reading would occur one sector at a time instead of
using track-long blocks.

But if the problem is this one, it should be really
something that pertains to boot1 and boot2.

Also, some BIOSes and CF cards can be confused if the
geometry is not correct.

That's all i know.

cheers
luigi

>  I have tried a whole number of options and combination all varies
> from LBA bios settings to different boot0 loaders of various releases,
> but all combination seems to 'die' or got 'stuck', e.g. not to
> continue with the generic boot cycle.
> 
> Looking at the source code it seems to be 3 points of failure, ranging
> from invalid input to unreadable sectors, but all ends with the same
> generic warning (read: one 'beep'). I know space is limited, but how
> about a different beep sequence for all warning, will that be
> possible?
> 
> Next as you did quite some work in the field of boot loaders, what is
> the best way to test the boot loader sequence e.g. enable full
> debugging at all parts of the progress?
> 
> Thanks in advance,
> /Rick
> PS: Some background: Bunch of enthusiastic volunteers running FreeBSD
> RELENG_5 at 80+ wireless nodes of various types of hardware, in and
> around the city of Leiden, The Netherlands. Planning a overhaul of the
> software to run on recent version of FreeBSD using nanobsd to provide
> remote update possibilities.
> 
> 2009/5/4 John Baldwin <jhb at freebsd.org>:
> > On Sunday 03 May 2009 10:29:17 pm John Hein wrote:
> >> Rick van der Zwet wrote at 14:20 +0200 on May ?3, 2009:
> >> ?> 2009/4/24 M. Warner Losh <imp at bsdimp.com>:
> >> ?> > In message:
> > <5aaae08a0904231438v5b655056g8852dc11f1e83987 at mail.gmail.com>
> >> ?> > ? ? ? ? ? ?Rick van der Zwet <info at rickvanderzwet.nl> writes:
> >> ?> > : Boot delay and fail issues on various hardware using nanobsd
> > generated
> >> ?> > : RELENG_7_1 images on a sandisk 2gb CF (SDCFH2-002G). For example
> > while
> >> ?> > : trying to run a image on a soekris net4521 (bios 1.33) it seems to
> >> ?> > : take ages (up to a minute) to start booting. Same image supplied to a
> >> ?> > : PC (intel Pentium 1 & award bios) using a CF->IDE converter does not
> >> ?> > : seems to boot at all, neither does a net4801 (bios 1.33). Just seems
> >> ?> > : trying to find a boot loader. The net4801 even bails out after a
> >> ?> > : while. Output of fdisk of image list as follows:
> >> ?> [snip: fdisk outputs]
> >> ?>
> >> ?> > Have you enabled packet mode for boot in boot0 with boot0cfg?
> >> ?>
> >> ?> I did. The problems turned out to be something completely different.
> >> ?> Starting from soekris bios version 1.31 and upwards boot0sio does not
> >> ?> work anymore, freezing forever while trying to boot initially e.g. not
> >> ?> showing the following output:
> >> ?> ? ?F1 ? FreeBSD
> >> ?> ? ?F2 ? FreeBSD
> >> ?>
> >> ?> ? ?Default: F1
> >> ?>
> >> ?> I generated my images like this:
> >> ?> ? ?$ fdisk -i -f _.fdisk da0
> >> ?> ? ?$ boot0cfg -B -b /boot/boot0sio -o packet -s 1 -m 3 da0
> >> ?> ? ?$ bsdlabel -w -B -b /boot/boot da0s1
> >> ?> ? ?$ bsdlabel -w -B -b /boot/boot da0s2
> >> ?> ? ?$ newfs /dev/da0s1a
> >> ?> ? ?$ newfs /dev/da0s2a
> >> ?> ? ?$ newfs /dev/da0s3
> >> ?> ? ?$ cat _.fdisk
> >> ?> ? ?# 1000944 2 63 16 0 8192 0
> >> ?> ? ?g c993 h16 s63
> >> ?> ? ?p 1 165 63 495873
> >> ?> ? ?p 2 165 495999 495873
> >> ?> ? ?p 3 165 991872 9072
> >> ?>
> >> ?> When using /boot/boot0 instead of /boot/boot0sio all seems to work
> >> ?> perfectly fine on all Soekris boards I could test it on (net4521,
> >> ?> net4801, net5501).
> >> ?>
> >> ?> Next comes the interesting question when I use the some CF card in PC
> >> ?> is does _not_ work. I did get the output on the screen, but when
> >> ?> trying to press F1 or F2 or CR. All I got was a beep and no progress
> >> ?> forward, but just remain in the same section. Default behavior or
> >> ?> something off?
> >>
> >> Note that 7.1 (which is what I seem to recall you're using)
> >> changed the boot loader to use real mode (see sys/boot/i386/btx).
> >>
> >> You could try using boot blocks from 7.0 (or 6.3) to see
> >> if it makes a difference..
> >
> > boot0 doesn't use BTX so those changes should not affect that. ?Luigi (luigi@)
> > did make some changes to boot0, however, and you may want to ask him about
> > this.
> >
> > --
> > John Baldwin
> >


More information about the freebsd-embedded mailing list