boot methods
Quoted 10 lines · Paul Mackerras
There is improvement because you can have a separate wrapper for each firmware, if necessary. At present if we want to change the way information is passed into the kernel, we have to synchronously change several different
firmware/booterimplementations, which are maintained in separate places by separate people. The list includes (at least) BootX, miboot, yaboot, PPCBoot, and Michael Sokolov's VAX console. This is a logistical nightmare. Just getting the updates into thefirmware/bootersis bad enough, but then you create problems for users who then can't boot old kernels with the new firmware or new kernels with the old firmware.
Just for the record, in my case there is no problem with either getting the changes into the Linux booter or new and old kernels coexisting. My firmware, which is indeed a VAX console clone for PPC, knows absolutely nothing about how to boot Linux or any other OS, just like the real VAX console. Just like the real VAX console, it hands the problem of booting the user's OS of choice to the OS vendor. To boot Linux I have an entity called ppc-linux-boot, which is completely free, maintained in public CVS, and not tied to or controlled by SBS or any other hardware/firmware vendor.
As ppc-linux-boot is free, public, and independent of the SBS firmware, there can no problem with people changing it any way they want. It is not part of the system ROM, it is a user-installed utility stored in the user console store, so any user can easily and legitimately change it whenever s/he likes without needing any blessing from the hardware manufacturer, and can use experimental versions hacked by anyone in the world if s/he likes.
When the vmlinux boot interface changes for a platform supported by ppc-linux- boot, I'll change runlnx (the part of ppc-linux-boot that actually transfers control to vmlinux) accordingly. I can make the new version support both old and new kernels by having a boot flag (the user always has to set the correct boot flags anyway) select the kernel boot interface.
Quoted 3 lines
The reason that nothing has been done is precisely because it is so hard at present to change the way that information is passed into the kernel, because we still boot the vmlinux directly in some situations.
But currently the vmlinux boot interface is defined per platform: the generic code passes the initial R3-R7 to platform_init(). It should be possible for a board port maintainer to change this interface in his/her port without affecting anyone else.
Quoted 4 lines
If we absolutely *have* to boot a vmlinux directly without a wrapper, then probably the best thing is to use
bi_recsand pass in a pointer to them, since that is reasonably flexible and can be made to be forwards and backwards compatible without too much pain.
Yes, and I'm looking forward to usable bi_recs.
Quoted 3 lines
Changing to
this scheme is going to cause considerable pain in the short term, though.
Not at all. Here's how you can make it painless. In arch/ppc/kernel/setup.c change the division of labor between machine_init and parse_bootinfo. Move the current logic for locating bi_recs in memory from parse_bootinfo to machine_init, passing the pointer to bi_recs to parse_bootinfo() as an argument. Then new board ports can be designed with a bi_recs interface instead of the current traditional one by doing something like parse_bootinfo(r3) in platform_init. Existing ports can be converted gradually as their users work out the transition. I would gladly change the SBS board ports. In fact, one should first check if the current memory-based bi_recs are being used by anyone at all. If they aren't, change parse_bootinfo() to take a pointer, remove its invokation from machine_init altogether, and leave it up to subarch maintainers to call it from their platform_init's when they are ready to change. Or if the current memory-based bi_recs are only used on CONFIG_ALL_PPC, do the same but put the code for locating them and calling parse_bootinfo() in pmac_init, prep_init, and chrp_init for now. This would have zero impact on CONFIG_ALL_PPC users while clearing the way for board port maintainers to convert to bi_recs individually when they are ready.
--
Michael Sokolov 5791 VAN ALLEN WAY
Software Engineer CARLSBAD CA 92008-7321 USA
SBS Technologies, Inc. Phone: +1-760-438-6900 x2347
Communications Products or 1-888-SBS-COMM x2347
Fax: +1-760-438-6985 E-mail: [email protected] or [email protected]
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 4 lines · Michael Sokolov
But currently the vmlinux boot interface is defined per platform: the generic code passes the initial R3-R7 to
platform_init(). It should be possible for a board port maintainer to change this interface in his/her port without affecting anyone else.
Yes, that is a very good point.
Quoted 7 lines
In
arch/ppc/kernel/setup.c
change the division of labor betweenmachine_initandparse_bootinfo. Move the current logic for locatingbi_recsin memory fromparse_bootinfotomachine_init, passing the pointer tobi_recstoparse_bootinfo()as an argument. Then new board ports can be designed with abi_recsinterface instead of the current traditional one by doing something likeparse_bootinfo(r3)inplatform_init.
An excellent suggestion. Thank you. Is anyone using the bi_recs in anger yet?
For CONFIG_ALL_PPC, we need to make a wrapper which can be booted using existing installed versions of BootX/quik/yaboot, which will accept the parameters as provided by those loaders and make up a set of bi_recs. Then we can require that pmac/prep/chrp _always_ use a wrapper, and then start to move the Open Firmware calls into the wrapper.
Other platform maintainers can use a wrapper or not as they choose. For consistency and simplicity it would be nice if there was a standard register assignment on entry, for example having the physical address of the bi_recs in r3, but that is not essential.
We should all agree on a comment set of bi_rec tags and the format for each type of entry. And I like Ben's suggestion of keeping the bi_recs around.
Reactions? Thoughts? Comments?
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 9 lines · In message <[email protected]> you wrote:
Other platform maintainers can use a wrapper or not as they choose. For consistency and simplicity it would be nice if there was a standard register assignment on entry, for example having the physical address of the
bi_recsin r3, but that is not essential.We should all agree on a comment set of
bi_rectags and the format for each type of entry. And I like Ben's suggestion of keeping thebi_recsaround.
Both is fine for me...
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] A failure will not appear until a unit has passed final inspection.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/