next up previous contents
Next: SynchDisk Up: A Road Map Through Previous: Execution Trace of User-Level

Nachos Filesystem

  There are two versions of the Nachos filesystem. A ``stub'' version is simply a front-end to the Unix filesystem, so that users can access files within Nachos without having to write their own file system. The second version allows students to implement a filesystem on top of a raw disk, which is in fact a regular Unix file that can only be accessed through a simulated disk. The simulated disk accesses the underlying Unix file exclusively through operations that read and write individual sectors. Both file systems provide the same service and interface.

Files are accessed through several layers of objects. At the lowest level, a Disk object provides a crude interface for initiating I/O operations for individual sectors. Above Disk, the SynchDisk object provides synchronized access to a Disk, blocking callers until a requested operation actually completes. In addition, SynchDisk allows multiple threads to safely invoke disk operations concurrently. The FileSystem object handles creating, deleting, opening and closing individual files. Sitting alongside the FileSystem, the OpenFile object handles the accessing of an individual file's contents, allowing seeks, reads, and writes. The FileSystem::Open routine returns a file descriptor (actually an ``OpenFile *''), that is used to access the file's data. The raw Disk object was described in Section 2.6. The remaining objects are discussed in detail below.





Thomas Narten
Mon Feb 3 15:00:27 EST 1997