Page 1 of 1

File Systems

Posted: Sat Oct 05, 2002 7:03 pm
by Berserk
What tools do i need to make a file system, and are there any good tutorials on how to make one??

ciao.

Re:File Systems

Posted: Mon Oct 07, 2002 12:04 am
by Berserk
Come on...somebody help.....

Re:File Systems

Posted: Mon Oct 07, 2002 12:33 am
by Pype.Clicker
Your mission, provided that you accept it, will be to
1. access the hardware : no INT13 will help you as it don't work in PMODe and - soon or later - you *will* go to pmode. Learn about IDE or floppy (this one is ugly) programming ...

2. allocates some space for your files: you can have a small bitmap table at the start of your disk (one bit per disk sector giving the free/used state), a linked list of free blocks (each free sector/group of sectors) will have a pointer to the next free sector (the worst ever allocation system, imho), or scatter the bitmap on the disk (one sector on each cylinder : better locallity, with a memory cache of the amount of sector left in each cylinder).

3. link sectors together to create files. here again you can either have a chain-like approach (reserving a few bytes in every sector to store the address of the next sector -- completely auwful results in case of non-sequential reads) or have an index of the sectors used for each file (i.e. a single sector that will contain sector numbers for the other data sectors of the file)

4. Give names to the files. This is basically done by giving some files a specific format that will provide a mapping between symbolic names and localisation information (the "master sector" of your file).

This message will auto-destruct in 5 seconds

4 ...
3 ...
2 ...
1 ...
*********************boom****************

Re:File Systems

Posted: Mon Oct 07, 2002 1:35 am
by Berserk
What the??

& how do i do all this, do i do it in asssembler/C++?? what do i do it in??

come on man...Do you know any places with tutorials??

Re:File Systems

Posted: Mon Oct 07, 2002 2:21 am
by Pype.Clicker
hmm . no tutorials, sorry (i have learned from the Pc Bible & from a course @ school), but looking at Operating System Resource Center, you should find enough infos about how it works ;)

You can also try a request about "E2FS infos" or something alike. You can skip the hardware step if you wish and design a small "hardware emulation layer" that will fake disk I/O on a large memory array, so that you don't trash your HDD before you're ready.

No ASM is required: you can learn filesystem programming in C/C++/objective-C/java/pascal. whatever you like. however i suggest C/C++ because its more likely to be useful in a finalized OS and because it has easier bits&bytes access...

Re:File Systems

Posted: Mon Oct 07, 2002 3:23 am
by Berserk
thanks

Re:File Systems

Posted: Wed Oct 09, 2002 6:05 am
by Berserk
i still don't get it. is there someone here who'se actually made a File System??

Re:File Systems

Posted: Wed Oct 09, 2002 7:52 am
by Whatever5k
Adding support for a file system is a hard job - you won't be able to implement this in some hours...you'll need some time, so don't except to get a "step-for-step" tutorial...
However, I suggest you buy a book like "Operating Systems: Design and Implementation" - AST explains this very well...
If you don't want to pay so much money (which is understandable, because the book is damn expensive) you may google along to find more informations. There are certainly some documents out there - but, *you* will have to search... ;)

Re:File Systems

Posted: Thu Oct 10, 2002 1:58 am
by Pype.Clicker
i made one at school, but it was for virtual hardware ... so if you come with a IDE driver, i'll come with a file system ;)

btw, i'll start a tutorial on it a.s.a.p :)

Re:File Systems

Posted: Thu Oct 10, 2002 3:19 am
by grey wolf
Berserk, if you want to design your OWN FS, you can buy "Practical FIle System Design with the Be File System" by Dominic Giampaolo (barnes & noble and Amazon both have it for <$30US). it describes in DETAIL (and i do mean DETAIL) what goes into designing a filesystem, how (generally) to implement it, and how to go about making it perform well. if you do everything the book suggests, you'll have reimplemented the filesystem BeOS uses (which the OpenBeOS project recently finished).

and not to fear: it's not overly technical and is fairly easy reading.

if you don't want to reimplement BeOS, you can use it as a guideline and make your own i-node-based filesystem.

but if you want to use another existing filesystem and don't want to bother with BeFS, there are a lot of other example file systems you can use. (including FAT, ext, ext2, ext3, Reiser, FFS, etc.)