System BIOS
BIOS stands for Basic Input/Output System, although the full term is used very infrequently. The system BIOS is the lowest-level software in the computer; it acts as an interface between the hardware (especially the chipset and processor) and the operating system. The BIOS provides access to the system hardware and enables the creation of the higher-level operating systems (DOS, Windows 95, etc.) that you use to run your applications. The BIOS is also responsible for allowing you to control your computer's hardware settings, for booting up the machine when you turn on the power or hit the reset button, and various other system functions.
BIOS's other main responsibilities include booting the system, and providing the BIOS setup program that allows you to change BIOS parameters.
The BIOS Program
In order for any computer to function, it must have software to run on it. All that a processor--or any hardware for that matter--knows how to do is to follow instructions. The software is that collection of instructions. All regular programs that you run on your PC are stored permanently on your hard disk, and are loaded into your system memory (RAM) when you need to use them. From the memory, the processor can access the instructions coded into the program and run them, which lets you do your work.
When you first turn on your PC, the processor is "raring to go", but it needs some instructions to execute. However, since you just turned on the machine, your system memory is empty; there are no programs to run. To make sure that the BIOS program is always available to the processor, even when it is first turned on, it is "hard-wired" into a read-only-memory (ROM) chip that is placed on your motherboard.
A uniform standard was created between the makers of processors and the makers of BIOS programs, so that the processor would always look in the same place in memory to find the start of the BIOS program. The processor gets its first instructions from this location, and the BIOS program begins executing. The BIOS program then begins the system boot sequence which calls other programs, gets your operating system loaded, and your PC up and running.
The BIOS program is always located in a special reserved memory area, the upper 64K of the first megabyte of system memory (addresses F000h to FFFFh). Some BIOSes use more than this 64K area.
Other PC BIOSes
Although most people don't realize it, there are in fact several different BIOSes in your PC. When people say "the BIOS" they are of course referring to the main system BIOS. However there are also BIOSes to control peripherals that you put into your machine. Your video card has its own BIOS (in most cases) that contains hardware-driving instructions for displaying video information. Hard disks and other peripherals can contain their own BIOS instructions as well. Many SCSI host adapters for example have their own BIOS.
The BIOS and the Software Layer Model
As mentioned in many other places, one of the key factors in the success of the PC platform is the combination of a huge choice of hardware and software options, and at the same time compatibility between many different types of hardware and software. Backwards compatibility is particularly key; nobody wants to have to throw out their old software when hardware changes, and companies that have tried to ignore this have often suffered the consequences (e.g., the MCA bus).
Have you ever marveled at how most of the applications that ran on your AT-class machine in 1985 will still run on your Pentium today? This, despite radically different processors, system buses, memory, in fact, all the hardware is different, and the operating system is as well. I personally have many applications that I run still today that are 12 years old or more. How is this possible?
The key to this universality is the use of multiple software layers. Let's consider the use of a program like Microsoft Word 6.0, running on Windows 3.x. In a simplified view, when you run this application, you are actually employing four main software layers: Word 6.0 is the application; it runs on Windows; Windows runs on top of DOS and DOS runs on top of the system BIOS. The BIOS interfaces with the hardware. This table shows the various layers, from lowest to highest. The operating system and application can (and often are) composed themselves of multiple layers:
Layer # / Layer0 / Hardware
1 / System BIOS
2 / Operating System
3 / Application
Each of these layers contributes to compatibility in an essential way: it talks to the level below it using a standard interface. In order for Word 6.0 to work in Windows, it must follow certain rules set forth by the designers of Windows. Windows must follow rules set forth by the creators of DOS. And DOS must use a standardized way of talking to the system BIOS.
Each layer provides an abstraction modelto the software that runs on it, by providing to the layer above it a set of services and functions that the layer above it can use. Word 6.0 doesn't worry about the hardware or DOS much at all; it simply calls Windows functions and lets Windows worry about DOS. Windows talks to DOS using DOS functions, etc.
By using these standards, it makes it possible to mix and match various layers, as long as the programmers follow the rules. If you want to update your DOS version, Windows will still work as long as the new DOS version provides the same standard interface that the old one did; it can provide new functions, but not take away any of the old ones. Similarly, Word 6.0 will work on Windows 95 because Windows 95 provides the same facilities to Word that Windows 3.x did. This is how compatibility is maintained across changes to operating systems.
What does all this have to do with the BIOS? :^) The BIOS is actually the pillar that supports all of this, because it provides the standard interface that DOS uses (or whatever the operating system is). The system hardware itself is the "mess at the bottom of the pile" that we are trying to have to avoid dealing with. In some ways, the most amazing part of all of this is that DOS itself will run on so many different machines. The BIOS is what makes this possible. Instead of DOS having to talk directly to the hardware, of which there are many, many possibilities. It talks to the BIOS, which is what is customized to the hardware.The BIOS hides the hardware from the operating system so it doesn't have to worry about it, by providing standardized services to the operating system.
As alluded to above, programs do not always have to follow this model exactly. It is possible for a DOS program to bypass DOS and the BIOS functions, and interface directly with the hardware. This is done normally for performance reasons; games do it most often. The problem is that this breaks the compatibility model; now the software does have to figure out what hardware it is using, and this makes these types of programs much less portable and compatible than ones that "play by the rules".
BIOS Services and Software Interrupts
The BIOS provides various software routines (subprograms) that can be called by higher-level software such as DOS, Windows, or their applications, to perform different tasks. Virtually every task that involves accessing the system hardware has traditionally been controlled using one or more of the BIOS programs (although many newer operating systems now bypass the BIOS for improved performance). This includes actions like reading and writing from the hard disk, processing information received from devices, etc.
BIOS services are accessed using software interrupts, which are similar to the hardware interrupts except that they are generated inside the processor by programs instead of being generated outside the processor by hardware devices. One thing that this use of interrupts does is to allow access to the BIOS without knowing where in memory each routine is located.
Normally, to call a software routine you need to know its address. With interrupts, a table called an interrupt vector table is used that bypasses this problem. When the system is started up, the BIOS puts addresses into this table that represent where its routines are located for each interrupt it responds to. Then, when DOS or an application wants to use a BIOS routine, it generates a software interrupt. The system processes the interrupt, looks up the value in the table, and jumps to the BIOS routine automatically. DOS itself and application programs can also use this interrupt vector table.
The BIOS ROM
The main hardware component of the system BIOS is the system BIOS ROM itself. This is normally located in an electrically-erasable read-only memory (EEPROM) chip, which allows it to be updated through software control. This is commonly called a flash BIOS.
The BIOS ROM is located in a socket on the motherboard and is relatively easy to locate because it is usually labelled with the name of the BIOS manufacturer. Most times this is Award, American Megatrends (AMI) or Phoenix. There is also often a version number on the chip, although the actual BIOS version within the chip may be different from what is labelled, because of the ability to flash the BIOS mentioned above.
Under normal circumstances, the BIOS ROM is permanent and there is normally no reason to need to deal with it in any way. If for some reason the BIOS ROM were to become corrupted due to an aborted flash update, for example, you might find your PC left in a state where it could not be booted. In this situation, you might have to physically replace the BIOS ROM, but this is a very rare happening.
BIOS CMOS Memory
The BIOS settings that you use to control how your PC works must be saved in non-volatile memory so that they are preserved even when the machine is off. This is as opposed to regular system memory, which is cleared each time you turn off the PC. A special type of memory is used to store this information, called CMOS memory, and a very small battery is used to trickle a small charge to it to make sure that the data it holds is always preserved. These memories are very small, typically 64 bytes, and the batteries that they use typically last for years. This non-volatile memory is sometimes called NVRAM.
CMOS stands for "Complementary Metal Oxide Semiconductor". This is one type of technology used to make semiconductors (integrated circuits) such as processors, chipset chips, DRAM, etc. CMOS has the advantage of requiring very little power, compared to some other semiconductor technologies. This is why it was chosen for this use, so that the amount of power required from the battery would be minimal, and the battery would be able to last a long time. This memory came to be called just "CMOS" since in the early days most parts of the computer did not use CMOS. Ironically, with today's processors having to do more and more and needing to do it with lower power consumption, they themselves are typically made entirely with CMOS technology. However, "CMOS" by itself usually still refers to the BIOS settings memory. Old habits die hard in the computer world.
The system uses something called a CMOS checksum as an error-detecting code. Each time you change the BIOS settings, the checksum is generated by adding together all the bytes in the CMOS memory and then storing the lowest byte of the sum. Then, each time the system booted, the system recomputes the checksum and compares it to the stored value. If they are different, then the system knows that the CMOS has been corrupted somehow and will warn you with an error, typically something like "CMOS Checksum Error".
There are many different types of batteries used to power the CMOS; mostly, these have changed over time as technology has evolved. You will not normally have to deal with the CMOS memory directly; it holds the settings you enter in the BIOS setup program. Over time, it is possible you will have CMOS problems; for example, you may find that the machine may begin to forget its settings when it is booted. These are usually signs of trouble with the motherboard battery.
In addition to the standard CMOS memory used to hold system settings, Plug and Play BIOSes use an additional non-volatile memory to hold extended system configuration data (ESCD). This is used to record the resource configurations of system devices when Plug and Play is used.
Hard Disk BIOS and Capacity Factors
The operation of your hard disk drives is controlled by the interface from the system to the hard disk itself. This interface is the conduit for addressing instructions and commands, sent to the hard disk to select what data is requested, and then a conduit for the data itself, flowing to and from the system. The system BIOS plays a role in the operation of the hard disk, as it provides the standard software routines that allow applications and operating systems such as DOS to access the hard disk. It is also the cause of many configuration and capacity limitation problems that many users have when setting up their hard disks, especially newer ones on older systems.
This section takes a look at issues related to how the BIOS and operating system interact with the hard disk, and BIOS-related issues and problems. This includes a full look at the many capacity limitations inherent in using IDE/ATA interface drives, and other BIOS restrictions on hard disk capacity. Many of the items in this section are really of relevance only to IDE/ATA drives; SCSI drives use their own BIOS and a different addressing mechanism from IDE/ATA, and so suffer from fewer of these problems. However, some BIOS issues affect SCSI as well, because of problems associated with operating system limitations.