MS-DOS 6.22 Formatting Non-Standard Sectors

This article explains how MS-DOS 6.22 processes formatting requests for media with non-standard sector layouts, detailing the interaction between FORMAT.COM, block device drivers, BIOS interrupts, and file system constraints. It covers how the operating system negotiates custom track and sector counts, handles BIOS Parameter Blocks (BPB), and confronts built-in architectural limitations when encountering non-standard sector sizes or dense sector configurations.

High-Level vs. Low-Level Formatting Roles

MS-DOS 6.22 relies on FORMAT.COM to prepare disks. The utility operates differently depending on the drive type:

  • Floppy Disks: FORMAT.COM performs both a low-level format (laying down track markers, sector headers, and inter-sector gaps) and a high-level format (creating the boot sector, File Allocation Tables, and the root directory).
  • Hard Disks: FORMAT.COM performs only a high-level format. It does not lay down physical sectors; it assumes the disk controller or a dedicated low-level utility has already structured the physical sectors on the drive.

The Role of Command-Line Parameters

When requested to format media with non-standard track or sector layouts, FORMAT.COM accepts parameters such as /T:tracks and /N:sectors. These parameters override the standard defaults found in the ROM BIOS:

  • /T:<tracks> defines the number of physical tracks (cylinders) to format.
  • /N:<sectors> defines the number of sectors per track.
  • /F:<size> attempts to match a predetermined profile (e.g., 360, 720, 1.2, 1.44, 2.88 MB).

When user-specified flags are provided, MS-DOS validates the numbers against allowable ranges maintained inside the utility's internal drive validation tables. If the parameters exceed the maximum bounds allowed by the device driver or the BIOS, FORMAT.COM terminates execution with the message: Parameters not supported by drive.

Hardware Abstraction: Generic IOCTL and INT 13h

If the parameters pass initial checks, MS-DOS 6.22 attempts to execute the formatting process through a layered abstraction stack:

  1. Generic IOCTL Calls: FORMAT.COM calls DOS interrupt INT 21h, Function 440Dh (Generic Block Device Request), using Minor Code 42h (Format/Verify Track) and Minor Code 41h (Set Device Parameters). This instructs IO.SYS to establish a temporary layout structure for the target track.
  2. BIOS Parameter Block (BPB) Generation: The operating system builds an in-memory BPB containing the custom geometry: bytes per sector, sectors per cluster, reserved sectors, number of FATs, root directory entries, total sectors, media descriptor byte, and sectors per track.
  3. ROM BIOS INT 13h: The block driver delegates the physical track layout to BIOS INT 13h, Function 05h (Format Track). To execute this call, the driver constructs an Address Field buffer containing four bytes per sector:
    • Cylinder number (C)
    • Head number (H)
    • Sector number (R)
    • Sector size code (N, where 00h = 128 bytes, 01h = 256 bytes, 02h = 512 bytes, and 03h = 1024 bytes).

If the BIOS controller accepts the custom address field table, the hardware controller formats the physical track with the specified sector count and sector IDs.

The INT 1Eh Diskette Parameter Table (DPT)

For floppy drives, standard formatting behavior is bounded by the Diskette Parameter Table pointed to by the interrupt vector INT 1Eh. The DPT specifies:

  • Step rate time and head unload time.
  • Head turn-on time and settle time.
  • End of Track (EOT) value (sectors per track).
  • Gap length for formatting (GAP3) and data length.

When a non-standard sector count is requested, MS-DOS 6.22 temporarily copies the table into RAM, updates the vector to point to the modified DPT containing the updated EOT and gap length values, issues the formatting calls, and then restores the original vector upon completion or failure.

Sector Size Limitations and the 512-Byte Boundary

While the BPB and the INT 13h interface theoretically support sector sizes other than 512 bytes (such as 128, 256, 1024, 2048, or 4096 bytes via the sector size code), the core FAT12 and FAT16 implementations in MS-DOS 6.22's MSDOS.SYS hardcode internal sector buffer logic to 512-byte boundaries.

If a format request uses a non-standard sector size:

  • FORMAT.COM will fail during the disk initialization phase when writing the boot sector or the FAT structures.
  • The disk can only be formatted if custom block drivers (such as specialized RAM disk drivers or third-party optical media drivers) intercept read/write calls and emulate a 512-byte presentation to the DOS kernel.

Non-Standard Geometries: DMF and Custom Densities

MS-DOS 6.22 cannot format Microsoft's proprietary Distribution Media Format (DMF) using standard FORMAT.COM. DMF uses an 80-track, 21-sector-per-track layout with reduced inter-sector gap lengths to achieve 1.68 MB on a standard 1.44 MB floppy disk.

When MS-DOS 6.22 processes a request for a 21-sector layout without specialized driver support:

  • The standard floppy disk controller (FDC) fails to detect valid address markers due to default timing constraints.
  • The BIOS returns an error code 04h (Sector not found) or 0Ch (Requested sector size/geometry not supported).
  • FORMAT.COM aborts with Track 0 bad or disk unusable.

To bypass these limitations in MS-DOS 6.22, non-standard layouts require configuration via DRIVER.SYS in CONFIG.SYS (which creates an aliased drive letter configured with customized tracks and sector values) or the use of specialized low-level utilities that write directly to the Floppy Disk Controller I/O ports (0x3F0-0x3F7), bypassing both the standard FORMAT.COM utility and the ROM BIOS.