Subject: Re: Prep bootloader
To: Jochen Kunz <jkunz@unixag-kl.fh-kl.de>
From: Tim Rightnour <root@garbled.net>
List: port-prep
Date: 03/08/2006 09:31:27
On 08-Mar-2006 Jochen Kunz wrote:
>> We can essentially ship a script which will generate a
>> bootimage from /netbsd, and write it out to the root drive.
> What about a bootloader that reads /netbsd out of the root file system?
> This would avoid the partition table fsck entirely.

The answer is mildy annoying.  You can write a second stage bootloader for
prep, theoretically at least, but the only way to get the firmware to load it,
is still to have the magical boot partition.  So while we can write a
bootloader that will read netbsd off the disk, we will still have to go through
partition table gyrations in order to boot.  Given that.. I'm not sure it's
worth anyone's time to write one, and I'm not really sure what the benefit
would be.

>> if we fix the booted-device stuff so the machine knows where it was
>> booted from
> Oh, yes, that would be great. How does the firmware tell the kernel
> about the boot device? IIRC I didn't find that in the residual data.

Because you were looking in the wrong place.. (and so was I).  The NVRAM
contains all that info apparently.  On IBM's ftp site where the rest of the
prep docs are stored, they have some docs on the nvram.  From what I can
gather, the booted device should be in there.  According to the docs however,
they store it in OF device style.. so we will have to write a decoder for it.

An amusing tidbit I learned while researching this..  apparently the 6015 was
considered by the AIX guys to be a real piece.  It's supposedly impossible to
change the boot order from within AIX via the bootlist command, due to the
design of the nvram part on that one.  Only the firmware can do it.  I think
most of the others can however.

---
Tim Rightnour <root@garbled.net>
NetBSD: Free multi-architecture OS http://www.netbsd.org/
Genecys: Open Source 3D MMORPG: http://www.genecys.org/