Subject: Re: ofwboot.xcf issues
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-macppc
Date: 11/30/2003 14:16:29
--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Nov 29, 2003 at 02:41:45PM +0900, Izumi Tsutsui wrote:
> In article <20031129051958.GD11133@netbsd.org>
> wrstuden@netbsd.org wrote:
>=20
> > OF loads ofwboot.{xcf,elf} into a temporary buffer at load-base, then=
=20
> > relocates the file out of it. That is why ofwboot.xcf's entry point is=
=20
> > different from load-base.
>=20
> I think load-base is used only when OF loads XCOFF files,
> and ofwboot.elf can't be loaded by OF directly.

Yes it can. OF 3.X does it fine. :-)

> 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..).

You're describing the "partition zero" boot method, which is why some boot=
=20
sequences need the ":0" (they don't all default to it).

> > What I don't understand is why we change load-base. From reading the co=
de,=20
> > we no longer need load-base set to the same thing as DEFAULT_ENTRY_POIN=
T=20
> > and RELOC. Do _you_ know why we keep them the same?
>=20
> ??
>=20
> 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.)

Ok. Previous documentation/code/experience gave me that impression back
when I started playing with this four years ago.

Oh, have you tried boot floppies? We should make sure they are happy with=
=20
this change.

> 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.
>=20
> 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.

Ok, then I like your patch. Let's move it to e00000. We won't have to move
it after that for QUITE a while. :-)

Take care,

Bill

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQE/ymw9Wz+3JHUci9cRAmJTAJ0UhPMusSSY2iLJsFXduWeQ+Ji4awCghqTd
DruGH2EfqpLvbbFSopkTDJw=
=LWRI
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--