tac0S
Template Affectional Command Operating System
|
Data structures to represent the Nachos file system. More...
Go to the source code of this file.
Classes | |
struct | path_parse |
struct | file_table |
struct | global_file_table |
class | FileSystem |
Macros | |
#define | MAX_OPEN_FILE 50 |
#define | ROOT_DIRECTORY_FILE 0 |
#define | CURRENT_DIRECTORY_FILE 1 |
Typedefs | |
typedef struct path_parse | path_parse_t |
typedef struct file_table | file_table_t |
typedef struct global_file_table | global_file_table_t |
Data structures to represent the Nachos file system.
A file system is a set of files stored on disk, organized into directories. Operations on the file system have to do with "naming" – creating, opening, and deleting files, given a textual file name. Operations on an individual "open" file (read, write, close) are to be found in the OpenFileTable class (openfile.h).
We define two separate implementations of the file system. The "STUB" version just re-defines the Nachos file system operations as operations on the native UNIX file system on the machine running the Nachos simulation. This is provided in case the multiprogramming and virtual memory assignments (which make use of the file system) are done before the file system assignment.
The other version is a "real" file system, built on top of a disk simulator. The disk is simulated using the native UNIX file system (in a file named "DISK").
In the "real" implementation, there are two key data structures used in the file system. There is a single "root" directory, listing all of the files in the file system; unlike UNIX, the baseline system does not provide a hierarchical directory structure. In addition, there is a bitmap for allocating disk sectors. Both the root directory and the bitmap are themselves stored as files in the Nachos file system – this causes an interesting bootstrap problem when the simulated disk is initialized.
Copyright (c) 1992-1993 The Regents of the University of California. All rights reserved. See copyright.h for copyright notice and limitation of liability and disclaimer of warranty provisions.