CSE 451

Introduction to Operating Systems

Spring 1999


Program 3   Filing System

Due: Wednesday, June 2, 10:20 A.M.

What to turn in:

How to turn in:
Use the turnin method of the last program: Take all your project files (.java, .class, .sln, ...), traces of test runs, and your writeup (readme.txt), and zip or tar/gzip them into a single file. Send via attachment to:  cse451-TA@cs.washington.edu

The goal is to gain some experience in building file system structures. The system of directory and data files (DDF) is organized in a tree structure, with data files as leaf nodes, and directory files as internal nodes and the root.  The filing system should also maintain a Transaction Log that contains the history or trace of all commands that change the DDF, thereby allowing the DDF to be reconstructed, for example, in case of a crash.  There should be at least three threads: Input Handler, Output Handler, and File Manager.  The principal data structures are the DDF, Transaction Log, and Active File Directory. (See Figure.)

A data file is a sequence of fixed length records. A record is an integer.  A directory name or data file name, relative to its parent, is a string.  A directory file is a list of nodes, each of which contains a descriptor for a child data file or a child directory file.  Your program should implement the following commands, entered from the terminal:

1. Data File commands -  Open, Close (includes Create, Destroy)
     Read, Write sequential
     Display: Output the named file.
2. Directory commands -  Create, Destroy (similar to Unix mkdir, rmdir)
     Change Working Directory (similar to Unix cd)
     Display: Output the named directory.
3. Transaction Log command - Display: Output the log.
4. System command - Display: Output the Active File Directory.

The DDF and Transaction Log are stored entirely in main memory. Note that more than one file can be open (active) at the same time.


Here is the graph for the system organization:



cse451-webmaster@cs.washington.edu