Disk Drive Logical Structure: MS-DOS 2.0 File System
Logical Structure of Disk Drives
This section details the logical structure of disk drives and their interrelation with diskettes, summarizing the different BIOS functions that notify and allow access to them.
Internally, hard drives can be divided into several homogeneous volumes. Within each volume, the primary structures of the MS-DOS 2.0 operating system are as follows:
- Boot Sector
- File Allocation Table (FAT)
- Copies of the FAT
- Root Directory (eventually with a volume label)
- Data Area and Subdirectories
As shown, each volume is divided into different zones that accommodate various data structures of the file system. The size of these different data structures and areas is not fixed; rather, it is adapted to the individual volume size.
The Boot Sector
When formatting a volume, the boot sector is always created as the first sector of the volume. This allows for easy location of the second sector, which contains information about the volume’s size, structure, and especially the bootloader. The bootloader enables the PC to boot directly from the disk. This sector is also known as the partition boot sector (boot).
File Allocation Table (FAT)
When creating new files or expanding existing ones, the system needs to know which sectors of the volume are free. This information is managed by the File Allocation Table (FAT).
Every entry in this table corresponds to a determined number of logically adjacent sectors within the volume. These groups of sectors are called clusters.
The size of the different table entries in the MS-DOS 2.0 versions was 12 bits. This allowed managing 4096 clusters, with a capacity of up to 8 megabytes.
Due to the problem that arose with the advent of buffered and large-capacity drives, the size was expanded to 16 bits, allowing addressing a maximum of 65,535 clusters.
Currently, FATs are 32 bits, enabling hard drives to store up to 15 gigabytes of information.
Copies of the FAT
A program allows formatting not only one, but multiple identical copies of the FAT. If the system finds one of these copies, it takes care of all simultaneous copies of the FAT, ensuring that new free or occupied clusters are updated when creating or deleting files. This offers the advantage that the primary FAT can be replaced in case of defective copies, thus avoiding data loss.
The Root Directory
The maximum number of entries in the root directory is limited by its size, which is fixed in the boot sector. The root directory represents the first static data structure, which is created regardless of whether files or subdirectories are saved. Therefore, depending on the size of the disk or volume, the size of the root directory is selected in relation to the volume.
The Data Area
This is the main part where file data is stored. This area depends almost entirely on the interrelations of the data structures that form the MS-DOS 2.0 file system and how the FAT manages the different sectors from the files.