making a file system
making a file system
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
thanks in advance ;D
Re:making a file system
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.
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.
Re:making a file system
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?
Does filesystem handle partitions or is it done by some other computer system to keep care about partitions?
Re:making a file system
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.
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.
Re:making a file system
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.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.
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.
Re:making a 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.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.
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.
Re:making a file system
Not that it matters at all, but to clarify: Kemp didn't write that tutorial, and I found if for him.
Re:making a file system
Ah. I just went by what I found on the page itself.
Every good solution is obvious once you've found it.
Re:making a file system
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.
Off the top of my head, I would recommend ext3 for its features and reliability.
Re:making a file system
First I've heard of thiscomes with a tutorial by Kemp
[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.