Booting OS on PowerPC
Segher Boessenkool
segher at kernel.crashing.org
Sun Dec 11 22:40:46 EST 2005
>>> It expects to be (1) in 32-bit mode, (2) r3, r4 0, (3) r5 is a
>>> pointer
>>> to the client interface callback, (4) r1 is a usable stack, (5) image
>>> is loaded according to elf-header of zImage wrapper.
>>
>> Not quite right, but close...
>
> Milton's reply was correct for pSeries (PAPR) machines.
Perhaps I should apologize for making it sound like his answer
was fully incorrect; that was unintended, I meant more something
like "incomplete".
Anyway... The question didn't say PAPR, it even said PowerPC :-)
But I just checked, and the PAPR also doesn't require GPR3 and
GPR4 to be zero.
I also checked the kernel (the converged arch/powerpc one); GPR6
and GPR7 are unused. GPR3 and GPR4 are used for passing an initrd,
which is used by yaboot (at least by my ancient 1.3.12 copy). This
mechanism is a bit fragile (relying on GPR4 never to be 0xdeadbeef
when GPR3 and GPR4 are not an initrd; and the real vs. virtual hack);
perhaps yaboot should set the linux,initrd-* properties in /chosen
itself?
So indeed, if you're writing a new bootloader / client interface,
it is safest to set GPR3 and GPR4 to 0.
Apologies for not double checking every documentation and all the
source code,
Segher
More information about the Linuxppc64-dev
mailing list