Technical information

© Jean Louis-Guérin V1.2a September 2014 Page 39 / 69
Chapter 8. Hard Disk Presentation
The goal of the second part of this document is to provide in-depth technical information about Atari
hard disks partitioning (layout). For that matter I describe in detail the TOS File System as well as the
DOS/FAT File System as both of them are used on the Atari platform. However the DOS/FAT File
System study is limited to what is useful in the Atari platform context. In order to explain the
compatibilities and limitations of the different types of partitioning several practical examples are
analyzed.
8.1 Hard Disk Primer
First disks had a simple design. They had one or more rotating platters and a moving arm with
read/write heads attached to it - one head on each side of the platter. The arm could move and stop at
the certain number of positions. When it stopped each head could read or write data on the underlying
track. Every read or write had to be done in blocks of bytes, called Sectors. Sectors were usually 512
bytes long and there were fixed number of sectors
on each track.
8.1.1 CHS Format
When IDE (Integrated Drive Electronics) disks came
out the disk space was used more efficiently.
Engineers had placed more sectors on the outer
tracks, but still provided software writers with a
convenient “cubical” look of the disk by doing
internal translation of CHS (cylinders, heads, and
sectors). Variable sector/cylinder count by early IDE
drives is called Zone-bit recording. For example an old 340MB disk has only two platters = 4 heads
(sides), but it reports 665 cylinders, 16 heads, and 63 sectors. In reality it, probably, has more then
4*63 sectors on each outer track and a little less than 4*63 on the most inner tracks, but we could
never know for sure. With the early IDE disks CPU only has to tell the CHS of the sector that it wants
to read and drive's electronics will position the heads to start data transfer.
The maximum allowable values for CHS addressing mode are: 0 to 1023 for cylinders, 0 to 255 for
heads, and 1 to 63 for sector. If you multiply these values you will see that the largest hard disk that
could be addressed with CHS addressing mode is 8GB. The (logical) number of cylinders, heads and
sectors per track can be determined by the function 08h respectively 48h of the BIOS interrupt 13h.
8.1.2 LBA Format
The newest drives have a simpler interface. Instead of addressing sectors by their CHS (cylinder,
head, and sector) address they use LBA (Logical Block Addressing) mode. In LBA mode a program
has only to tell the number of the sector from the beginning of the disk (all sectors on disk are
numbered 0, 1, 2, 3 ...). Virtually all modern operating systems use LBA addressing, but the CHS
notation is still around. First of all, MS-DOS, which is about 20 years old, uses only CHS. Also some
programs, like Partition Magic, would not work if partitions do not start at the cylinder or side boundary.
8.1.3 Conversion between CHS and LBA
It is possible to convert LBA format to CHS and vice versa. Conceptually both forms are equivalent. A
sector C/H/S in the CHS format has the following LBA number:
LBA = C x Num_Head x Num_Sec + H x Num_Sec + (S - 1)
Here Num_Sec means the (logical) number of sectors per track and Num_Head the (logical) number
of heads. Only these two (logical) geometry parameters of the disk are relevant for the conversion.
The number of cylinders in unimportant for the conversion.
A nice utility is available to perform these conversions search for pcalc in the Partition Table Editor
section.