Subject: Re(2): netbsd bootX
To: Donald Lee <donlee@icompute.com>
From: Benjamin Herrenschmidt <benh@mipsys.com>
List: port-macppc
Date: 12/02/1999 14:36:36
On Thu, Dec 2, 1999, Donald Lee <donlee@icompute.com> wrote:

>OF is in ROM, by definition.  The B&W machines have "easily" upgradable ROMs
>and the older machines don't.  That means that the OF patches will never
>be available on Beige G3s, 7600s, etc.

Yes they are. Those patches were carefuly optimised to fit into the few
kilobytes of nvram of those machines. (OF can execute code from nvram at
boot).

>Apple's built-in OF selector for booting is slick, and I agree that NetBSD
>should support it.

That's a different matter, and for that, you need a compliant OF booter.
Note also that if you want OF booting to be safe with USB machines and OF
3.0, you shoud be careful to call OF client interface method "quiesce"
once you are finished with it. (Once you have called it, you can no
longer call OF client inteface, but only RTAS that you'll have previously
instanciated). "quiesce" will take care of stopping devices, this is
important for things like USB which is continuously bus-mastering to main
memory, and so may damage things that live there (until the chip is reset
by BSD itself). This also can happen with some SCSI cards.

>I also think BootX is a great idea for those of us who want to boot NetBSD
>on one of these older machines.

Yes, eventually. But if you boot with BootX, you have to work with the
device tree image that BootX will give you, which doesn't contains
phandle values and you can't use RTAS. So I think it should be only used
for pre-OF-3 machines. Someone just ported BootX to boot MkLinux on NuBus
machines (and possibly other PCI PowerMacs), I will accept patches from
anyone wanting to adapt it to NetBSD. I just think it's not a good idea
if you can make a working OF-based booter based on Apple patches.

>My question: What support is required of the kernel to be bootable by BootX?
>Seems to me that if one has a kernel that you can load into memory and
>invoke, there shouldn't be much more, no?  Is the parameter passing
>so different between NetBSD and linuxPPC?  Aren't they
>both ELF?

BootX makes a few asumptions about the format of the LinuxPPC ELF image,
but should be easily adapted. However, the way BootX passes parameters to
the kernel has to be taken into account. BootX will pass a structure
containing various informations and a copy of the device tree. You don't
have access to OF client interface.