https://github.com/yuryatin/fat32-emulator-xkubpise
This is a simple FAT32 emulator for the terminal, designed for quasi-POSIX compliant environments (macOS, Linux, etc.), that supports short (8.3) filenames. It can create and format a 20 MB FAT32 filesystem, navigate it, create folders and empty files, and list folder contents.
https://github.com/yuryatin/fat32-emulator-xkubpise
c-language emulator fat32 posix-compliant
Last synced: 2 months ago
JSON representation
This is a simple FAT32 emulator for the terminal, designed for quasi-POSIX compliant environments (macOS, Linux, etc.), that supports short (8.3) filenames. It can create and format a 20 MB FAT32 filesystem, navigate it, create folders and empty files, and list folder contents.
- Host: GitHub
- URL: https://github.com/yuryatin/fat32-emulator-xkubpise
- Owner: yuryatin
- License: mit
- Created: 2025-07-27T08:33:41.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-30T08:51:21.000Z (3 months ago)
- Last Synced: 2025-08-09T13:14:08.901Z (3 months ago)
- Topics: c-language, emulator, fat32, posix-compliant
- Language: C
- Homepage:
- Size: 205 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple FAT32 emulator _xkubpise_
This is a simple FAT32 emulator for the terminal, designed for quasi-POSIX-compliant environments (macOS, Linux, etc.). It supports short (8.3) filenames but does not allow internal spaces (e.g., `MY FILE.TXT` is not permitted). The emulator interacts with 20 MB FAT32 file-backed volumes with strict parameters:
- no mirroring is supported
- only the first FAT table can be active
- only one sector is allowed per data cluster
- long filenames are not supported
- the number of reserved sectors and FAT table sectors is fixed

# What you can do in the emulator
- navigate folders with `cd` in two modes:
- default mode: only absolute paths are accepted
- extended mode: relative paths are also accepted, including `.` and `..`
- create new folders with `mkdir`
- create new empty files with `touch`
- list folder contents with `ls` or `dir`
- print the current path with `pwd` (although it's always visible in the command prompt)
- format a volume (for security reasons, the emulator does not initialize or format files whose size differs from exactly 20 MB)
# How to use
This terminal utility is launched from the command line and requires one of the following as the first argument:
- the name of an existing 20 MB file that is a FAT32 volume
- the name of a 20 MB file the user wants to convert into a FAT32 volume
- the name of a new file to be created as a FAT32 volume
As a second argument (the order doesn't matter), you can pass `-p` to activate navigation mode with relative paths (including `.` and `..`).
# How does it treat input files
The FAT32 emulator _xkubpise_ attempts to determine whether it is working with a valid FAT32 volume and, if so, whether the candidate volume meets its stricter requirements (or, we might say, its limited capabilities).
If the volume size deviates from exactly 20 MB, the emulator stops any interaction with the file (for data integrity reasons).
If the file fails the conformity test but has the correct size, the user is cautiously advised to abstain from manipulating it. However, if the user chooses to proceed, the volume is initialized (which may result in some data loss), and the user can then explicitly format it using the `format` command.
Below is a screenshot showing the inconsistencies that the FAT32 emulator _xkubpise_ detects in a volume candidate.