Tips for NACHOS Assignment 4


Under Construction

This document is currently incomplete.


Building a File System

Assignment 4 is to be done inside of the directory code/filesys.

NOTE: The Makefile for this assignment probably needs to be modified to reflect the changes that you've made to the system in assignments two and three. For most groups you'll probably want to delete the definition of THREADS and add the definition for USE_TLB (in code/filesys/Makefile). The resulting DEFINES should look like:

        DEFINES =-DUSER_PROGRAM -DVM -DUSE_TLB -DFILESYS_NEEDED -DFILESYS

I've also compiled the standard (original) version of the filesystem in /cs/course/4321/code/filesys which you should be able to execute to check if you "baseline" system is working properly. Remember that you won't be able to execute Nachos in that directory because it needs to create and write to a file named "DISK" in the current directory. Instead copy Nachos to one of your directories and try it out.

A Possible Strategy

Before you Start

Read all of this document first.

Have a look at the the Nachos Roadmap document. In particular the following sections should prove useful:

Understand what the current implementation does: how file headers and the directory are implemented, how a file is organized, how free blocks are maintained and organized as well as how FetchFrom and WriteBack work and why they are used/needed.

You should also examine and understand the current implementation of the filesystem related classes before you start to modify any code.

A Special Note on Why Your Programs May have Stopped Working

In the previous assignments the file system has been simulated using the UNIX file system. This meant that when a user program called Read or Write it "held" for the duration of the entire underlying UNIX read or write call. Now that the real Nachos file system is being used a user program that causes any type of disk operations (e.g., page faults, calling Read/Write/Open/Create) will be blocked waiting for the completion of the disk operation. While that user program is blocked another user program may be run.

NOTE: these types of problems should only be caused when you have multiple user program executing concurrently. If you have this problem then it's very likely that you have bugs in the implementation of your previous assignments.

You can:

You may wish to reread the tips on Improving the File System Simulation from the previous assignment.

Getting Started

Things to Remember (Gotcha's)


Modified: Nov 18, 1995
Created: Nov 18, 1995