Skip to content

z0phka/FAT8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FAT8 Manager

The Worst FAT-based File System

About

A simple file manager for a custom-made FAT8 file system. It is a GUI application, allowing you to create "virtual drive" files (.fat8), format them and "mount" them (in the application, not your OS). Once mounted, you can explore the files in the file system, create and delete new files and directories, edit the files (as ASCII text) and inspect additional information about the files, directories and the file system itself.

FAT8

The FAT8 file system is a FAT-based file system with 8 bits per entry in the table. The file system allows you to allocate up to 254 clusters (2^8 = 256, but two of the values - 0x0 and 0xff have special meaning, hence why 254). So theoretically the maximal number of files one can create 254. Practically speaking it is a bit less, as the root directory is limited to 32 entries. The file system supports subdirectories. Subdirectories are just regular files with the subdirectory attribute, whose content has special meaning. Because of that, unlike in some other FAT implementations, directories have non-zero file size (equal to 32*(number of entries in the directory) bytes).

File names are limited to 8 ASCII characters, file extensions to 3 characters. Both the block size of the drive, and the sector size of the file system are 512 B. Lastly, even empty files (files with file size of 0 B) claim a cluster.

Requirements

  • Java 21
  • JUnit 5.8.1 (for the included tests)

Usage

Upon starting the app .jar file (which you can either compile yourself or find in the /build directory) a window opens. On the left side, just under the menu bar, you can see two buttons:

  • New - which allows you to create a new drive file, with a block count of your choosing (the minimal is 260 blocks, as going lower would result in less than 1 sector per cluster)
  • Mount - which allows you to format (if you check the checkbox on the side) and mount the drive. Keep in mind that the application does not check in any way, whether the drive actually contains a (valid) FAT8 file system, so if you mount an unformatted/corrupted or otherwise invalid drive file, unpredictable things might happen. The application can keep track of multiple drives at the same time.

Once the drive is mounted (this might take a second or two), you should see the drive in the file hierarchy on the left, just under the two buttons. It will appear as a "disk" icon, with the name of the drive file next to it. Double-clicking any node in the file hierarchy tree will reveal its children (subdirectories and files), though a freshly formatted drive will not contain any.

This can be fixed by creating a new file/directory. This can be done by right-clicking the drive node (or any other directory node) and selecting "Create File" or "Create Directory" in the popup menu. The application will prompt you for a file/directory name. In case of (non-directory) files you can specify the extension as well, using the "dot" notation (name.extension).

You can remove files and directories using the "Delete File/Directory" option.

You can edit files using the "Edit File" option. Once you select it, the file content is loaded into the editor on the right side of the window. Once happy with the content in the editor, you can save the file. To do that, you have to click the "File/Save Current File" option in the menu bar. Otherwise, the changes will not be written to the file. The editor will be cleared and made uneditable, if the save was successful.

Finally, you can find out more about the files, directories and drives using the "Properties" option in the popup menu.

Once you are finished with using the file system, you (REALLY) should use either the "Eject" popup option on the drive you want to stop using, or the "File/Exit" menu option if you want to exit the application. This will make sure all the changes get written to the file on your computer. Exiting the application without doing this might result in the loss of the changes or corruption of the drive file.

Troubleshooting

The application was made and "tested" on Windows 10 (10.0.19045 Build 19045) machine, with OpenJDK 21. Now, since it is a Java application, it should run on any of the 56 billion devices that run Java (assuming they use Java 21), but I make no guarantees that is in fact the case.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages