Project 5 Mechanics
Please do the following things as soon as possible:
- You will need a different set of kernel sources than you used in project
2 so that the module you create will be compatible with the kernel that is
installed on VMWare. On coredump or spinlock, get the file /cse451/doug/linux-2.4.2.tar.bz2.
Also, the file /cse451/doug/rd.o is necessary so that you can set up a ramdisk
in VMWare to test your file system.
- Unpack the starter code and make sure you can "make" it.
- The subdirectory mkfs produces mkfs.cse451fs, which sets up a disk
partition. Just enter the directory and type "make".
- The subdirectory fsSource contains the cse451fs file system
source. To make it, it has to appear to be part of the
Linux source tree:
- Navigate to .../linux/fs.
- "mv minix minix-orig"
- Now create a symbolic link named "minix" to the
directory you will keep your working copy of the source in.
For me, this was done using
ln -s /cse451/doug/.../fsSource minix
- Type "make
dep". (You'll need to do that any time you change the set
of source files in file system, or what they depend on. Most
likely you'll have to do it only once.)
- Type "make modules". This will compile the file system source
(in the folder you've linked directory 'minix' to). Verify that the file cse451fs.o has been created in your
file system source working directory.
- Try out the file system on a VMware machine. Once you have the VMware machine up, and have ftp'ed
rd.o, mkfs.cse451fs and
cse451fs.o to it, there are a few steps:
- Setup a ramdisk by typing "insmod rd.o rd_size=<size in KB>".
- You now need to set up the file system on the partition
/dev/ram0. The program mkfs.cse451fs will do that: "mkfs.cse451fs
/dev/ram0"
- If you want to look at what has been written to disk, try "hexdump
-n 9192 /dev/ram0" or "xxd -s 1024 -l 1024 /dev/ram0 | less"
- You now need to install the file system (which has been created as a
module) into the kernel: "insmod
cse451fs.o". lsmod(8) will list loaded modules.
- Now, finally, you need to mount the new file system. Create an
empty directory (say, cse451fsmnt), and then
mount -t cse451fs /dev/ram0 cse451fsmnt
- At this point, you should be able to cd into cse451fsmnt, create
directories and files, do an ls, and (almost) everything else you're used to.
- When you're done, cd out of the mounted file system, then do "umount
/dev/ram0" and "rmmod cse451fs". You can now repeat
the above steps with a newer version of your mkfs program and file
system
module if you need to.