Subject: Re: Two-stage netboot
To: Gregory McGarry <g.mcgarry@qut.edu.au>
From: Simon Burge <simonb@netbsd.org>
List: port-pmax
Date: 06/28/1999 10:30:24
Gregory McGarry wrote:

> The last discussion about the two stage netboot, mentioned that
> the netboot file has to determine the root filesystems to load
> the kernel from.  The PROM should have this information from
> its bootp query.  I cannot find its location in any documentation.
> 
> I assumed that the PROMs utilise the first 192kB of RAM for its
> scratch area and did a search through this memory block for
> any indication.  I did this on a maxine.
> 
> Well, the PROM does use a network buffer in this area, and I did
> find a record for the bootfile, but it doesn't look like the
> the root filesystem is recorded.
> 
> I don't think the details are useful, but I can supply them if
> you want.
> 
> I just don't like the idea of doing three bootp broadcasts to
> netboot a kernel.
> 
> Regards,
> Greg

I still haven't gotten around to seriously looking at a multi-stage
network boot, but I anticipate something like (pretty much as you
describe):

 + The PROM does a bootp request to load the first stage.

 + First stage is a little ECOFF program.  It knows how to NFS mount the
   root filesystem, and gets this info from bootp/dhcp.  The first stage
   does a bootp/dhcp request to find the NFS root, and then loads the
   kernel.

 + By default, the the kernel will use bootp/dhcp to again find the NFS
   root.

So, yes, three bootp requests.  The first one obviously can't be
removed.

I'm wary of the first stage loader probing memory looking for the info
the PROM received.  Unless there's a documented interface (I don't care
where the documentation comes from :-), we have to be sure we can handle
_all_ PROMs - from the early machines like 5400's and 3100's right up to
the last turbochannel machines like 5000/2xx's.  I also wonder if the
PROM throws out the "rp" entry and just keeps the "bf" entry - after all
it doesn't need to know this to load the boot file.

From the pmax point of view, it's easy to for the first stage to pass
the details of the bootp/dhcp response to the kernel with a bootinfo
record.  I dunno if there's an easy way to tell nfs_mountroot and
friends that we already know the info, but that's just a programming
issue.

Can I ask what's wrong with three bootp requests going out?

Simon.