How IO.SYS Checks Hardware in MS-DOS 6.22
During the MS-DOS 6.22 boot sequence, IO.SYS acts as the
fundamental hardware interface that bridges the computer's ROM BIOS with
the DOS kernel. Once the volume boot record loads IO.SYS
into memory, the file executes an initialization sequence that
interrogates the computer's physical components, sets up low-level
interrupt vectors, establishes the base device drivers, and creates a
stable environment for the operating system kernel
(MSDOS.SYS) to take control.
The Boot Sector Handoff
The boot process begins when the Volume Boot Record (VBR) reads the
first sectors of IO.SYS from the boot drive into low
conventional memory (typically starting at segment address
0070:0000h). Once loaded, the VBR passes execution control
directly to the entry point of IO.SYS. At this stage, the
system relies entirely on the basic input/output services provided by
the motherboard's ROM BIOS.
BIOS Interrogation and Equipment Determination
Upon execution, IO.SYS determines the machine's exact
hardware profile by querying both the BIOS Data Area (BDA) located at
memory segment 0040:0000h and executing specific ROM BIOS
interrupts:
- Memory Sizing: It invokes
INT 12hto determine the total contiguous conventional memory (up to 640 KB) available for allocation. - Equipment List Detection: It calls
INT 11hto retrieve the BIOS equipment word. This bitmask informsIO.SYSof installed peripherals, including the number of floppy disk drives, the presence of an initial display adapter (monochrome or color), math coprocessors, and the count of installed serial (COM) and parallel (LPT) ports. - Storage Geometry: It queries
INT 13hto verify the presence, ready status, and geometry (heads, cylinders, and sectors) of the primary boot media and attached fixed hard disks.
Interrupt Vector Table (IVT) Configuration
IO.SYS reconfigures the Interrupt Vector Table located
in the first 1,024 bytes of system memory (0000:0000h
through 0000:03FFh). While preserving critical low-level
ROM BIOS hardware hooks, IO.SYS overrides and redirects
standard hardware and software interrupt vectors. This includes
capturing hardware interrupts such as the system timer
(INT 08h) and keyboard services (INT 09h), as
well as initializing the software vectors required for internal DOS
operations and error handling routines (such as the critical error
handler INT 24h).
Initialization of Resident Device Drivers
To provide a consistent API for software, IO.SYS loads
and initializes its built-in hardware device drivers. These resident
drivers replace or augment raw BIOS routines to establish the standard
DOS hardware handles:
CON(Console): Manages basic keyboard input and screen output routines.AUX/COM1: Establishes communication protocols for the primary serial interface.PRN/LPT1: Initializes the primary parallel port for printer communication.CLOCK$: Interfaces with the system real-time clock and timer chips to track system time and date.- Block Devices: Assigns drive letters to physical
storage hardware (e.g.,
A:andB:for floppy drives,C:for the primary active hard drive partition) based on the parameters reported by the disk controller.
Each internal driver runs its local initialization routine, which resets the corresponding controller chip, clears hardware buffers, and sets initial baud rates or display modes.
Kernel Transition and CONFIG.SYS Preparation
Once all default hardware devices are mapped and functional,
IO.SYS relocates the DOS kernel (MSDOS.SYS) to
its permanent position in conventional memory and transfers execution to
the kernel initialization code. The kernel then references the hardware
state prepared by IO.SYS to parse CONFIG.SYS,
allowing user-specified drivers (DEVICE= and
DEVICEHIGH= directives) to augment or replace the base
hardware configurations initialized by IO.SYS.