Reference no: EM132400364
Project - File System Implementation (Directory Structures)
Introduction
Hard disks organize data into fixed-sized blocks. When one wants to fetch a particular byte, the entire block in which that byte lives must be fetched. Likewise, when a single byte must be changed, the entire block is first read into memory, the byte is changed and then the entire block is written back to the disk. As application-level programmers, however, we prefer to think in terms of the file system abstraction: a file is a sequence of bytes of some arbitrary length. It is convenient to program with this abstraction in mind: we would like to be able to read a subsequence of the bytes from a file or write a new subsequence of bytes (either overwriting existing bytes in the file, or appending onto the file itself). During these processes, we prefer not to think in terms of which blocks on the hard disk that our bytes are coming from or going to. In addition, the file system abstraction also provides us with a convenient and logical way of finding files. Specifically, we use directories and subdirectories, along with specific names within a directory that map to specific files.
For projects 3 and 4, you will implement a miniature file system, OUFS, that makes the connection between disk blocks and the file system abstraction. We will use a real file on our Linux systems as a virtual hard disk drive. This virtual disk will be accessed one block at a time. Access to the bytes on your virtual disk will be provided by the code that you implemented for projects 1 and 2.
We provide the virtual disk implementation, as well as the file system data structure and a few other components. Your job in project 3 is to implement a hierarchical directory structure. In project 4, you will add files (with content!) to the file system. Specifically, as part of project 3, you will:
- Format the virtual disk with an initial file system. This initial file system will contain a root directory with . and .. already initialized.
- Provide an API of system calls (we won't actually be doing traps, but instead we will be calling functions in a library). These system calls include functionality such as creating/deleting directories and listing the contents of a directory.
- Provide a set of helper functions that make your API easier to implement.
Objectives
By the end of this project, you should be able to:
- Describe the logical data structures that are used by an OS to represent directories and files.
- Show how these logical data structures change under standard file system operations.
- Map these logical data structures onto a block-level data storage device.
- Manipulate the block-level data storage device under standard file system operations.
Attachment:- File System Implementation.rar