making a file system

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
madtast

making a file system

Post by madtast »

hi, i finished making a kernal for my os but now i need to make a filesystem, how can i make one, what goes into making one actually anything about one would be greatly appreciated,
thanks in advance ;D
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:making a file system

Post by Solar »

You might want to check on the FAQ, which has a chapter on Filesystems, and desribes two filesystems (FAT12 and AmigaFFS) in detail, so you can get an idea of previous art.

All in all, unless you have very special requirements on your FS, I would try to implement an existing filesystem (ext2fs, for example) instead of designing your own.
Every good solution is obvious once you've found it.
Cheery

Re:making a file system

Post by Cheery »

I'm confused with that filesystem thing a little.

Does filesystem handle partitions or is it done by some other computer system to keep care about partitions?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:making a file system

Post by Solar »

A file system - traditionally (*) - applies to a single partition only.

The system reads the partition table(s), and usually assigns device names to them (/dev/hda1 on Linux, DH0: on AmigaOS). At that point, the information available on partitions is little more but which drive they are on, where they start, and where they end.

A file system is what makes the zeroes and ones within a partition make sense.

(*): Today, there are mechanisms that make a file system span multiple partitions, or even hard drives, to get around size limitations. LVM, for example.
Every good solution is obvious once you've found it.
kernel64

Re:making a file system

Post by kernel64 »

Solar wrote: You might want to check on the FAQ, which has a chapter on Filesystems, and desribes two filesystems (FAT12 and AmigaFFS) in detail, so you can get an idea of previous art.
Looking at previous art is a good idea, but IMHO the FAT file system is a bad example. It is not clear enough because of the constraints that were put on the FS designers at the time. I think a better example would be the UNIX 6 or 7 file system.

I would recommend newcommers read the Lions book or the Minix book, and visit TUHS http://www.tuhs.org to take a peek at the early UNIX sources for some inspiration. It's much clearer than FAT, and less complex than file systems that are optimised to be fast or whatever.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:making a file system

Post by Solar »

kernel64 wrote: Looking at previous art is a good idea, but IMHO the FAT file system is a bad example. It is not clear enough because of the constraints that were put on the FS designers at the time. I think a better example would be the UNIX 6 or 7 file system.
FAT12 is quite simple though, comes with a tutorial by Kemp (linked from the FAQ page), and allows for easy interfacing with both Windows and Linux machines.

If you dislike the FAT12 option, the FAQ page does link to documentation on HPFS, ext2fs, and BeFS. If you have doc links on the Unix 6 FS, feel free to add them to the FAQ. ;-)
Every good solution is obvious once you've found it.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:making a file system

Post by bubach »

Not that it matters at all, but to clarify: Kemp didn't write that tutorial, and I found if for him. ;)
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:making a file system

Post by Solar »

Ah. I just went by what I found on the page itself. ;)
Every good solution is obvious once you've found it.
evincarofautumn

Re:making a file system

Post by evincarofautumn »

Well, you have to consider exactly what your OS needs to know about the files. If you want a lot of metadata that's going to be very specific to the way your OS operates, I would say that you should design your own FS based on those needs. I'm working on SensoryFS because I have lots of Sensory-specific metadata that go with each file. But as Solar said, unless these requirements are very specific (e.g. you need special permissions or emblems to be saved) then I would choose an existing FS.

Off the top of my head, I would recommend ext3 for its features and reliability.
Kemp

Re:making a file system

Post by Kemp »

comes with a tutorial by Kemp
First I've heard of this :o

[me=Kemp]goes to check[/me]

I can't see any mention of me on there, so I guess I'm still in my usual reality ;D Coincedentally, I have been tempted to go through and rewrite parts though.
Post Reply