Reference no: EM131721551
Operating Systems : Assignment - Filesystem
1. Introduction:
The task for this project is to use the block storage library created in Assignment 3 as a logical storage device, on top of which you are now going to build the F17 Filesystem (F17FS). F17FS will closely model the original Unix Filesystem and the Unix Fast Filesystem.
2. Filesystem Design:
Files and filesystems are designed to operate using an abstraction of the underlying storage hardware. You will implement a filesystem that interfaces to a Block Store similar to Assignment 3. Recall the Block Store library specifications; specifically, the purpose of the library is to simulate a block storage device that provides access to storage blocks based on a block index.
The following are the sizing constraints of the Block Store (note these sizes differ from the block store assignment):
1. The total number of blocks is 2^16.
2. The size of blocks is fixed at 512 bytes.
3. Some of these blocks are pre-allocated to the free block map (as before).
The following are sizing constraints with regard to the file system itself. In particular, these constraints should allow you to pass the write_full_fill() test.
1. Any overhead (meta-data) for your file system should be stored within 34 blocks.
2. If your overhead takes less than 34 blocks, say 32, then we waste the additional 2 blocks.
3. Milestones:
This project will be divided into four submissions:
0. Design (M0),
1. Milestone 1,
2. Milestone 2, and
3. Milestone 3
Design:
A failure to plan is a plan to fail. This will be a large project; understanding the basic concepts, planning your structures, functions, and what issues can occur is vital to any programming project.
You are to draft pictorial representations of (drawings on paper and scanned/photographed are sufficient):
1. Inodes and their block references
2. The filesystem layout, and how its layout relative to Back Store.
You are to put together your proposed layout (read: structure definitions) for:
1. F17FS objects
2. Inodes
3. Directory files
You are to write pseudocode for the following problems given the specified information and list potential errors that can occur:
1. File/Directory Creation given an absolute path to the file/directory and a flag indicating file or directory
2. File Writing given a file descriptor, a buffer, and a byte count
3. File/Directory Deletion given an absolute path to the file/directory
Milestone 1 - Basic Building Blocks:
You are to implement formatting, mounting, and unmounting (fs_format, fs_mount, and fs_unmount) of your F17FS filesystem. You will also prepare pseudocode for the following milestone.
Once you have completed your implementation, be sure to commit all changes and push to master branch on OSGit by the M1 due date.
Milestone 2 - Directory Traversal, Inodes, and File Descriptors:
You are to implement the creation of files and directories, the opening and closing of files, and the enumeration of directories (fs_create, fs_open, fs_close, and fs_get_dir). You will also prepare pseudocode for the following milestone.
Once you have completed your implementation, be sure to commit all changes and push to master branch on OSGit by the M2 due date.
Milestone 3 - Data management:
You are to implement the reading and writing of data to a file, the seeking of file descriptors, and the deletion of files as well as empty directories (fs_read, fs_write, fs_seek, and fs_remove).
Graduate students will also need to submit implementation for the moving files and directories as well as the creation of hardlinks (fs_move and fs_link). This will also be bonus for undergrads. It is suggested that you start early on these features, as you will need to consider these operations while implementing Milestone 2.
Once you have completed your implementation, be sure to commit all changes and push to master branch on OSGit by the M3 due date.
4. Filesystem Specification, Implementation, and API:
Your implementation of the F17 Filesystem must be a CMake system library project. A header with the expected functions and operation details will be located in your repository. Please refer to it for implementation details and bring any additional questions to the Canvas LMS.
Specifications:
Your F17FS implementation must be capable of:
- Format an F17FS file
- Mount and unmount an F17FS file
- Create directories and regular files
- Open, close, and seek files
- Read and write to files
- Remove files
- List directory contents
- *Move files and directories
- *Create hardlinks
File Descriptors:
The F17FS filesystem will be using file descriptors to manage open files. The filesystem will be limited to 256 file descriptors. Each file descriptor will track a single read/write position for that descriptor. How you manage this is up to you. Files should be able to be opened multiple times, meaning your implementation should support multiple descriptors to the same file, but with different read/write positions. Seeking allows the user to move the read/write position to where they want. Be sure to read the header for additional notes or requirements on how a function affects a file descriptor.
Testing:
Your implementation should be capable of doing all operations listed above cleanly and safely. Like all projects, a tester will be provided to test the frontend of your implementation. You will be expected to deliver a functional and correct solution for each milestone. Be sure to be comfortable with various debugging and file inspection tools, and they will prove vital to writing a correct implementation.