Subject: Custom boot floppy
To: Netbsd-Users \(E-mail\) <netbsd-users@netbsd.org>
From: Rose, Brian <Brian.Rose@icn.siemens.com>
List: netbsd-users
Date: 12/20/2002 08:09:43
I currently have a NetBSD kernel on a floppy. When the kernel is done
booting, it prompts for the root filesystem on another floppy. What I would
like to do is to take the files on my filesystem floppy and place it in the
kernel as a RAMDRIVE.

I started by looking at the INSTALL_xxx configuration files in the
/usr/src/arch/i386/conf file. I see where the MEMORY_DISK_IS_ROOT is set,
but I do not see how the memory disk is initialized.

I looked over the /usr/src/distrib/i386/floppies directory to see if it
yielded any clues. In the ramdisk-small/Makefile there is the line
"IMAGE=ramdisk-${BOOTMODEL}.fs" where BOOTMODEL is "small". Where is this
ramdisk-small.fs? Is it generated or do I need to put it in some location?
If it is generated, how is it generated? How is it linked to a kernel build?
This seems to be bringing up more questions then it is answering.

Here's my assumptions as to how to go about creating a custom memdrive boot
floppy. I'm guessing the newfs line will need to change for a memdrive. 

Phase 1 - Create the file system
--------------------------------
1) dd if=/dev/zero of=myfilesystem.img bs=1440k count=1
2) vnconfig -c -v /dev/rvnd0 myfilesystem.img
3) newfs /dev/rvnd0a floppy
4) mount -t ffs /dev/vnd0a /mnt/mystuff
5) copy my files to /mnt/mystuff
6) umount /mnt/mystuff
7) vndconfig -u /dev/vdn0

Phase 2 - Build the kernel
--------------------------
cd /usr/src/sys/arch/{arch}/conf
2) cp INSTALL MY_BOOTFLOPPY

Phase 3 - ??? - Link the kernel to the file system?
  (edit MY_BOOTFLOPPY? where?)
--------------------------------------------------------

Phase 4 - Profit!


Thank you in advance for any light that you may be able to shed on this
subject.


Brian Rose
brian dot rose at icn dot siemens dot com
407-942-6934