Otherwise, it seems great! If this works out well, we won't have to do anything major to it until they start making drives larger than 16GiBs!
/Josh
Why the artificial limitation on 64 directory entries (== files) ?
There is no way to recover a file if its directory record is corrupted.
Actually the filesystem can get damaged if only in one record has a wrong
size.
I'd keep at least two copies of the bitmap and the directory record.
--
42Bastian
Given the spec has an MBR, I assume BMFS volumes are intended be bootable — do you plan to store PURE64.SYS and KERNEL.SYS as ordinary files, or will some of the 1016KiB of free space in Block 0 be used for system files, perhaps with a secondary (smaller) directory structure for that section?I'm wondering about the free space bitmap, and specifically whether it's worth storing that on disk given it can be trivially recreated from the directory at system startup. It seems to me that if it were stored, you'd have to be able to recreate it to cope with power failures etc, and it's probably faster to calculate than to load from disk. That sort of structure is also going to be suboptimal for SSDs, since it's likely to generate a lot of unaligned writes.In fact, with only 64 files the create syscall could work from the directory info, removing the need for a bitmap entirely.Just a few other thoughts:- Could some of the 8 free bytes in the Directory Record structure be used to store a version counter and a CRC32 of that record? The version counter would help in the case that there are redundant valid records on the disk, but the system died between updating them, and the CRC32 would ensure corrupted records were ignored.- It would be worth versioning and checksumming the first 4KiB of Block 0, for the same reasons.- It's good that both of these structures fit into 4KiB each since that's a common page size for SSDs, but it would probably be even better if the legacy MBR sector (which probably does not require frequent re-writing), the directory structure, and any further data structures likely to be updated independently be aligned on separate 256KiB erase blocks.This FS would be a much nicer base than FAT16 for some of the stuff I'm working on, so I'm currently writing some Python tools to generate and fill VMDK images for it, as well as hacking some sort support into Pure64.
Though it's possible that having all that spare stuff in the header
and ignoring it because you'll never use it is exactly what you
want to avoid. :-P I'm relatively new to Baremetal, so I defer to the
experts.