Page 1 of 1

Fat32 filesystem

Posted: Mon Dec 13, 2010 1:04 pm
by ruisu15
Hi, i need some help with a project. i need to read, open directories and list files in the directories for an OS. the File System is fat32.

after search in the wiki it give me a path for an Public Domain FAT32 code in the forum, but i cant find the code.
i have created a binary file of my OS and boot it with a grub, but i dont know how to add extern functions to it.
Please someone help me :cry: .....

Re: Fat32 filesystem

Posted: Mon Dec 13, 2010 1:29 pm
by NickJohnson
What are the capabilities of your OS so far? Are you in real mode or protected mode? Can you read from the disk yet?

Also, it should be pretty easy to write a simple FAT32 driver with just the description of the filesystem, especially if it's read-only. IIRC, there are documents describing FAT32 on the wiki to a sufficient degree.

Re: Fat32 filesystem

Posted: Mon Dec 13, 2010 5:37 pm
by Combuster
I dont know how to add extern functions
If you are suggesting what I think you are, the Required Knowledge rule probably applies here... Did you ever build projects with multiple sources by hand?

Re: Fat32 filesystem

Posted: Tue Dec 14, 2010 12:40 am
by iLewis
My OS has a fully implemented fat32 driver, it does everything you requested. it does NOT write yet however because I'm lazy.

Refer to http://www.retsim.com/svn/mos/Kernel/Media%20OS/MK/ and look at # Fat32Driver.cpp # Fat32Driver.h

EDIT: Um, i wouldnt copy paste it tho... its written for x86-64 ;) So it prob wont work properly if your on x86

Re: Fat32 filesystem

Posted: Wed Dec 15, 2010 1:57 am
by salil_bhagurkar
Why aren't you referring to the FAT spec by Microsoft? It is by far the simplest spec I have ever seen. If you read it, you'll understand what is to be implemented and will give you the base for other file systems as well. Reading or porting other codes won't help you and later on you won't be able to change them. Besides, once you have a driver interface, adapting the code to it will be a headache if you don't know the architecture of FAT.

Hence, I would suggest going through the FAT spec: http://www.microsoft.com/whdc/system/pl ... atgen.mspx