Have been considering giving another try at an operating system for the Mega Drive (albeit not with discrete windows =P). Not really anything worth showing yet, but been thinking about how I'd do the filesystems. There would be two partitions for now: a ROM partition (which contains the programs and such) and a SRAM partition (for all writable files, at least for now). Still writing the driver for the ROM partition, which probably won't even have clusters since it's random access and I don't have to worry about fragmentation when nothing can be moved around.
Focusing on the format for directories right now. Each file entry would be 16 bytes (yes, I know, FAT spends 32 bytes despite originally being made for smaller partitions, but whatever). It only has the bare minimum needed, so no creation date or stuff like that (not like I have a RTC at hand either). It would look as follows:
- 8 bytes: name
- 2 bytes: extension
- 3 bytes: length
- 3 bytes: offset
Code: Select all
A B C D E F G
H I J K L M N O
P Q R S T U V W
X Y Z 0 1 2 3 4
5 6 7 8 9
One obvious issue is that there's no way to tell apart a file from a subdirectory. Easy: subdirectories don't have an extension, and their extension will be an invalid value (i.e. larger than 63999). I may use invalid extension values in other ways too, seeing as I have 1536 of them.
Length and offset can address up to 16M only, but shouldn't be an issue seeing as the relevant partitions are 2MB anyway. What they address will be probably different for each of them, with the ROM I can just use raw addresses, while with the SRAM partition I may have to resort to some sort of clusters to allow fragmentation (not a big deal since seeking times are a non-issue, so it'd be actually desirable in this case).