How MS-DOS 6.22 Formats a Bootable Disk

In MS-DOS 6.22, creating a bootable disk is performed using the FORMAT command combined with the /S (System) switch. This command executes a multi-step routine that tests and structures the disk media, establishes the file system architecture, and transfers the core boot files—IO.SYS, MSDOS.SYS, and COMMAND.COM. The resulting disk contains both the necessary logical layout and the exact physical file placement required for the computer's BIOS to boot MS-DOS.

1. Drive Analysis and Media Preparation

When executing FORMAT [drive:] /S, the utility first determines the physical characteristics of the target drive, such as sector size, cylinders, heads, and total capacity.

  • Floppy Disks: The utility performs a low-level or surface scan by writing test patterns across every track to locate and mark bad sectors, clearing any existing data.
  • Hard Drives: The command performs a high-level format, clearing the allocation tables and verifying the integrity of the partition defined in the partition table (FDISK).

2. File System Generation

Once the surface check is complete, the FORMAT utility creates the standard FAT (File Allocation Table) file system structures:

  • Volume Boot Record (VBR): Written to the first sector of the partition (Sector 0). The VBR contains the BIOS Parameter Block (BPB)—which describes disk geometry, cluster size, and reserved sectors—along with the primary bootstrap loader code.
  • File Allocation Tables: Two identical copies of the FAT (FAT12 for floppies, FAT16 for hard disks) are generated to track cluster usage and locate files.
  • Root Directory Table: A designated area following the FATs is allocated to store file metadata, such as file names, attributes, timestamps, file sizes, and starting cluster pointers.

3. Transferring Essential System Files

Invoking the /S switch triggers an internal call to the SYS routine, which copies three critical files to the disk:

  1. IO.SYS: This file provides the basic hardware interface routines. In MS-DOS 6.22, IO.SYS must occupy the very first data clusters (Cluster 2 onward) of the disk, and its initial sectors must be strictly contiguous. The formatting utility writes IO.SYS first to guarantee it sits at this exact physical location so the boot sector code can locate it without reading the full FAT structure.
  2. MSDOS.SYS: This file contains the core MS-DOS operating system kernel. It is written immediately after IO.SYS.
  3. File Attributes: Both IO.SYS and MSDOS.SYS are assigned the Hidden (H), System (S), and Read-Only (R) attributes in their root directory entries to prevent accidental modification or deletion.
  4. COMMAND.COM: The default command processor (shell) is copied to the root directory as a normal, visible file.

4. Updating the Bootstrap Pointer

After copying the system files, the format utility finalizes the Volume Boot Record. The bootstrap code inside the VBR is configured to scan the root directory for IO.SYS and MSDOS.SYS as the first entries.

When the computer is powered on, the BIOS reads the Master Boot Record (MBR), which passes control to the VBR. The VBR loads the first sectors of IO.SYS into memory, which then initializes hardware devices, loads MSDOS.SYS, processes CONFIG.SYS and AUTOEXEC.BAT, and finally executes COMMAND.COM to display the command prompt.