Subject: Re: Some OF questions
To: Andy <andy@softbook.com>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 07/07/2000 14:04:16
On Fri, 7 Jul 2000, Andy wrote:

> The FAQ states that for OF 2.0x you need to  "setenv LOAD-BASE 0x6c0000" to
> use ofwboot.xcf
> 
> -Is "LOAD-BASE" same as "load-base" that you see as a result of
> "printenv"?. If not- what's the difference between the two?

Hmmm... maybe that's supposed to be load-base.

> -"load base" does not accept the numbers in hex (0xXXXXX )format, only
> decimal ( if you type "setenv load-base 0x6c0000"  it complains) However
> LOAD-BASE is happpy to accept a hex value. From which I surmise that all
> numbers you see in "printenv" are in decimal. Is this so?

Unsure.

> -Can someone explain the importance of the ofwboot.xcf being loaded at
> 0x6c0000.  I understand this value comes from the ofwboot makefile  where
> the linker is instructed  to write this value as a starting address of the
> text segment of the program. But why 0x6c0000 and not any other value?

Because there's nothing around to relocate the program once it's loaded.
It has absolute references to addresses in it, and if it's loaded
somewhere else, these will be wrong.

For starters, in COFF format (and thus in XCOFF), the first uint32_t of
the text section (program code) is the address of the first instruction to
execute. So if we loaded the code somewhere else, this address would be
pointing into nowhere.

> - I can boot  ofwboot.xcf from a DOS floppy ( and subsequently the 1.4.2.
> kernel)  on a beige G3 ( OF 2.0.4) without setting LOAD-BASE to 0x6c0000.
> Why is this possible?

I'm not sure. What is load-base set to after doing this?

I've noticed that some of the load methods (like net booting) will ignore
load-base and will actually look in the binary for where to load it. The
info is there, so it's kinda silly to have to have an environment
variable. :-)

> Does  the load-base value  affect only the booter or also the kernel it's
> loading?

Only ofwboot. ofwboot will look at the kernel binary to figure out where
it goes.

Take care,

Bill