From: Byron A Jeff (byron@cc.gatech.edu)
Date: 08/14/93


From: byron@cc.gatech.edu (Byron A Jeff)
Subject: Re: How to get a boot/root linux floppy
Date: Sat, 14 Aug 1993 16:19:14 GMT

In article <24iu37$n9a@vtserf.cc.vt.edu>,
Sandy Knapp <akingdom@vtaix.cc.vt.edu> wrote:
>Bob Crosson (crosson@cam.nist.gov) wrote:
>
>: Doing a 'dd if=/zImage of=/dev/fd0' copies a bootable image
>: to a floppy. I know this part works. The problem is how to
>: get a root file system on that same floppy and how to get the
>: image to mount that root file system.
>
>Actually it's really simple. Make your favorite file system on the floppy.
>Fill in the directory structure witth the required utilities and put a
>kernel on the disk. Install lilo on the disk (/etc/lilo). Set up the
>lilo config file to boot from /dev/fd0 and mount it as root. Run lilo
>and voila! bootable floppy.
>
>I'd love a good explanation of using a ramdisk as root though.

The rdev command comes to the rescue! It allows you to change the root
device, select a swap, set the video mode, and build a ramdisk. I gather
it operates on the kernel itself.

To expand on your example on the kernel you copied to the floppy:

- Mount the floppy (say on /mnt)
- run the command: rdev -r /mnt/Image 1440
  This creates a ramdisk that the root is loaded into. Use 1200 for a 1.2
  Meg floppy.

Now when the floppy is booted it'll create a ramdisk and load the entire
floppy into it. Access is FAST! but be aware that any changed will only
be reflected on the ram disk. If you want to change something on the
floppy you have to mount it and change the files on the mounted disk.

Now on to the next topic - separate boot/root floppies - I needed to
do this for the Slackware distribution because I only had a 1.2 Meg boot
floppy disk: (thanks to hartnegg@sun3.ruf.uni-freiburg.de (Klaus Hartnegg)
for the info)

1) Build the boot floppy by copying the kernel to the formatted floppy using
   the dd command: dd if=/Image of=/dev/fd0

2) Now set up another floppy with a file system. Fill it with the necessary
   utilities but WITHOUT A KERNEL! LILO is also not needed. This is the root
   floppy.

3) Back to the boot floppy. Run the following commands with it in the drive:

   rdev /dev/fd0 /dev/fd0
   rdev -r /dev/fd0 1200
   rdev -v /dev/fd0 -3

   These command set the root floppy to fd0, creates a ramdisk for the
   root floppy, and sets the video mode to ask for a mode respectivly.
   
4) OK the setup is done. To boot with your new system put the boot floppy
   in the drive and reboot. The floppy will load the kernel and ask for
   the video mode. When it does this swap the root floppy in. Now the
   ramdisk will be created and the root floppy copied to it.

I think that SLS/Slackware should be distributed like this. I know it kinda
a pain to have to rawrite 2 floppies instead of one. But it'll give the
installation disks enough space to include useful items like an editor
and the netstat and ping commands (for Slackware at least).

Now I have a couple of questions:

1) I was able to create my root/boot pair from hacking up the A1 disk
   int the slackware distribution. But I needed a 1.44 3.5" floppy to
   do it. Is there any way with normal tools that I can access the a1disk
   file as a filesystem? I know the loopback driver can do it but it
   requires a kernel patch to a pl11 kernel or higher which can't be
   easily done when you don't already have a kernel that high.

2) How do you use a boot/root pair with a video system that has only
   one video mode?

BAJ