[TUHS] Pre-init initialization

Theodore Y. Ts'o tytso at mit.edu
Thu Aug 8 23:31:24 AEST 2019


On Wed, Aug 07, 2019 at 10:40:06AM -0600, Warner Losh wrote:
> The move into RAM disks happened as memories grew. This obviated the need
> to copy a filesystem to a new disk's swap space and then use that to really
> install the system.
> 
> Kernels with bundled RAM disks were a thing in BSD for a long time, though
> I'm unsure when that functionality entered the code stream. I know the
> early versions of FreeBSD's installer ran out of a RAM disk loaded off
> floppies, though that's not the same as initrd since there never was a
> pivot to something else: just a reboot to boot the real thing.

I implemented loading the root file system as a ramdisk from a floppy
in 1991 for Linux.  This predates the publication of 386BSD, and I
wasn't aware of how commercial Unix systems did their initial
installation and setup.  So as far as I know I came up on it on my
own, but none of this was especially earthshaking or subtle.

Linux's ramdisk was implemented because most PC's of the day (I was
using a 40 MHz 386 with only a megabyte of memory) only had a single
floppy drive (and if they had a second it was a 5.25" drive).  So the
very first implementation which I did assumed the kernel would be no
larger than 512k, and looked for Minix file system signature at 512k.
If it existed, it would load it into the ramdisk and use that as the
boot region.

Before that, the kernel was loaded from the first floppy, and then
kernel would prompt the user to eject the boot disk and insert the
root disk, and hit any key to continue, and then it would mount the
root disk.  But then the only floppy drive would be tied up with the
root file system, so that meant there needed to be a second kernel on
the root floppy, and everything else needed to set up the root image
would have to be copied to the hard disk, and then you'd have to
reboot to release the floppy drive so you could install other programs
that couldn't fit on that initial 1.44MB root floppy.

For people who are interested in the history of initrd used as part of
the boot process in Linux, please refer to Werner Almesberger's 2000
paper, "Booting Linux: The History and the Future"[1], presented at the
Ottawa Linux Symposium.

[1] http://www.almesberger.net/cv/papers/ols2k-9.ps.gz

Cheers,

					- Ted


More information about the TUHS mailing list