OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:01 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Creating a FAT 16 formatted disk image
PostPosted: Sat Dec 09, 2017 2:06 pm 
Offline

Joined: Thu Apr 06, 2017 2:59 pm
Posts: 6
Hi,

I'm looking for tools to format a disk image as a FAT 16 disk. I have tried using ImDisk to mount a blank file and then use Windows Explorer to format the disk image, but it only gives NTFS or FAT 32 as options to format.

Does anyone have any tools I could use to create a FAT 16 disk image and write files to it? I can use tools for Windows and Linux.

Many thanks,
Adam


Top
 Profile  
 
 Post subject: Re: Creating a FAT 16 formatted disk image
PostPosted: Sat Dec 09, 2017 3:43 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

adamfc2000 wrote:
I'm looking for tools to format a disk image as a FAT 16 disk. I have tried using ImDisk to mount a blank file and then use Windows Explorer to format the disk image, but it only gives NTFS or FAT 32 as options to format.


In this case I'd assume that the disk image/file is too large.

Note that normally a set of rules are used to determine which version of FAT makes sense, where tiny volumes use FAT12, small volumes use FAT16 and everything larger uses FAT 32. I can't remember exactly what these rules are (but it'd depend on the number of sectors in some way).

For testing; I'd be tempted to try a 33 MiB volume/file - this is slightly larger than the maximum that FAT12 can support (with 8 KiB clusters) and much smaller than the maximum that FAT16 can support (e.g. 256 MiB with 4 KiB clusters).


Cheers,

Bremdan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: Creating a FAT 16 formatted disk image
PostPosted: Sat Dec 09, 2017 3:52 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 640
Location: Ukraine, Bachmut
As Brendan says. The specification in fact tries hard to convince the reader to get that the exact type of FAT really depends not on signatures or will of volume creators but on the partition capacity. Try to read the specification and you will find about this in a very detailed way. Yes it depends on number of clusters:
Quote:
FAT Type Determination
There is considerable confusion over exactly how this works, which leads to many “off by 1”, “off by 2”, “off by 10”, and “massively off” errors. It is really quite simple how this works. The FAT type—one of FAT12, FAT16, or FAT32—is determined by the count of clusters on the volume and nothing else.

...

This is the one and only way that FAT type is determined. There is no such thing as a FAT12 volume that has more than 4084 clusters. There is no such thing as a FAT16 volume that has less than 4085 clusters or more than 65,524 clusters. There is no such thing as a FAT32 volume that has less than 65,525 clusters. If you try to make a FAT volume that violates this rule, Microsoft operating systems will not handle them correctly because they will think the volume has a different type of FAT than what you think it does.

page 14 of the fatgen103 document.

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Top
 Profile  
 
 Post subject: Re: Creating a FAT 16 formatted disk image
PostPosted: Sat Dec 09, 2017 4:40 pm 
Offline

Joined: Thu Apr 06, 2017 2:59 pm
Posts: 6
Quote:
The FAT type—one of FAT12, FAT16, or FAT32—is determined by the count of clusters on the volume and nothing else.


Ah, thanks. That's cleared up a few things.

Quote:
In this case I'd assume that the disk image/file is too large.

Note that normally a set of rules are used to determine which version of FAT makes sense, where tiny volumes use FAT12, small volumes use FAT16 and everything larger uses FAT 32. I can't remember exactly what these rules are (but it'd depend on the number of sectors in some way).

For testing; I'd be tempted to try a 33 MiB volume/file - this is slightly larger than the maximum that FAT12 can support (with 8 KiB clusters) and much smaller than the maximum that FAT16 can support (e.g. 256 MiB with 4 KiB clusters).


Thanks - I've got things working now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group