Subject: Re: PPC assembly
To: Andy <andy@softbook.com>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 05/09/2000 22:54:08
On Mon, 8 May 2000, Andy wrote:

> Thanks  a lot for a thorough explanation!
> Couple more questions:
> - There's a RELOC variable in the /macppc/ofwboot which is set to 6c0000
> I also noticed that bootxx uses this value as a DEFAULT_ENTRY when it
> writes the boot blocks.

0x6c0000 is where ofwboot wants to be loaded. It's also where the xcoff
version MUST be loaded. :-)

> Also this value is used in  boot.c :chain () routine.

You should look at the OF_chain implimentation in Locore.s before saying
that. :-) The idea is that when chaining from one program to another, you
can release the memory of the previous program once you're done. :-)

> Is  0x6c0000 the address where the booter is relocated  Or is it the kernel?

ofwboot. Note also that it is technically where it is loaded. Relocating
implies scanning over the symbol table and tweaking ones which needed
updating due to the relocation. I believe ofwboot is linked so that it
needs no relocation. I'm sure I'll be corrected if I'm wrong. :-)

> What is the address that the kernel is relocated to and who sets it?

Check the MI loadfile() routine, as it actually loades the file. It lives
in sys/lib/libsa/loadfile.[hc] . But I expect the -Ttext declaration in
the kernel build sets it.

> Does the kernel expect to be in a certain place in memory or it's arbitrary?
> What other sources of info besides pem32b.pdf would you recommend to
> understand low level boot on a PPC machine?
                               ^^^^^^^^^^^^^

There is no one resource for that info. PReP machines do one thing, real
OF machines do another, and Apple OF does whatever it wants (and is
version specific).

:-)

Welcome to the joys of low-level i/o.

Take care,

Bill