|
| |
![]() |
|
Introduction to File SystemThe file system implementation in Nachos comes with two versions: a stub and a 'real' version. The stub version is basically using the UNIX filesystem operations provided on the machine where Nachos is running. The 'real' file system version is built on top of a disk simulator. The disk is simulated using the UNIX file system. In Nachos, there are several classes and structures that describes the file system. The most important ones are described below. FileSystemThis class has data structures that represents the NFS (Nachos File System). It also provides operations to perform certain file system managing. For example creating, opening, deleting and naming files. OpenFileThis class manages the manipulation of separate files, for example read, write and seek. An OpenFile object is retrieved by using the FileSystem object open() method. SynchDiskThis class provides a synchronous interface to the raw disk device. For example SynchDisk provides mutual exclusion to disk access, so that the threads are able to do disk operations concurrently. SynchDisk must exist in a multiprogrammed environment, because the raw Disk object cannot serve more than one process at a time. FileHeaderEach file in the file system has a file header. The FileHeader object provides information on the storage of the file. For example, the size of the file (number of bytes), number of allocated data sectors and where on the disk the file is stored (the sector numbers). The file header can be stored both on disk and in main memory. DirectoryThe Directory class describes a directory together with different operations that can be performed on it, or example adding or removing a file from the directory. A Directory object consists of a table of pairs: <filename, start sector> where 'start sector' is the first sector of the file's FileHeader object. |
Nachos Introduction Tutorials |
| © 1999-2008 - All rights reserved. CS tutorials™ and the logo are registered trademarks of CS tutorials. | |