File systems: FAT


Full review of FAT file systems

FAT (File Allocation Table) file system is the primary file system in various operation systems: Microsoft DOS, Microsoft Windows 9x, UEFI, e.t.c. and is supported from the box by almost all available OSes.

Introduction to FAT file system

FAT file systems: exFAT, FAT32, FAT16, FAT12

FAT file system includes 2 important data structures: File Allocation Table, directory entries.

FAT file system’s basic concept: Each file and directory is allocated a data structure (a directory entry).

Directory entry contains:

  • File name
  • File size
  • File content: starting address
  • File metadata

The content of files and directories is stored in clusters (data units). If their content occupies more than 1 cluster, you can find the full list of clusters in the FAT structure. The FAT structure is used for identification of clusters’ allocation status and the next cluster in a file.

Classification of FAT file systems

Versions of FAT file systems:

  1. FAT12
  2. FAT16
  3. FAT32
  4. exFAT

The FAT version number is the size in bits of the entries in the FAT structure (64 bit for exFAT).

FAT file system: physical layout

Microsoft FAT Specification: FAT physical layout.
Microsoft FAT Specification: volume structure.
  1. Reserved Area
  2. FAT Area
  3. Root Directory Area (FAT12/FAT16)
  4. Data Area

FAT: Reserved Area

The first section of the FAT file system is the reserved area. Reserved area includes data in the file system category. It usually occupies 1 sector in FAT12 and FAT16, the exact size is defined in the Boot sector, which is also located here in the 1st sector of the volume.

FAT: FAT Area

FAT Area is used to store the primary and backup FAT structures. This section starts in the next following sector, straight after the reserved area section. FAT Area’s size depends on the size and number of FAT structures.

FAT: Root Directory Area

Root Directory Area exists only on FAT12/FAT16 file systems.

FAT: Data Area

Data Area is the 3rd section, which contains the clusters that will be allocated for storing the files and directories contents.

Boot Sector and BIOS Parameter Block

BIOS Parameter Block (BPB) is located in Reserved Area in the 1st sector of the volume.

BIOS Parameters Block: Special Rules

All FAT volumes MUST have a BPB in Boot Sector (in sector 0 of the volume)!

The BPB in the boot sector of a FAT volume MUST have all of the BPB fields for either the FAT12/FAT16 or FAT32 BPB type.

For FAT32, the BPB differs from that for FAT16/FAT12 beginning at offset 36!

A list of extremly useful and very interesting IT books, documents, specifications, concerning FAT file system.

NameOffset
(bytes)
Size
(bytes)
Description
BS_jmpBoot03Jump instruction to boot code. This field has two
allowed forms:
jmpBoot[0] = 0xEB, jmpBoot[1] = 0x??,
jmpBoot[2] = 0x90
and
jmpBoot[0] = 0xE9, jmpBoot[1] = 0x??,
jmpBoot[2] = 0x??
0x?? indicates that any 8-bit value is allowed in
that byte. What this forms is a three-byte Intel x86
unconditional branch (jump) instruction that jumps
to the start of the operating system bootstrap code.
This code typically occupies the rest of sector 0 of
the volume following the BPB and possibly other
sectors. Either of these forms is acceptable.
JmpBoot[0] = 0xEB is the more frequently used
format.

Library: FAT file system

  1. Microsoft FAT Specification
  2. Microsoft Extensible Firmware Initiative FAT32 File System Specification

To be continued…

2 Comments Add yours

  1. Aarav Gupta says:

    Nice and informative blog.
    The blog is very elucidate and I got to know some interesting information on FAT file systems that I did not know earlier.

    Liked by 1 person

    1. About IT says:

      Thank you!

      Liked by 1 person

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s