COMP3430 File Systems And Low-level Operations
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
COMP3430 File Systems And Low-level Operations
Preface
For this assignment, you must use a single makefile that is able to build your project. It must have a default all target that builds the shell executable, and a clean target that removes all the build products. You can start with the makefile from the previous assignment and/or modify, or use makefiles found online (please cite!) as you like.
Also, please note:
All work submitted for the assignment must be your own.
Include your name and user id in a comment at the top of each source code file.
The code you submit must be easily readable by the marker. Remember that well-written code (including good structure and naming) is better than lots of comments.
The code you submit must be easily buildable and runnable by the marker. Follow all instructions. The markers may use scripts to ease their work, and if they break because you did not follow instructions, you may receive substantial mark penalties.
Your makefile and the executable it builds should be in the top-level directory that you hand in. Entering make and then simulator (with parameters) should be enough to run it.
The code you submit must build and run correctly on the CS Linux systems with gcc. Watch out with filename case! The UNIX standard is all-lower-case source file names, and Makefile.
Question 1: Simulated FAT
Write an interactive shell that lets you browse a FAT12/16 formatted disk image. These images may be created from a DOS floppy or (small) hard drive. They contain only a single partition.
Your shell will implement (at least) the following commands:
info prints summary information about the FAT partition.
dir lists all the files (including metadata) in the current directory.
cd changes the current directory.
get downloads a file from the current directory in the FAT partition to your local disk.
Sending EOF (Ctrl-D) ends the program.
Download the Microsoft white paper on their FAT file systems posted on the site. You will be implementing FAT12/16, and there are many additional parts of the document that may not be relevant to your work on the assignment. Read the relevant sections thoroughly. Like man pages, this document is dense with content and important details.
You have also been provided with three C files:
fat.h contains some of the important constants and structures defined in the MS whitepaper.
fat_fs.h is an interface to functions that manipulate the FAT image. You can extend but not modify this file.
shell.c is code for managing the interactive shell.
You will probably want to use all three, but you must implement the functions in fat_fs.h without modification. You may extend it with additional functions but do not change the names, behaviours, or signatures of the existing functions. You may modify the other files as you like.
Your implementation must not read the entire contents of the image into memory. You must work with the image on disk, reading only individual sectors or clusters at a time. There are two possibilities. The mmap function lets you map a file into memory pages (more soon!) and access the bytes of the file relative to a pointer. Or you can more directly access the file using the lseek function and reading bytes from there.
Bonus marks!
You can get bonus marks (allowing your assignment to total more than 100%) if you successfully and completely implement some or all of the following additional features:
Implement long filename support in the directory listing. Show the long filename underneath the short name.
Implement (read-only) FAT32 support. This will include extra data in the info command, chained directories, and support for . and .. directories.
Implement directory creation with md.
Implement file deletion with del.
Implement file writing with put.
Each feature is worth up to an additional 5% of your assignment mark, if implemented completely and correctly. In order to receive bonus marks, you must include a README.TXT file at the top level of your handin detailing the extra features you included.
2026-01-22