Subject: Ideas on one-floppy installation
To: Frank van der Linden <vdlinden@fwi.uva.nl>
From: Perry E. Metzger <perry@imsi.com>
List: current-users
Date: 10/18/1994 10:42:11
Frank van der Linden says:
> > The right thing, I think, would be to take a page from BSDI and from
> > SunOS and build an installation file system inside an MFS "partition"
> > so that the floppy is no longer needed. I don't think it would be
> > excessively hard to do this...
>
> I have thought about this, but the problem to me seems to be, that you
> need a root device which is _not_ the floppy drive you want to install
> from. You can solve this by copying the original root (floppy) filesystem
> on to the harddisk, and then using that to boot, copy the floppies, boot
> from floppy again, extract, and boot from HD again.. Not a beauty though.
> MFS sounds good, but: how do you tell the kernel that it should switch
> its root device to the MFS partition (since that is what it seems to be
> coming down to?).
Oh, its even harder than that -- if you use MFS qua MFS you lose. I
really spaced completely. MFS works by establishing a bunch of memory
inside an mfs process which it then hands off to the mount call, so it
can't be invoked before boot and isn't appropriate. BSDI gets around
all this by not letting you install from floppy at all -- they just
boot from floppy. (They use the MFS off the boot floppies to provide a
place for scratch files.)
I don't think, however, that the "memory filesystem" approach to
booting is impossible. Here is an idea.
First, you need to be able to load a kernel into memory and then tell
it to use root on another file system than the one you loaded from
(which will be a floppy). The changes needed to rig boot to load a
kernel into memory and then switch to another file system are well
understood.
You then need some space in memory that you know for a fact won't be
nuked that you are going to have to preload with the image of the root
file system. I suggest using high memory since its simpler to pretend
that some high memory isn't there than it would be to map around lower
memory. What one can then do is rig the initial (special) kernel off
the first boot floppy so that it "knows" that the top, say, 2 Meg of
memory "don't exist".
You then need a way to use the memory you've just saved as a disk -- I
suggest an astonishingly simple minded driver built into into the
initial kernel that uses the top couple of meg as a ram disk. Given a
kernel that "knows" not to know about the top of memory and a driver
that can read that memory as disk, the proceedure becomes this...
1) the hacked boot loads the hacked kernel into memory, and prompts
you to change floppies.
2) The hacked boot loads the second floppy verbatim (sector for
sector) into the top of memory.
3) The hacked boot starts the kernel which you tell that root is on
the "in memory" file system.
You now no longer have any dependancy at all on the floppy drive.
This seems straightforward to do, but also seems like a bunch of work.
It would be rather cool, of course...
Perry