FAT32 support

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
H@cker

FAT32 support

Post by H@cker »

I'm trying to make my own OS. It now can do the basics like "cls", "reboot", etc. Now I need to add FAT32 support. Ive asked this and received many links. But since Im not English, I don't understand them very well. So is there an example for it or something?

10x,
H@cker
kerim

Re:FAT32 support

Post by kerim »

do a search on the web. believe me there are a lot of tutorials and source codes on the web dealing with working with FAT 12/16/32
H@cker

Re:FAT32 support

Post by H@cker »

Ive found alot of tutorials. Though, they are very complicated and since Im not English, I don't understand them. I haven't found any source code. So could anyone please give me a link to one?

10x
kerim

Re:FAT32 support

Post by kerim »

you should check this one :
http://home.no.net/tkos/info/fat.html
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:FAT32 support

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:36 pm, edited 1 time in total.
kerim

Re:FAT32 support

Post by kerim »

good idea for experiment ;D ;)
DarylD

Re:FAT32 support

Post by DarylD »

As has been mentioned before. Windows chooses FAT12/FAT16 depending on the size of the disk, so you will find it hard to format a 1.44 as FAT16.

Also, why bother? The FAT tables will be larger so you will have less free space. Do you even understand how the FAT system works? If not, I suggest looking it up, then you will realise why FAT32 on a floppy is just *stupid*.
kerim

Re:FAT32 support

Post by kerim »

yeah, I've been thinking about it a while and I realized that it is probably possible to implement FAT 16 on floppy, but it will be just a bigger loss of space.
whyme_t

Re:FAT32 support

Post by whyme_t »

While it would not be beneficial to change the FAT on a standard 1.44mb disk, what about one of the LS-120 disks?(Which I happen to have).

LS-120 is a floppy drive which can read / write normal 1.44 disks, but can also read / write special 120mb disks.

With a 120mb to play with, would it be beneficial to change the FAT?
DarylD

Re:FAT32 support

Post by DarylD »

Fat16 will do fine on your LS-120 disks.

Fat32 only becomes useful on disks larger than 512MB in my opinion, and that is only to keep the cluster size low.

Daryl.
Warmaster199

Re:FAT32 support

Post by Warmaster199 »

FAT16 will NOT work on 1.44 MByte floppies. The FAT bits (12/16/32) are defined by the number of clusters on the drive. A 1.44MByte floppy has a max of 2880 sectors (or clusters because it is set to 1 sector per cluster). If a drive has less than 4096 clusters, it IS a FAT12 drive... No exceptions. A FAT16 drive cannot hold more than 65536 clusters... and FAT32 cannot have more than 4billion clusters (Leading to FAT32 drives holding a MAX of 2TBytes). Once you implement FAT12, it will be EASY to implement both FAT16 and 32.

The best FAT documentation that I have found is at www.nondot.org/sabre/os/ - click on filesystems and open the Microsoft FAT specification.

There is one example of FAT code that I have seen on the net after many hours of searching. Look up Minimal DOS Compatible Filesystem or MDCFS. It's FAT12 read and write code, BUT it can't read directories. Everything you wish to access with that code must be in the root of the drive. Please hurry on grabbing the code, I have heard that they are shutting the site down.

If you want an awesome filesystem(Proven by several benchmarks as the fastest filesystem - marginally faster than ReiserFS), try to implement XFS - The Silicon Graphics Filesystem. It is a 64-bit filesystem and is designed for large file access, although it will acess small ones to. SGI made it open source for use with LINUX. Beware, it's over 50,000 lines of C(according to SGI)
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:FAT32 support

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:36 pm, edited 1 time in total.
Warmaster199

Re:FAT32 support

Post by Warmaster199 »

FAT16 will work on any drive that has more that 4085 clusters(I reviewed the docus again, I thought it was 4096). So: Theoretically(and according the the MS FAT specification) the minimum size that a FAT16 volume could ever possibly be is ALMOST 2MBytes (4086 clusters with 512byte sectors, 1 sec per clus). The MINIMUM size of a FAT32 volume is 65525(Again, I reviewed the MS FAT Spec: thought it was 65536). This leads to a minimum of FAT32 being ALMOST 32MBytes (65525 clusters with 512byte sectors, 1 sec per clus).

However: MS FAT drivers will NEVER create a FAT16 volume less than 4.1MBytes (8400 clusters) or a FAT32 volume less than 32.5MBytes (66600 clusters).

By the minimum size being 512MBytes for a FAT32 volume I have an explanation:The MS Windows FAT drivers will NOT make a drive FAT32 if it's capacity is less than 512MBytes: Doing this would be dumb because it wastes space. Therefore, we can assume that EVERY drive formatted by windows 95 and later that is LESS THAN 512MBytes is FAT16... BUT: The user can choose to make a drive up to ~2GBytes a FAT16 volume... because ~2GBytes = 65525clusters * 32KByte cluster size...
Post Reply