Hi,
dushara wrote:Anytime the superblock is modified, block with the older count is used (with count updated).
Therefore if there was a power failure etc in the middle of writing the super block, we still have an older version.
Ah - sorry I misunderstood
Still, all file data can be recovered without using the super-block at all, so a second super-block doesn't seem too necessary.
bcat wrote:Brendan, this looks like a nice, easy-to-implement file system. Just a quick question, though. Why does the draft spec say that the superblock has 64 bytes of space reserved for a partition table? I though the only boot sector with a partition table is the MBR, and the MBR has no file system, it just loads the active partition.
Reserving space for a partition table doesn't cost anything (nothing lost) and allows for non-standard arrangements.
For example, on a hard disk partitions usually start and end on cylinder boundaries. This leaves the entire first cylinder wasted due to the MBR. Boot managers typically take advantage of this space for their own use - it would be possible for a boot manager to have an SFS file system hidden in that first cylinder where it won't be messed with by the OS.
It's also possible to have a hard disk without partitions (where then entire hard disk is like a huge floppy). In this case it'd be good to have a dummy partition table to tell other OSs that the entire disk is in use.
I agree that there isn't a
good reason for it, it's just that there's no reason not to.
bcat wrote:Also, why not require the index area to be a multiple of the block size? I think it would make coding a driver easier, since the index is always an integer number of sectors on the disk.
The idea here is that when a new index area entry is being created a very simple driver could add 64 to the index area size and then do "end_of_disk - new_index_area_size" to find where to store the next index area entry. In this case the very simple driver wouldn't need to check any existing index area entries to see if they are currently unused.
A better/more complex driver would check if there's any unused index area entry before creating a new one.
If the index area size was a multiple of the block size it'd make a very simple driver a little more complex and a complex driver a little simpler, but this isn't what I want to do (I'd rather make a very simple driver a little simpler, even if it does make a complex driver a little more complex).
Cheers,
Brendan