FAT: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m For some reason, the first sector of a cluster was, according to this page, "first_sector_of_cluster = (cluster - 2) * fat_boot->reserved_sector_count + first_data_sector;". Corrected.
Candy (talk | contribs)
Added basic exfat differentiation logic
Line 12: Line 12:
=== FAT 32 ===
=== FAT 32 ===
FAT 32 was introduced to us by Windows95-B and Windows98. FAT32 solved some of FAT's problems. No more 64K max clusters! FAT32 is slightly misnamed, as the top 4 bits of the 32 bit cluster number are reserved, and were never used. If you want to call it FAT28 instead, then as the name suggests, the filesystem can handle a maximum of 256M clusters per partition. This enables very large hard disks to still maintain reasonably small cluster sizes and thus reduce slack space between files.
FAT 32 was introduced to us by Windows95-B and Windows98. FAT32 solved some of FAT's problems. No more 64K max clusters! FAT32 is slightly misnamed, as the top 4 bits of the 32 bit cluster number are reserved, and were never used. If you want to call it FAT28 instead, then as the name suggests, the filesystem can handle a maximum of 256M clusters per partition. This enables very large hard disks to still maintain reasonably small cluster sizes and thus reduce slack space between files.

=== ExFAT ===
ExFAT is the filesystem used on SDXC cards, created by Microsoft. It is basically FAT32 with actually 32 bits per FAT entry, with minor extensions. Main article is [ExFat]


=== VFAT ===
=== VFAT ===
Line 515: Line 518:




'''The FAT type of this file system (12, 16, or 32):'''
'''The FAT type of this file system:'''
<source lang="C">
<source lang="C">
if(total_clusters < 4085)
if(total_clusters < 4085)
{
{
fat_type = 12;
fat_type = FAT12;
}
}
else if(total_clusters < 65525)
else
{
{
fat_type = FAT16;
if(total_clusters < 65525)
}
{
else if (total_clusters < 268435445
fat_type = 16;
{
}
fat_type = FAT32;
else
}
{
else
fat_type = 32;
{
}
fat_type = ExFAT;
}
}
</source>
</source>