Before You Begin
Since FMI/OS is still in its academic stages, it is not recommended you go deleting your existing operating system in order to install the system. FMI/OS works just fine under most x86 emulators such as "Bochs":http://bochs.sourceforge.net, "VMWare":http://www.vmware.com, and "QEMU":http://www.qemu.org without any special patches.
It further helps to have tools for manipulating dos filesystems. "mtools":http://mtools.linux.lu is useful in that it allows you to access a dos filesystem without having to mount it. This allows any user to be able to copy files in and out of the target device without needing special privileges. If you choose not to use mtools then you will need to figure out how to get the data copied on your own as this document will not cover it.
Both FMI/OS and VSTa rely on the "GRUB":http://www.gnu.org/software/grub/ boot loader. Even if you do not plan on using GRUB to boot your personal operating system, you will need it available to boot FMI/OS or VSTa.
Getting Userland
See: Getting the source
Setting up the boot image
In order to setup the boot image we need to let
"mtools":http://mtools.linux.lu know how where to create the image. While we
can do this all on the command line it is much easier to setup a
~/.mtoolsrc file as this allows us to use a variety of commands cleanly
without overly complicated command lines. As well, it allows us to easily
manipulate the image later for doing things like adding new FMI/OS kernels
to the image:
$ echo 'mtools_skip_check=1' > ~/.mtoolsrc
$ echo 'drive c: file="/home/bobdobb/fmios/c.img" partition=1' >> ~/.mtoolsrc
$
If we look at the .mtoolsrc contents we should have the two lines we just
added to the file:
$ cat ~/.mtoolsrc
mtools_skip_check=1
drive c: file="/home/bobdobb/fmios/c.img" partition=1
$
First let's create a 20M empty image file using dd. Note that the
bs=104856 argument to dd is stating that the blocksize is 1M, and we are
going to write that blocksize count=20 times:
$ dd if="/dev/zero" of="c.img" bs=1048576 count=20
20+0 records in
20+0 records out
$
The mpartition command wants sector/head/cylinder information about the
target image, so we have to supply that on the command line. For our drive
we are going to use a sectors per track (a track is the part of a cylinder
that is accessed by one head) count of 63 with 16 heads. The only
information we have to figure out at this point is the cylinder information.
We find this by doing a bit of arithmetic:
20 * 1024 * 1024 = 2097152020971520 / 63 / 16 / 512 = 4063/16/40 = sec/head/cyl information
Now we can use mpartition to prep the image we created:
$ mpartition -I c:
Warning: no active (bootable) partition present
$ mpartition -c -s 63 -h 16 -t 40 c:
$ mpartition -a c:
And then we create the partition:
$ mformat -n 63 -h 16 -t 40 c:
Let's test the image to make certain it behaves, if you get any sort of
error with the mdir command, then something went wrong:
$ mdir c:
Volume in drive C has no label
Volume Serial Number is ????-????
Directory for C:/
No files
20 434 944 bytes free
At this point we can copy the userland root filesystem into the C:
$ mcopy -sp rootfs/* c:/
$ mdir c:/
Volume in drive C has no label
Volume Serial Number is ????-????
Directory for C:/
boot <DIR> 2005-03-01 12:05 boot
vsta <DIR> 2005-03-01 12:05 vsta
2 files 0 bytes
10 844 672 bytes free
Now we need to create a floppy image for installing "GRUB":http://www.gnu.org/software/grub into the harddrive image:
$ dd if="/dev/zero" of="a.img" bs=1024 count=1440
1440+0 records in
1440+0 records out
$ dd if="/usr/lib/grub/grub/i386-pc/stage1" of="a.img" bs=512 count=1 conv=notrunc
1+0 records in
1+0 records out
$ dd if="/usr/lib/grub/grub/i386-pc/stage2" of="a.img" bs=512 seek=1 conv=notrunc
263+1 records in
263+1 records out
It is worth noting that the path to your stage1 and stage2 grub files may differ.
We also need to setup a grub.conf for doing the basic bootup work on the
system. Open up your favorite editor and create a file called grub.conf
that contains the following information:
# Globals
timeout 5
default 0
# FMI/OS
title FMI/OS
root (hd0,0)
kernel /boot/vsta
module /boot/cons2
module /boot/namer
module /boot/wd d0:readp
module /boot/dosfs -d //disk/wd:wd0_p0 -n fs/root -B 8192
module /boot/init
title Install grub
install (hd0,0)/boot/grub/stage1 d (hd0) (hd0,0)/boot/grub/fat_stage1_5 p (hd0,0)/boot/grub/stage2 (hd0,0)/boot/grub/grub.conf
Now copy the grub.conf file into the c: drive:
$ mmd c:/boot/grub
$ mcopy /usr/lib/grub/grub/i386-pc/* c:/boot/grub/
$ mcopy grub.conf c:/boot/grub/
At this point you have a bootable floppy image and a usable filesystem. All that is needed is to setup the emulator you have chosen to use these images.