DOSFS Free FAT12/FAT16/FAT32 Filesystem

Current version: 1.03 (9/30/06 bugfix release; refer readme.txt in distribution archive).

Version Update: There are a couple of bugs in 1.03 that will be fixed in 1.04; one relates to a corner case in FAT12 cluster allocation, and the other relates to files in the root directory. I also have some performance improvements and new features queued up for 1.05. Please note that the readme for 1.03 still says 1.02, which is in fact a meta-bug! Currently I am expecting to release 1.04 in the last week of August, though it is possible it will see the open air earlier.

DOSFS is a FAT-compatible filesystem intended for fairly low-end embedded applications. It is not the leanest possible implementation (the leanest FAT implementations operate in << 512 bytes of RAM, with heavy restrictions). This code strikes a good balance between size and functionality, with an emphasis on RAM footprint.

Intended target systems would be in the ballpark of 1K RAM, 4K ROM or more. The exact size of the binary will depend on your compiler and the runtime library you are using.


  • Supports FAT12, FAT16 and FAT32 volumes
  • Supports storage devices up to 2048Gbytes in size (LBA32)
  • Supports devices with or without MBRs (hard disks vs. floppy disks or ZIP drives formatted as "big floppies")
  • Supports multiple partitions on disks with MBRs
  • Supports subdirectories
  • Can be operated with a single global 512-byte sector buffer
  • Fully reentrant code (assuming the underlying physical device driver is reentrant and global sector buffers are not used). There are no global variables in the filesystem
  • Does not perform any memory allocation
  • Partial support for random-access files


  • Firmware upgrades
  • Failsafe IPL
  • Media playback
  • Data logging
  • Configuration storage

There is no technical support for this free product; however, if you have questions or suggestions, you are encouraged to contact Lewin Edwards. If you need custom additions to the code, or if you have other projects for which you need assistance, I will be happy to work with you!

 Download the DOSFS distribution archive (.tgz format)