Technical information

© Jean Louis-Guérin V1.2a September 2014 Page 52 / 69
The table of partitions has four 16-byte structures to describe each partition:
Offset
Length
Description
Partition entry locations
0x00
1
Status
0x80 = bootable (active),
0x00 = non-bootable,
other = invalid
$1BE, $1CE, $1DE, $1EE
0x01
3
CHS address of first sector in partition (next 3 bytes):
Head
Sector is in bits 50; bits 98 of Cylinder are in bits 76
bits 70 of Cylinder
$1BF, $1CF, $1DF, $1EF
0x04
1
partition type
$1C2, $1D2, $1E2, $1F2
0x05
3
CHS address of last sector in partition (next 3 bytes):
Head
Sector is in bits 50; bits 98 of Cylinder are in bits 76
bits 70 of Cylinder
$1C3, $1D3, $1E3, $1F3
0x08
4
LBA of first sector in the partition, in little-endian format
$1C6, $1D6, $1E6, $1F6
0x0C
4
Number of sector in partition, in little-endian format
$1CA, $1DA, $1EA, $1FA
10.4 DOS/FAT Primary Partition
A primary partition contains one FAT file system. The “partition type” code for a primary partition
describes the type of the file system. The FAT file systems have made use of quite a number of
partition type codes over time due to the limits of various DOS and Windows OS versions. Please refer
to FAT Partition Type and Size for a short summary of partition types useful in the context of the Atari
platform.
The following is an overview of the order of the structures in a primary FAT file system partition:
Boot
Sector
FS Information
Sector (FAT32
only)
More
reserved
sectors
(optional)
File
Allocation
Table #1
File
Allocation
Table #2
Root
Directory
(FAT12/16 only)
Data Region (for files and
directories) ...
(To end of partition or
disk)
size in
sectors
(number of reserved sectors)
(number of FATs) *
(sectors per FAT)
(number of root entries
* 32) / Bytes per sector
NumberOfClusters *
SectorsPerCluster
A FAT file system is therefore composed of these four sections:
The Boot sectors region, located at the very beginning of the partition: The first reserved sector
(logical sector 0) is the Boot Sector. It includes an area called the BIOS Parameter Block (with
some basic file system information, in particular its type, and pointers to the location of the other
sections) and usually it contains the operating system's boot loader code. The total count of
reserved sectors is indicated by a field inside the Boot Sector. Important information from the
Boot Sector is accessible through a DOS structure called the BIOS Parameter Block (BPB). For
FAT32 file systems, the reserved sectors include a File System Information Sector, usually at
sector 1, and a Backup Boot Sector, usually at Sector 6. The exact location of these two sectors
is specified in the Extended FAT32 BPB.
The FAT region: This typically contains two copies (may vary) of the File Allocation Table for the
sake of redundancy checking, although the extra copy is rarely used, even by disk repair utilities.
These are maps of the Data region, indicating which clusters are used by files and directories.
The Root Directory region: This is the Directory Table that stores information about the files and
directories located in the Root Directory. It imposes on the Root Directory a fixed maximum size
which is pre-allocated at creation of this volume.
The Data region: This is where the actual file and directory data is stored and takes up most of the
partition. The size of files and subdirectories can be increased arbitrarily (as long as there are free
clusters) by simply adding more links to the file's chain in the FAT