25 Jun 1995
Before the user loads any operating system, the PC itself performs the Power On Self Test, determines the available devices, and searches for a bootable disk. These functions are performed by a set of instructions built into the machine in Read-Only Memory (ROM). In that sense, there is no such thing as a completely bare PC, because there is always some kind of system software in control.
Traditionally, Read-Only Memory was based on a chip programmed at the factory. ROM upgrades were performed by physically replacing the chip. Vendors now seem to be moving to Flash Memory, a type of "non-volatile" memory that can be rewritten by the computer using a special utility.
The original IBM PC was based on the Intel 8088 CPU chip. It supported a maximum of one megabyte of memory. Since previous generations of personal computers typically had between 4K and 32K of memory, and most mainframe computers of the period had only a few megabytes of memory, this was regarded as an enormous memory range.
One common feature of the previous personal computers was to connect the display adapter logic to the computer memory. The content of the screen appeared to the application program as an area of storage. Instead of writing to the screen as a device, the program could simply move some data to the buffer location and the data would appear on the display. To duplicate this, IBM would have to give up some part of the megabyte of addresses to I/O devices.
Since one megabyte seemed to be so much larger than was necessary, IBM provided a more general solution by carving three areas of 128K each from the top of the address range. This left 640K for user programs, or ten times the amount of memory that would be supported on the mainboard of the first PC.
Immediately beyond the user area, the first 128K system area is used to communicate with the display adapter. The use of this area is fairly standard for "VGA" mode (25x80 characters or 640x480 dots in 16 colors). All display adapters support VGA mode, and all operating systems start up in this mode. To support Super VGA (higher resolution, less flicker, more colors, or faster speed) the programming is different for each display adapter by vendor and model. Windows, OS/2, or Unix must load a specific driver for the particular adapter card to run efficiently or use a higher resolution.
The 128K area just below the one megabyte boundary was reserved for the ROM instructions. The first PC used only the top 64K, but many modern machines use the entire area. This system ROM includes the Power On Self Test instructions, the Basic I/O Support (BIOS), and at one time it included a copy of Microsoft Basic. ROM memory chips are relatively slow, so modern 486 computers copy the ROM instructions into 128K of standard RAM (though the mainboard then "locks" this area so it cannot be changed by normal programs).
The middle 128K is mapped to the I/O bus. Adapter cards plugged into the machine can supply their own initialization or support code in Read Only Memory that appears in this address range. A display adapter will provide initialization code to activate the display and set the correct video modes. A SCSI adapter will supply initialization code to install hard drives (including the boot disk if there are no other disks present). Any part of this area that is not used by devices can be turned by modern versions of DOS into Upper Memory Blocks to hold device drivers and other support routines.
Modern computers have more than one megabyte of memory, but they must accommodate the original PC architecture by supplying 640K of program memory, then skip over the three 128K hardware areas, and begin again with program memory above the first megabyte. This fragmentation of memory between the 640K and 1024K addresses is possibly the most important architectural difference between a PC and any other computer system.
Before loading the operating system, the initialization routine in ROM prepares the machine to run DOS. In 1980, IBM and Microsoft worked out a common set of rules that tied the ROM and DOS together. There are several DOS tables that are filled in by the ROM programming before DOS starts. Other operating systems (OS/2, NT) don't actually use the same tables, but they may use the values initially stored there to discover information about installed devices.
After the power up tests have been run and the system is loaded, the ROM remains important because it contains the Basic I/O Support (BIOS). BIOS provides a set of routines that the operating system or application programs can call to manipulate the display, keyboard, hard disk, diskette, COM port, or printer.
During the development of the first PC, IBM struck a deal with Microsoft. The direct management of adapter cards would be handled by programs that IBM supplied with the ROM of the computer. DOS would be written to use these services. This way, if IBM decided to change the hardware, it could ship newer models with changes in the BIOS and would not require Microsoft to change the operating system.
Like all strategies to manage change, this has not turned out to be a big success. DOS still had to be changed to support different keyboard layouts, 3 1/2 inch diskettes, and other hardware changes. On the other hand, it has generally been simpler for new generations of hardware to simply emulate older adapters rather than to force a change in the BIOS. For example, all hard disk controllers used today on PCs have the ability to emulate the ST506 card, which IBM shipped in its first XT computer. Emulation avoids changes in the BIOS.
BIOS calls can be trapped before they get to the ROM. They can be trapped by ROM on other adapter cards, by device drivers, and by other resident routines. The BIOS call is important as an interface and a part of subsequent system design.
The BIOS was designed with two limitations that will effect every other system that uses it (in particular, DOS and Windows 3.1):
Buffers in first 640K -- The standard system BIOS and (even worse) the ROM extensions supplied by adapter cards in the middle 128K system address area, support only real addresses within the first megabyte of RAM. To be accurate, most devices receive data directly from the CPU, so most BIOS routines do not depend on the physical RAM location of data. However, some devices use more efficient techniques, forms of Direct Memory Access (DMA or Busmaster). Other devices (particularly the LAN adapters) expect to generate an interrupt and then receive data from an interrupt handler. In either case, use of the standard BIOS programming may depend on the data buffers residing in buffers in the 640K user area. While DOS and Windows programs can use a variety of creative memory extension techniques to use the other megabytes of memory present on the machine, I/O generally involves shuffling the user data between higher memory addresses and preallocated buffers somewhere down in the 640K area. Moving data adds great overhead to the system.
Synchronous I/O -- A program wants to read a record from disk. The BIOS sends the request to the disk adapter, then goes into a loop. "Is it done yet? No. Is it done yet? No. Is it ..." After 15 to 30 milliseconds the answer finally comes back "Yes" and the computer can go back to doing useful work. This is not a big problem for the desktop word processing user, but it is a fatal limit for a file or database server. Servers must be able to get other work done while the disk is finding a record. Even more importantly, when a server has several disks it must be able to keep all of them busy at once. This is why departmental servers must be based on some type of advanced system (OS/2, NT, Unix, or Netware) that does not use the BIOS. Note that Novell Netware captured the dominant market share for PC servers by delivering a multitasking, BIOS-avoiding specialized operating system for PC's powered by a 286 chip when MS and IBM had only DOS-based servers.
Copyright 1995 PCLT -- Surviving the Next Operating System -- H. Gilbert