How MS-DOS 6.22 Manages BIOS Video Modes

MS-DOS 6.22 manages application access to low-level BIOS video modes by stepping aside and granting programs unrestrained control over system resources. Because MS-DOS operates in 16-bit real mode without memory protection or a hardware abstraction layer, it does not virtualize, filter, or arbitrate video hardware. Instead, applications configure display modes by directly invoking ROM BIOS interrupts—primarily Interrupt 10h—or by bypassing software interfaces entirely to manipulate video controller registers and video memory directly.

The Real Mode Architecture

MS-DOS 6.22 executes on the x86 architecture in real mode, providing flat access to the first 1 MB of memory (conventional and upper memory). There are no privilege rings, memory isolation, or hardware-enforced boundaries between the operating system, the executing program, and the system firmware.

When a program requests a change in the display state, MS-DOS does not act as an intermediary or gatekeeper. The operating system yields control of the Central Processing Unit (CPU) to the running executable, enabling the application to execute any instruction, call any firmware routine, or read and write to any hardware port.

BIOS Interrupt 10h Services

The primary standard method for switching video modes under MS-DOS 6.22 is through BIOS Interrupt 10h (INT 10h). The video card’s ROM BIOS or the motherboard system BIOS establishes this interrupt vector in the Interrupt Vector Table (IVT) during power-on initialization:

  1. Setting Modes: An application loads the CPU register AH with 00h (Set Video Mode) and register AL with the target mode number (such as 03h for 80x25 16-color text, or 13h for 320x200 256-color VGA graphics).
  2. Execution: The application triggers INT 10h. The CPU suspends the application, references vector 0x0040 (address 0000:0040h in the IVT), and jumps directly to the BIOS code stored in ROM.
  3. Hardware Reconfiguration: The BIOS routine reprograms the cathode ray tube controller (CRTC), sequencer, and palette registers on the video adapter, clears the screen, sets cursor parameters, and updates the BIOS Data Area (BDA) located at memory segment 0040h.
  4. Return: The BIOS executes an IRET (Interrupt Return) instruction, returning execution to the application. MS-DOS is never invoked during this transaction.

Direct Hardware Register and Memory Access

Because BIOS routines could be slow, software such as games, CAD tools, and demoscene productions frequently bypassed INT 10h entirely to create non-standard "tweaked" modes (such as Mode X, a 320x240 planar mode).

MS-DOS 6.22 permits direct I/O port instructions (IN and OUT) and direct memory addressing:

  • Video RAM (VRAM): Applications write directly to physical memory mapped for display output. Standard mappings include 0xB000:0000 (monochrome text), 0xB800:0000 (CGA/EGA/VGA color text), and 0xA000:0000 (VGA graphics).
  • I/O Ports: Programs configure video timing, memory plane access, and color registers by writing directly to hardware ports (e.g., 0x3C0 through 0x3DA on standard VGA chips).

MS-DOS makes no attempt to trap, audit, or restrict these I/O writes or memory stores.

Role of DOS Services and ANSI.SYS

MS-DOS provides its own high-level character output facilities via Interrupt 21h (such as function 02h to write a character or function 09h to write a string). These DOS-level calls are designed solely for stream-oriented console output and depend heavily on the underlying active video mode set by the BIOS.

If an application requires basic terminal-based control over text attributes and cursor positions via standard DOS calls, the ANSI.SYS device driver can be loaded in CONFIG.SYS. ANSI.SYS intercepts character output, parses ANSI escape sequences, and translates them internally into corresponding INT 10h BIOS calls. However, ANSI.SYS is an optional presentation helper, not an access-control mechanism.

VESA BIOS Extensions (VBE)

For Super VGA (SVGA) modes exceeding standard VGA capabilities (such as 640x480 at 256 colors, or 800x600 and 1024x768 resolutions), MS-DOS 6.22 relies on the VESA BIOS Extension standard.

Applications access VBE services through INT 10h, using function code 4Fh in the AX register:

  • AX = 4F00h: Return Super VGA Information.
  • AX = 4F01h: Return Super VGA Mode Information.
  • AX = 4F02h: Set Super VGA Video Mode (with the mode number passed in register BX).

These functions are either natively implemented in the video card's video ROM or provided via a vendor-supplied Terminate-and-Stay-Resident (TSR) driver loaded into memory. MS-DOS treats the VESA interface identically to standard BIOS services, allowing the program to communicate directly with the VBE driver without interference.