Project 4 Mechanics
Overview
- You'll be working in teams of three to build a file system.
- Team assignments are here.
- Alpha release starter software is at spinlock:/cse451/Proj4FS-V0.8.tar.
(It currently has a tendency to crash, but that will be fixed.)
- Group project file space will be set up later today.
Please do the following things as soon as possible:
- Contact your team members and figure out how you will stay in touch with
each other.
- Plan to use source control. (I recommend rcs because it will prevent
simultaneous editing of a single source file, but it's up to you what you
want to use.) If some of your team doesn't know how to use the source
control system and others do, take the time now to get everyone up to speed
on it.
- 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:
- Unless you're unusually confident in your scheduler, save the
scheduler code and create a fresh copy of the source tree on your
coredump/spinlock disk space.
- 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 /homes/iws/zahorjan/.../fsSource minix
- Back to your Linux source root directory. Type "make
menuconfig". You'll get a menu.
- Select "Loadable module support" (near the top), and
then enable module support by typing 'Y'.
- Exit that menu back to the main menu by navigating and selecting
"exit" at the bottom.
- Select "File systems" (near the bottom of the main
menu).
- Select the "Minix" line and type 'M' (meaning "I
want this as an installable module")
- Select exit at the bottom, then exit at the bottom again (in the
main menu), and then say "Yes" to saving the new
configuration.
- 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.
- When running VMware, you need to be sure that the kernel you're running is
built from the same source as the one you've just spliced your file system
code into above. On our lab machines, when you start VMware, you want to choose configuration
"linux_4". If you don't see it, browse to
d:\apps\vmware\vms\linux_4. If you don't find it there, try another
machine. (This new VMware image is being propogated, and may take a
while to reach all of our machines.)
[Now out of date information on that might help you with a home installation
of VMware is here.]
- Try out the file system on a VMware machine. Once you have the VMware machine up, and have ftp'ed mkfs.cse451fs and
cse451fs.o to it, there are a few steps:
- "fdisk /dev/hdb", then create a single partition using 'n'
(answer 'primary', 1, any size you feel like), then do a verify ('v') and a write ('w').
- You now need to set up the file system on the partition
/dev/hdb1. The program mkfs.cse451fs will do that:
"mkfs.cse451fs /dev/hdb1"
- If you want to look at what has been written to disk, try "hexdump
-n 9192 /dev/hdb1"
- You now need to install the file system (which has been created as a
module) into the kernel: "insmod cse451fs.o". If
you get is a bunch of errors, the VMware machine probably needs to be
running a different version of the kernel. (Make sure you use the
linux_4 vmware configuration, which should avoid this problem.)
- Now, finally, you need to mount the new file system. Create an
empty directory (say, cse451fsmnt), and then
mount -t cse451fs /dev/hdb1 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/hdb1" and "rmmod cse451fs".