The FAT12 (File Allocation Table) is one of the oldest file systems which are still supported by modern computers. Designed in the 1970s, code to deal with this file system still exists in practically any device that handles files: your laptop, your camera, your phone, etc. The file system is called FAT12 because the clusters are encoded on 12 bits. The file system can be used on partition up to 8MB in size.
The file system is the piece of system code responsible for managing directories and files on a disk. Typically, the file system divides the disk into sectors and keeps track of which sectors are free, used or bad. The file system also keeps track of how to combine blocks when reading a file.
Usually, file system code is written in C. I figured it would be fun to write a "driver" in javascript. The current code loads a file system, reads the various data structures and then pretty prints the data.
For the meta lol, the file system contains this webpage & all the javascript itself :)
This project might be a useful as a teaching aid (you could ask students to extend this code and implement a defragmentation algorithm or add support for FAT16 or FAT32), reused to build collaborative forensics tool, etc. File systems have also started to get some attention from the security community. A maliciously crafted file system can lead to host compromise in some cases: Exploiting vulnerabilities with removable storage.
The code is open source and available on github . Feel free to fork and send pull me pull requests!