Page 1 of 1
making a file system
Posted: Tue Aug 01, 2006 9:19 pm
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
Re:making a file system
Posted: Wed Aug 02, 2006 1:08 am
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.
Re:making a file system
Posted: Wed Aug 02, 2006 1:54 am
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?
Re:making a file system
Posted: Wed Aug 02, 2006 2:00 am
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.
Re:making a file system
Posted: Wed Aug 02, 2006 2:22 am
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.
Re:making a file system
Posted: Wed Aug 02, 2006 3:07 am
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.
Re:making a file system
Posted: Wed Aug 02, 2006 4:33 am
by bubach
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
Posted: Wed Aug 02, 2006 4:55 am
by Solar
Ah. I just went by what I found on the page itself.
Re:making a file system
Posted: Wed Aug 02, 2006 10:02 am
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.
Re:making a file system
Posted: Wed Aug 02, 2006 2:49 pm
by Kemp
comes with a tutorial by Kemp
First I've heard of this
[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.