Filesystems

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
assainator
Member
Member
Posts: 30
Joined: Sun Jan 24, 2010 1:12 am
Location: The Netherlands

Filesystems

Post 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
Every human has to do something idiot to prevent becoming a complete one
DavidBG
Member
Member
Posts: 62
Joined: Thu Jan 14, 2010 1:02 pm
Location: At the computer
Contact:

Re: Filesystems

Post 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
President of the Useless OS project
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Filesystems

Post by Solar »

assainator wrote:I'm on windows so ext falls away...
No it doesn't.
Every good solution is obvious once you've found it.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Filesystems

Post 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.
Last edited by Combuster on Tue Jan 26, 2010 12:34 pm, edited 1 time in total.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
StephanvanSchaik
Member
Member
Posts: 127
Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands

Re: Filesystems

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Filesystems

Post 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:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: Filesystems

Post 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
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
assainator
Member
Member
Posts: 30
Joined: Sun Jan 24, 2010 1:12 am
Location: The Netherlands

Re: Filesystems

Post by assainator »

Thanks a lot for all reply's!
I will read the articles and see if i can come up something.
Every human has to do something idiot to prevent becoming a complete one
assainator
Member
Member
Posts: 30
Joined: Sun Jan 24, 2010 1:12 am
Location: The Netherlands

Re: Filesystems

Post 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
Every human has to do something idiot to prevent becoming a complete one
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Filesystems

Post 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
assainator
Member
Member
Posts: 30
Joined: Sun Jan 24, 2010 1:12 am
Location: The Netherlands

Re: Filesystems

Post 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
Every human has to do something idiot to prevent becoming a complete one
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Filesystems

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

Re: Filesystems

Post 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
Post Reply