Page 1 of 1

Filesystems

Posted: Tue Jan 26, 2010 10:46 am
by assainator
Heey all,

first of all, i'm new to OS dev but what i've done I enjoyed with a lot of fun.
I have set a modest target for myself:
--> a real mode OS with the ability to do (file)IO and executing programs.

I have:
- a bootloader wich just load's a raw sector.
- a 'kernel' with some simple command's.

the only problem is: I can't get my head around FAT12. Now i have looked in the wiki, where the beginner reccomendations are: ext, SFS and FAT12. I'm on windows so ext falls away and i can't find much information on the internet about SFS.

My question is:
Are there any other easy filesystems or is there a easy tutorial about FAT12 so i might understand it after all?

thanks in advance,
assainator

Re: Filesystems

Posted: Tue Jan 26, 2010 10:54 am
by DavidBG
Wikipedia is helpful.
Wikipedia on interrupt 13, very helpful you will need this.

You might check out MikeOS, it incorporates a FAT12 filesystem. (This is NOT my OS, so I'm not spamming here, I just thought it would be helpful)

All the best, and feel free to contact me if you get stuck.

David

Re: Filesystems

Posted: Tue Jan 26, 2010 11:14 am
by Solar
assainator wrote:I'm on windows so ext falls away...
No it doesn't.

Re: Filesystems

Posted: Tue Jan 26, 2010 12:31 pm
by Combuster
Solar wrote:
assainator wrote:I'm on windows so ext falls away...
No it doesn't.
Actually, I even use that :wink:

The reason you'll find little about SFS is that Microsoft monopolized the market with FAT. That doesn't mean SFS isn't a viable choice - it is easier and it is not spoilt with patents.

Re: Filesystems

Posted: Tue Jan 26, 2010 12:32 pm
by StephanvanSchaik
Greetings,
assainator wrote:the only problem is: I can't get my head around FAT12. Now i have looked in the wiki, where the beginner reccomendations are: ext, SFS and FAT12. I'm on windows so ext falls away and i can't find much information on the internet about SFS.

My question is:
Are there any other easy filesystems or is there a easy tutorial about FAT12 so i might understand it after all?

thanks in advance,
assainator
There are various articles, tutorials and documents around the web.

As for SFS, you'll only need this and this, however, as the first link states, SFS is still a draft.

As for FAT, there's a lot information that might interest you:
http://www.brokenthorn.com/Resources/OSDevIndex.html
http://wiki.osdev.org/FAT (especially http://wiki.osdev.org/FAT#See_Also)
http://en.wikipedia.org/wiki/File_Allocation_Table
http://wiki.osdev.org/Bootf

As for Ext, I don't know much about it, but I'm sure http://wiki.osdev.org/Ext2 might help you and as for the Windows issue, you could just use a filesystem driver for Windows as Solar suggested.


Regards,
Stephan J.R. van Schaik.

Re: Filesystems

Posted: Tue Jan 26, 2010 12:37 pm
by Combuster
StephanVanSchaik wrote:however, as the first link states, SFS is still a draft.
And the RFC's are "only" requests for comments. You may want to look at the date :wink:

Re: Filesystems

Posted: Tue Jan 26, 2010 1:02 pm
by piranha
StephanVanSchaik wrote:As for Ext, I don't know much about it, but I'm sure http://wiki.osdev.org/Ext2 might help you and as for the Windows issue, you could just use a filesystem driver for Windows as Solar suggested.
That article is good, but it is missing a lot of information and a lot of info is kinda hidden. I'm in the process of writing a tutorial/better article on a read-only ext2 driver from a driver that I created. I just procured a neck injury, so its set back a little, but watch for it, I'll post it on these forums when I'm done with it.

-JL

Re: Filesystems

Posted: Tue Jan 26, 2010 1:54 pm
by assainator
Thanks a lot for all reply's!
I will read the articles and see if i can come up something.

Re: Filesystems

Posted: Thu Jan 28, 2010 1:57 pm
by assainator
Heey all,

I read the articles and I do understand FAT12 itself. But using or loading it is a diffrent matter. Therefor I created my own 'filesystem'. While reading the articles I did find the absolute mimimals:
-name
-size
-block or CHS offset
(correct me if i'm wrong)

This is what i've created. If you see any flaws, errors or other problems, please tell me.
Image

I have written code to load the file table, tough i'm having a problem: What is the best way to check if everything loaded as it should. I know that after int 13h, i can check the status of ah for a read error. But i want to check if everything loaded as I want it.

So the question is: How do I best check if everything worked? I'm not asking for snippets (tough they are welcome) but more for a push in the right direction.

thanks in advance,
assainator

Re: Filesystems

Posted: Thu Jan 28, 2010 2:04 pm
by AJ
Hi,
assainator wrote:I read the articles and I do understand FAT12 itself. But using or loading it is a diffrent matter. Therefor I created my own 'filesystem'.
I haven't looked at your design in great detail, but will post if I see any problems when I get a chance to look. My thought on this, though, is that designing a file system because you do not understand how to utilise existing ones is not the best reason. It's not a bad idea to get used to interpreting technical documents at this stage.

Cheers,
Adam

Re: Filesystems

Posted: Sun Jan 31, 2010 4:59 am
by assainator
At the moment i'm still running against the block: how to check if everything loaded correctly.

i'm reading the filetable (shown in the image from my last post) to 0x2000:0x0000 with int 13h.
The problem is tough: how to see if it is even there?

can anyone help me with this?

assainator

Re: Filesystems

Posted: Sun Jan 31, 2010 7:47 am
by Combuster
If the bios reported a successful read, the contents is now present in memory where you told it to be put.

What are you getting at? Do you want to check the integrity of the filesystem on disk, or do you want to check the transfer? The former requires an utility equivalent to chkdisk, the latter is documented in the BIOS calls.

Re: Filesystems

Posted: Sun Jan 31, 2010 1:02 pm
by Synon
I don't know how relevant this is in particular to the OP, but it might help.

I found this book on the internet about filesystems, written by Dominic Giampaolo, who worked on BeOS and the BFS.
http://www.letterp.com/~dbg/practical-f ... design.pdf