Subject: Re: ofwboot.xcf issues
To: None <wrstuden@netbsd.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-macppc
Date: 11/29/2003 14:41:45
In article <20031129051958.GD11133@netbsd.org>
wrstuden@netbsd.org wrote:

> OF loads ofwboot.{xcf,elf} into a temporary buffer at load-base, then 
> relocates the file out of it. That is why ofwboot.xcf's entry point is 
> different from load-base.

I think load-base is used only when OF loads XCOFF files,
and ofwboot.elf can't be loaded by OF directly.
If no filename is specified on boot command,
OF checks apple partition map (set by installboot) and loads
bootxx at 0x4000, which is specified writeapplepartmap() in
usr.sbin/installboot/arch/macppc.c (um, bad magic..).

> What I don't understand is why we change load-base. From reading the code, 
> we no longer need load-base set to the same thing as DEFAULT_ENTRY_POINT 
> and RELOC. Do _you_ know why we keep them the same?

??

There is no such restriction to sync load-base and DEFAULT_ENTRY_POINT.
(load-base on my Apus is 0x100000 now, but it just works.)
As noted above, OF doesn't use load-base to load bootxx,
and bootxx doesn't refer load-base either.
If you are using ofwboot.xcf, bootxx is not used at all to load it.

What I said is that we have to sync DEFAULT_ENTRY_POINT in bootxx
and RELOC (which is also passed to ld for TEXT address) in ofwboot.
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp