home tutorials faq contact
CS tutorials Share you information

Introduction to File System

The 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.

FileSystem

This 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.

OpenFile

This 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.

SynchDisk

This 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.

FileHeader

Each 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.

Directory

The 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.

Continue to Lab 5 Tutorial

Nachos
Tutorials
Roadmap
Source Code

Introduction
Threads
Interrupts
Synchronization
System Calls
Exception Handling
Multiprogramming
File System
Networking

Tutorials
Lab 1 Tutorial
Lab 2 Tutorial
Lab 3 Tutorial
Lab 4 Tutorial
Lab 5 Tutorial


© 1999-2008 - All rights reserved. CS tutorials™ and the logo are registered trademarks of CS tutorials.