Implementing a File System reader:
In this question, you will Write a program that reads a FAT32-formatted volume. For this assignment you are provided with a disk image, but you are both:
Encouraged to make your own disk image, and
Encouraged to read a USB flash drive as a raw device (e.g.,/dev/sda
provided that you have physical access to a Linux or macOS machine, e.g., not WSL). Before you start Video description Before you start working on the assignment, we recommend that you watch the video that’s included alongside this document (noting that all the information in this video and much, much more is also in theFAT32 Documentation below).FAT32 Documentation Note that you are very much not expected to read all of these; these are meant to be known good re-sources that will hopefully help you find information without having to spend a bunch of time searching for information.
The canonical source of information for FAT32 is a white paper published by Microsoft. This document describes the data structures for FAT32 in extensive detail, including the number of bytes that each part of each structure takes (which is extremely important for your implementation). When you’re looking to find specific values for specific parts of the file system, this is the place to find it.
Microsoft’s Tech Net article“The FAT File System”is a better description of how FAT works overall,with some nice pictures. The MS white paper is seriously lacking in pictures, and these pictures give some nice additional context. This document, though, does not do a good job describing how you can get files and directories out of this file system.
Paul’s 8051 Code Library has an extensive description of FAT32, along with some nice pictures.The MS white paper is seriously lacking in pictures, and Paul’s description has some nice colourful pictures. The Tech Net article lacks a good description of how to read directories and files,and Paul’s article does are asonably good job of that.
The Phobos article “A tutorial on the FAT file system”has are ally nice walk through for how you can interpret the contents of blocks, and get files and directories out of these blocks.