Product specifications
for a boot program to be relocatable. DL contains the drive number, as used with INT 13h, of the boot
device, unless the BIOS is one that does not set the drive number in DL – and then DL is undefined.
SS:SP points to a valid stack that is presumably large enough to support hardware interrupts, but
otherwise SS and SP are undefined. (A stack must be already set up in order for interrupts to be
serviced, and interrupts must be enabled in order for the system timer-tick interrupt, which BIOS
always uses at least to maintain the time-of-day count and which it initializes during POST, to be
active and for the keyboard to work. The keyboard works even if the BIOS keyboard service is not
called; keystrokes are received and placed in the 15-character type-ahead buffer maintained by BIOS.)
The boot program must set up its own stack (or at least MS-DOS 6 acts like it must), because the size
of the stack set up by BIOS is unknown and its location is likewise variable; although the boot
program can investigate the default stack by examining SS:SP, it is easier and shorter to just
unconditionally set up a new stack.
At boot time, all BIOS services are available, and the memory below address 0x00400 contains the
interrupt vector table. BIOS POST has initialized the system timers (8253 or 8254 IC), interrupt
controller(s), DMA controller(s), and other motherboard/chipset hardware as necessary to bring all
BIOS services to ready status. DRAM refresh for all system DRAM in conventional memory and
extended memory, but not necessarily expanded memory, has been set up and is running. The interrupt
vectors corresponding to the BIOS interrupts have been set to point at the appropriate entry points in
the BIOS, hardware interrupt vectors for devices initialized by the BIOS have been set to point to the
BIOS-provided ISRs, and some other interrupts, including ones that BIOS generates for programs to
hook, have been set to a default dummy ISR that immediately returns. The BIOS maintains a reserved
block of system RAM at addresses 0x00400–0x004FF with various parameters initialized during the
POST. All memory at and above address 0x00500 can be used by the boot program; it may even
overwrite itself.
Extensions
In the IBM PC and AT, peripheral cards such as some hard-drive controllers and some video display
adapters have their own BIOS extension option ROMs, which provide additional functionality to
BIOS. Code in these extensions runs before the BIOS boots the system from mass storage. These
ROMs typically test and initialize hardware, add new BIOS services, and augment or replace existing
BIOS services with their own versions of those services. For example, a SCSI controller usually has a
BIOS extension ROM that adds support for hard drives connected through that controller. Some video
cards have extension ROMs that replace the video services of the motherboard BIOS with their own
video services. BIOS extension ROMs gain total control of the machine, so they can in fact do
anything, and they may never return control to the BIOS that invoked them. An extension ROM could
in principle contain an entire operating system or an application program, or it could implement an
entirely different boot process such as booting from a network. Operation of an IBM-compatible
computer system can be completely changed by removing or inserting an adapter card (or a ROM
chip) that contains a BIOS extension ROM.
The motherboard BIOS typically contains code to access hardware components necessary for
bootstrapping the system, such as the keyboard, display, and storage. In addition, plug-in adapter cards
such as SCSI, RAID, network interface cards, and video boards often include their own BIOS (e.g.
Video BIOS), complementing or replacing the system BIOS code for the given component. Even
devices built into the motherboard can behave in this way; their option ROMs can be stored as separate
code on the main BIOS flash chip, and upgraded either in tandem with, or separately from, the main
BIOS.