C语言代写|CSc 360 Assignment 3: A Simple File System (SFS)


In this assignment, you will implement utilities that perform operations on a simple file system, FAT12, used by

You will be given a file system image: disk.IMA for self-testing, but your submission may be tested against other
disk images following the same specification.

You should get comfortable examining the raw, binary data in the file system images using the program xxd.

In part I, you will write a program that displays information about the file system. In order to complete part I,
you will need to understand the file system structure of MS-DOS, including FAT Partition Boot Sector, FAT File
Allocation Table, FAT Root Folder, FAT Folder Structure, and so on.

For example, your program for part I will be invoked as follows:

./diskinfo disk.IMA

Your output should include the following information:

Label of the disk:
Total size of the disk:
Free size of the disk:
The number of files in the disk (including all files in the root directory and files in all subdirectories)

Number of FAT copies:

Sectors per FAT:

Note 1: when you list the total number of files in the disk, a subdirectory name is not considered
as a normal file name and thus should not be counted.

Note 2: For a directory entry, if the field of “First Logical Cluster” is 0 or 1, then this directory
entry should not be counted.

Note 3: Total size of the disk = total sector count * bytes per sector

Note 4: Free size of the disk = total number of sectors that are unused (i.e., 0x000 in an FAT
entry means unused) * bytes per sector. Remember that the first two entries in FAT are reserved.