Subject: Re: Son of diskless boot
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: port-i386
Date: 05/23/1997 12:37:06
Excerpts from netbsd: 23-May-97 Re: Son of diskless boot Jonathan
Stone@DSG.Stanf (2192)

> Hmm. But I'm using the new bootblocks on a floppy, to boot a kernel
> with root and swap on NFS. (and so is entropy@zippy.bernstein.com).
> That setup finds the network interface just fine.

If it comes to nfs in setroot(), it will take the first interface found.
So it works if there is only one, or if the right one is founf first.

> Does booting from flopppy cause the kernel to receive the major/minor
> for the floppy, tricking setroot() into continuing far enouhg to call
> nfs_setroot()?

That's it! There is a comparision at the beginning of setroot()
which should cause that (bootdv != 0).
(Probably only if the floppy is configured into the kernel.)
The "bootdv" argument to setroot() is ignored later.

> If the i386 kernel needs _some_ kind of major/minor,
> and it's not getting one from dosboot, then isn't that a bug in
> dosboot ( or the kernel)?

One could fake a major/minor and pass it to the kernel.
One could even assign a major number for this purpose
to "net".
A better way would be probably to change setroot() so that
it doesn't stop if there is only 1 possible boot device.
("nfs" specified and only 1 interface, or only 1 disk)
But the way to go imho is drop all this major/minor stuff
and to pass a string and/or enough physical attachment
information to the kernel so that autoconf() can figure out the
device entry.
At the moment, information about major device number
assignment is scattered in
-conf.c
-"files", for "config"
-the bootblocks.
It would be a simplification (and a possible bug
removed) to clean this up.

> I'm not sure I want bootblock patches.  If the bootblocks find and
> load a kernel, and that kernel is configured for root on NFS only,
> then surely the kernel should get root on NFS irrespective of what the
> bootblocks pass it. 

This should be handles by the mi setroot(). As I said, it makes
only sense if there is only 1 interface.
btw, I'd like to pass the bootblocks media selection information too.

> I would like patches to do a Sun-style "boot -a" (the bootprom prompts
> for the device name and type from which to load the kernel, and the
> kernel does the smea thing for root and swap),

This is a bit limited on the PC. Usually one has a boot ROM for
a specific interface. I agree that the real choice should be left to
the kernel (one argument more not to pass major/minor).

best regards
Matthias