Lab 7: File Systems

Due: 2004
Web posted: Monday April 06, 2004


File Systems

The goal of this lab is to write a simple UNIX-like file system. The file system you will write make the following simplifying assumptions:


The layout of your 128 KB disk is as follows

For more related information, please refer to Lab details.

You need to implement the following operations for your file system.


Background

An example to mount BFS file system

To enable bfs filesystem in UML, you should create a second ubd block device and mount it under UML. For example, the following steps tell you how to mount a bfs filesystem.

  1. If you have not compiled bfs before, select bfs using make menuconfig, then recompile UML kernel
  2. Before you start UML, go the directory where you put root_fs
  3. Make a 4M image: dd if=/dev/zero of=bfs_fs count=4 bs=1M
  4. Go to your source directory and start UML: ./linux ubd0=../root_fs ubd1=../bfs_fs
  5. Inside UML, create a new bfs filesystem on the 2nd block device: mkfs.bfs /dev/ubd/1
  6. Create a mount point: mkdir /fs
  7. Mount your bfs filesystem: mount -t bfs /dev/ubd/1 /fs
Other very useful informations :


Submitting Your Assignment

Please submit the following items to lab7 dir on elgate:
  1. All source codes/files that you have added/modified and the demonstrative results;
  2. A "README" file that contains the follows :
  3. Compiled kernel image with the new changes. Also please notify us which root filesystem you have been using for all labs.

Thank you and have fun!