Subject: Re: ofwboot man page 2nd draft
To: Chris Tribo <t1345@hopi.dtcc.edu>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 11/06/2000 15:53:19
On Mon, 6 Nov 2000, Chris Tribo wrote:

> On Mon, 6 Nov 2000, Bill Studenmund wrote:
> 
> 	I use just "boot enet" and it bootp's just fine with a standard
> bootp setup FWIW.

Hmmm.. This is OF 2.0f1? Mine won't do that - it insists on the :0.

> > I also think we might need to make two ofwboot.xcf's. I can't netboot the
> > one we now have, which is set to work with load-base == 600000 unless I
> > have loadbase != 600000. But the MacOS X boot loader (which is the next
> > thing to load if I want to boot MacOS) will NOT work with loadbase !=
> > 600000. An ofwboot.xcf set for 680000 will netboot fine with load-base ==
> > 600000. Yes, this is weird!
> 
> 	I suppose actually figuring out why we can't netboot at that
> address is out of the question? :-) I really don't think that a 56k file

The address itself is not the problem - the fact that load-base is the
same value that the xcoff file wants to be loaded at is the problem.

> should be causing a problem with OFW. I would think that we are *not* in a
> area similar to high-RAM on a *shudder* x86 machine in which there are
> volatile things like video ROM area, BIOS, etc. where we would have to
> worry about boundaries? Something isn't quite right here. How can we
> load an entire 3MB kernel, and MacOS X boots from the same load-base, yet
> netbooting freezes the computer there from a 56k file. Is it possible the
> ethernet hardware is leaving an interupt enabled, or clearing interuppts
> before it finishes loading itself into RAM. Does OS X/public Beta use a
> two/three stage booter for OFW 1.x and 2.x? 

I'm only familiar with MacOS X booting off of disk, so I'm not sure what
they are doing.

> 	 How about this explination: OFW tftps ofwboot.xcf at the address
> ofwboot is compiled to use,then reallocates (or even makes a copy to) 
> to the OFW load-base value and executes it. Any chance we are
> overwriting an area of our own ofwboot and confusing the heck out
> of OFW? Perhaps it treats load-base as an offset of real-base? Anyone
> used the fcode-debug or other debuging options on OFW? I really know
> absolutely nothing about what I'm talking about, just thinking aloud...

I think you got the jist right. The errro I see is that I get a DEFAULT
CATCH error part way through loading the .data section. It could be before
the .bss gets set up though. This all happens well before we try to exec
the loaded ofwboot.

real-base has nothing to do with it AFAICT.

I _think_ what the driver is doing is using an area relative to load-base
as a staging area or temporary storage area. It could in fact be using
load-base as a pointer to a scratch area. :-) I'd need to tcpdump the tftp
session to be sure. :-(

The simple answer though is that on my G3 with the MacOS X nvram patches I
can't load an ofwboot.xcf using the load-base value for which it was
designed.

Take care,

Bill