Subject: Re: netbooting rev C iMac without NFS and ofwboot?
To: Kirill Levchenko <kirill@lava.net>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-macppc
Date: 03/17/2004 12:24:03
--bAmEntskrkuBymla
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 16, 2004 at 09:45:56PM -0800, Kirill Levchenko wrote:
> On Tuesday, March 16, 2004, at 03:31  PM, Chris Tribo wrote:
>=20
> >	Is there a reason this shouldn't work?
>=20
> The kernel ELF executable is probably not "properly conditioned" to be=20
> loaded with Open Firmware. For example, for XCOFF loading on earlier=20
> revisions, the sections have to be on page boundaries; I suspect this=20
> is what is causing your error. The kernel image is meant to be loaded=20
> by ofwboot.xcf.

I bet the error's something else. tftp laoding uses the area at=20
"load-base" as a scratch area. The kernel will try to load itself there,=20
which won't work. The CLAIM FAILED is probalby due to the fact OFW has=20
already reserved its scratch area, so the ELF loader can't grab that=20
memory for the kernel. You are right that ofwboot.xcf is what we expect to=
=20
load the kernel. :-)

> >Why is ofwboot.{xcf,elf} trying to connect to portmapper to
> >find the kernel on NFS?
>=20
> This is how ofwboot works; it fetches the kernel via NFS.
>=20
> >What's wrong with sending it out over tftp?
>=20
> This is a good question, and one that I have recently asked myself.=20
> Perhaps some of the more experiences users can comment on this. My=20
> guess is that having it on the NFS server, together with the rest of=20
> the file system, gives the booted machine the same "view" as a machine=20
> with a real disk, in the sense that the kernel image is sitting the=20
> root directory. This may be useful for debugging, etc. Another=20
> possibility is that Open Firmware's TFTP is not reliable enough for=20
> transmitting such a large image, though this is probably handled=20
> well-enough at the link (ethernet) level.

There's also the fact that a number of tools used to need an image of the
kernel to be able to access kernel variables. Things like ps and netstat,
which use libkvm.  While NetBSD has been moving away from libkvm, a number=
=20
of tools still use it. Looking around, it seems the list is: ccdconfig,=20
fstat, modstat, netstat, pmap, systat, vmstat, pstat, slstats, and trpt.

Also, the netbooted kernel will want to find root on nfs, so being able to=
=20
netboot w/o an NFS server is not a common configuration.

> For the same reason, why don't we boot the kernel directly from the=20
> first-stage bootloader? From the Apple partition map info it looks like=
=20
> we certainly have enough room to place a capable-enough bootloader=20
> there.

Because using apple partition maps is relatively new. I support it, but=20
it's still new. ;-) And, our prefered method is to just put ofwboot.xcf on=
=20
an msdos or hfs partition.

> >	The same thing happens with netbsd-INSTALL ungzipped. Does
> >everyone set up an NFS server just to netboot an install kernel?
>=20
> Yes. Presumably, the idea is that the reason you are netbooting is=20
> because you want to run the machine diskless.

Indeed. The install kernel is one of the few cases where you wouldn't be=20
running the machine diskless.

Take care,

Bill

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

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

iD8DBQFAWLPjWz+3JHUci9cRAoSGAJ9Er0QVcrAxiSEwv29FORhp8f08VgCdEiEs
MlE7uSXJSRctplP+91Qzkec=
=WmJU
-----END PGP SIGNATURE-----

--bAmEntskrkuBymla--