Universal File System

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!

Moderators: JAAman, klange, Octocontrabass, sortie, kmcguire, chase, thepowersgang, Owen, Combuster, AJ, 01000101, carbonBased, Candy, pcmattman

User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Universal File System

Post by Pype.Clicker »

Brendan wrote:A more optimized implementation could try to use free space between files. For example, if the data area looks like:

[tt]
[00]: -----
[05]: 11111
[10]: 111--
[15]: --222
[20]: -----
[25]: -----[/tt]


oh, and btw, it all depends on how those "-" are encoded. say the former fig is actually represented by:

Code: Select all

index[0]={L1_FILE, sblk=5, eblk=16, size=7*BLKSZ+STUFF}
index[1]={L1_FILE, sblk=17,eblk=29, size=2*BLKSZ+STUFF}

then it becomes clear that room beyond file 2 (that is, blocks 20..29) is actually free for something else, since from the size of index[1] (which owns those blocks), they're unused.

To keep things clean, when such a "llama-with-screws" driver will detect room that needs to become "free", it just locates the previous file entry (not necessarily [i-1], thus), and extends the "eblk" value so that it now covers the "free" space (let's say that's how file 1 has "---" after it).

The "camel-with-stick" driver that wants to "shrink" a file just updates the "byte size" of the file, and both camels and llamas are kept happy.
Similarily, the "camel-with-stick" that wants to make the file deleted just tags it as "deleted". both llama or L2 driver will be happy and recover the space of the deleted file if they feel like.
Slasher

Re:Universal File System

Post by Slasher »

Just wanted to let everyone know that there is a File system already called SFS. Think we should use UFS(Universal File System) like in the very first post of this topic.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven
Contact:

Re:Universal File System

Post by Candy »

Code Slasher wrote:Just wanted to let everyone know that there is a File system already called SFS. Think we should use UFS(Universal File System) like in the very first post of this topic.


You might just offend those that invented Unix, they kind of claimed UFS for "Unix File System".
Slasher

Re:Universal File System

Post by Slasher »

Forgot about that ;D Well we still need a different name. ;)
Rob

Re:Universal File System

Post by Rob »

VSFS (Very Simple File System)? 8)
dushara

Re:Universal File System

Post by dushara »

Brendan wrote:Hi,

dushara wrote:Would it be a good idea to keep 2 copies of the data area and index area size fields in your super block? (preferably over 2 sectors) and keep an incrementing counter.


Not really - if the counter itself can't be read then you won't know which set of values to use. We'd need 2 versions of this counter with an "extra something" to determine which version of the counter to use. Then we'd need to worry about what happens if there's a problem reading the "extra something".


This is a bit late and I hope it's still of some use.

The incremental counter I was talking about is part of the super block.

Something like this:

Code: Select all

struct {
  unsigned int count;
  /* superblock data */
  unsigned short crc16;
}block[2];


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.
bcat

Re:Universal File System

Post by bcat »

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.
bcat

Re:Universal File System

Post by bcat »

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.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Universal File System

Post by Brendan »

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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
KieranFoot

Re:Universal File System

Post by KieranFoot »

Micro$oft are eejits, who would do such a thing???

Patent the FAT file system >:(
Slasher

Re:Universal File System

Post by Slasher »

What is the state of the file system?

can we try to implement it now or wait for a finished spec?
axilmar
Member
Member
Posts: 28
Joined: Sat Jun 02, 2007 10:35 am

Re: Universal File System

Post by axilmar »

Brendan wrote:Hi,

Now that Microsoft have patented the FAT file system, there is no simple file system that can be used for transferring data easily between computers, and OS developers who are using FAT [s]are screwed[/s] may be sued if Microsoft get bored.


Isn't the ISO 9660 FS (the one used in CDs/DVDs) suitable for such a task? I apologize if it has already been suggested, but I did not have the time to read all the messages.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US
Contact:

The actual patent

Post by bewing »

I'm a part-time inventor, so I'm familiar with the whole patent dealio -- and I wanted to see precisely what was meant by "Now that Microsoft has patented the FAT file system".

I know full well that FAT12 and FAT16 are well past any possible patent expirations. It turns out that the patent in question, #5,579,517 -- is actually about the specific way that long filenames are implemented in the DOS6/Windows directory structure. It's not technically about the file allocation structure at all.

So, just so long as you have some completely different way of storing your LFN's, you are safe from this patent. And the patent expires in a little under 6 and a half years.

Of course, if you are trying to implement full LFN compatibility -- so that you can read or write LFNs on a Windows formatted disk -- then the patent certainly is aimed at preventing you from doing such a thing.
Post Reply