Technical information

© Jean Louis-Guérin V1.2a September 2014 Page 43 / 69
Each partition (standard or extended) is defined by an entry in the partition table:
Offset
Length
Description
Partition entry locations
$00
1
Status: indicate the status of the partition
bit 0 when set partition exist,
bit 1-6 reserved
bit 7 when set partition bootable
The BIOS will boot the first partition that has bit 7 set
$1C6, $1D2, $1DE, $1EA
$01
3
ID Name: a 3-bytes ASCII field that identifies the type of partition
GEM for regular (< 32MB) partition
BGM for big ( 32MB) partition
XGM for extended partition
$1C7, $1D3, $1DF, $1EB
$04
4
Offset to the beginning of the partition from the beginning of the
hard disk. Specified in number of physical (512 bytes) sectors
$1CA, $1D6, $1E2, $1EE
$08
4
Size of the partition in number of physical (512 bytes) sectors
$1CE, $1DA, $1E6, $1F2
9.3 TOS Standard Partition
The following is an overview of the order of the structures in standard TOS file system partition:
Boot
Sector
Reserved
(optional)
FAT #1
FAT #2
Root
Directory
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) / 512
Number of clusters * Sectors
per cluster
A TOS file system is therefore composed of these four different regions:
The Boot Sectors region located at the very beginning of a partition: The first logical sector of a
standard partition (logical sector 0) is the Boot Sector. It includes an area called the BIOS
Parameter Block (BPB) and may contain some boot loader code. The BPB provides some basic
file system information, in particular its type, and pointers to the location of the other sections. 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 TOS structure called the BIOS Parameter Block
(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: It contains the Root Directory that stores information about the files
and directories located in the Root Directory. The Root Directory has a fixed size which is pre-
allocated at creation of the 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
The Atari AHDI 3.00 specifies two types of standard partition:
The regular partition (GEM Partition) and,
The big partition (BGM Partition)
9.3.1 Regular Partition (GEM) Limits
Size of a physical sector in number of bytes = 512
Maximum number of sectors = 2^15 = 32768 (< TOS 1.04
14
)
Maximum number of sectors = 2^16 = 65536 (>= TOS 1.04)
Maximum size of a partition in number of bytes = 32768 * 512 = 16 MB (< TOS 1.04)
Maximum size of a partition in number of bytes = 65536 * 512 = 32 MB ( TOS 1.04)
9.3.2 Big Partition (BGM) Limits
TOS < 1.04:
Maximum size of a cluster in number of bytes = 2^14 = 16384
Size of a cluster in number of logical sectors = 2
Maximum size of a logical sector in number of bytes = 16384 / 2 = 8192
Maximum number of logical sectors = 2^15 = 32768
Maximum size of a partition in number of bytes = 32768 * 8192 = 256 MB
14
Note that prior to TOS 1.04 the number of sectors is stored as a signed integer resulting in a maximum of 32768 sectors.
Starting with TOS 1.04 the number of sectors is stored as an unsigned integer resulting in a maximum of 65536 sectors