FAT16 on a floppy?

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
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

FAT16 on a floppy?

Post by pcmattman »

Ok, I'm (officially) sick of FAT12.

Is there any way to make my boot floppy FAT16? If I can use FAT16 then I can finally have reading the FAT much easier because there are 16-bits not 12-bits in each cluster entry.

From my Googling, I've seen many references to a FAT16 floppy, so it must be possible.
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:

Post by Combuster »

if you know where to look...

mkdosfs -F 16
(http://www.linuxcommand.org/man_pages/mkdosfs8.html)
"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 ]
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Oh... I'm on Windows.

I'll just have to boot into my linux partition and use that, then use dd (in Cygwin) to create the image file that I can use for VFD.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Post by bubach »

whats so hard about 12 bits? it's not much diffrent from 16, you just shift out the bits that you don't need?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Hmmm... I just found out that my Linux partition is dead (again).

Edit: I also found out that for some strange reason the FORMAT command in Windows doesn't do FAT16... mkdosfs, the Windows port, doesn't work ("mkdosfs: unable to get length for '\\.\b:'").
urxae
Member
Member
Posts: 149
Joined: Sun Jul 30, 2006 8:16 am
Location: The Netherlands

Post by urxae »

I've attached the result of:

Code: Select all

$ dd if=/dev/zero of=fat16.img bs=512 count=2880
$ mkdosfs -F 16 fat16.img 
mkdosfs 2.11 (12 Mar 2005)
WARNING: Not enough clusters for a 16 bit FAT! The filesystem will be
misinterpreted as having a 12 bit FAT without mount option "fat=16".
$ gzip fat16.img
Note the warning. I have no idea if that's also true for Windows, but I thought I'd mention it.

Hope this helps.
Attachments
fat16.img.gz
Empty FAT16 floppy image
(1.63 KiB) Downloaded 208 times
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Thankyou so much! Windows doesn't complain at all (the warning is just for Linux afaik).
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

The FAT types are pretty much always determined by the number of clusters on the disk. If you were able to format a disk with less than the proper number of clusters as FAT16 than it would still be mistaken for FAT12. That would cause havoc. So if you do get this too work, don't expect it too work on other OSs.
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:

Post by Combuster »

maybe its just crappy open source software that does not check the mbr for 'FAT12' or 'FAT16' </sarcasm>
"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 ]
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

EDIT: Oops must have missed the sarcasm, sorry
Microsoft wrote:The FAT type—
one of FAT12, FAT16, or FAT32—is determined by the count of clusters on the volume and nothing
else.
That is from the FAT: General Overview of On-Disk Format from microsoft. Take it for whatever you want to.

According to the document this is the only way to determine FAT type:

Code: Select all

If(CountofClusters < 4085) {
/* Volume is FAT12 */
} else if(CountofClusters < 65525) {
/* Volume is FAT16 */
} else {
/* Volume is FAT32 */
}
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

Combuster wrote:maybe its just crappy open source software that does not check the mbr for 'FAT12' or 'FAT16' </sarcasm>
Well... the official docs specify that the "FAT12" and "FAT16" doesn't matter but that you just count the number of clusters. In this case, this was from the Microsoft docs.

You probably know that though, as per the </sarcasm> tag.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Hmmm... I see your points. Turns out Windows changed it back to FAT12 as soon as files started getting written to it :(

Either way, I now have FAT12 reading setup properly (writing is for today and tomorrow :D ) so it's really quite irrelevant now.
Post Reply