In computing, BIOS is an acronym that stands either for the Basic Input/Output System or for Built In Operating System. The latter term dates from the late 1970s and early 1980s when the PCs of the day normally contained a comprehensive operating system in their ROMs. The latter acronym is still much used in conjunction with gadgetry containing dedicated computers, such as modern cameras, white-wear[when defined as?], etc. The underlying technology is very similar, being little more than a matter of complexity.
BIOS refers, in part, to the firmware code (a type of boot loader) run by a PC when first powered on. The primary function of the BIOS is to identify and initialize system component hardware (such as the video display card, hard disk, and floppy disk) and some other hardware devices. This is to prepare the machine into a known low capability state, so other software programs stored on various media can be loaded, executed, and given control of the PC. This process is known as booting, or booting up, which is short for bootstrapping.
The BIOSes of IBM PC class machines are coded programs embedded on a chip that recognize and control various devices that make up x86 personal computers, and provide a small library of basic Input/Output functions that can be called to operate and control the peripherals such as the keyboard, primitive (800 x 600) display functions and so forth.Computers designed to run Windows ME or Windows 2000, or later, supersede this basic monitor functionality by taking over direct control of the interrupt table and replacing the monitor routines with faster and more robust low-level modules that, unlike the BIOS function set, are re-entrant. Various BIOS functions in ROM were left in control in earlier Windows versions, and the BIOS only comes into play today in the alternate shell Cmd.exe, or if the machine is booted into a legacy DOS version.
The term first appeared in the CP/M operating system, describing the part of CP/M loaded during boot time that interfaced directly with the hardware (CP/M machines usually had a simple boot loader in ROM, and nothing else). Most versions of DOS have a file called "IBMBIO.COM" or "IO.SYS" that is analogous to the CP/M disk BIOS. The term was also known as Binary Input/Output System and Basic Integrated Operating System.
Among other classes of computers, the generic terms boot monitor, boot loader or boot ROM were commonly used. Some Sun and Macintosh PowerPC computers used Open Firmware for this purpose. There are a few alternatives for Legacy BIOS in the x86 world: Extensible Firmware Interface, Open Firmware (used on the OLPC XO-1) and coreboot.
The BIOS Chip history
Prior to the early 1990s, BIOSes were stored in ROM or PROM chips, which could not be altered by users. As its complexity and need for updates grew, and re-programmable parts became more available, BIOS firmware was most commonly stored on EEPROM or flash memory devices. According to Robert Braver, the president of the BIOS manufacturer Micro Firmware, Flash BIOS chips became common around 1995 because the electrically erasable PROM (EEPROM) chips are cheaper and easier to program than standard erasable PROM (EPROM) chips. PROM chips may be erased by prolonged exposure to ultraviolet light, which accessed the chip via the window. Chip manufacturers use PROM blasters to reprogram EPROM chips. EEPROM chips come with the additional feature of allowing a BIOS reprogramming via higher-than-normal amounts of voltage. BIOS versions are upgraded to take advantage of newer versions of hardware and to correct bugs in previous revisions of BIOSes.
The first flash chips attached to the ISA bus. Starting in 1997, the BIOS flash moved to the LPC bus, a functional replacement for ISA, following a new standard implementation known as "firmware hub" (FWH). Most BIOS revisions created in 1995 and nearly all BIOS revisions in 1997 supported the year 2000. In 2006, the first systems supporting a Serial Peripheral Interface (SPI) appeared, and the BIOS flash moved again.
The size of the BIOS, and the capacities of the ROM, EEPROM and other media it may be stored on, has increased over time as new features have been added to the code; BIOS versions now exist with sizes up to 8 megabytes. Some modern motherboards are including even bigger NAND Flash ROM ICs on board which are capable of storing whole compact operating system distribution like some Linux distributions. For example, some recent ASUS motherboards including SplashTop Linux embedded into their NAND Flash ROM ICs.
BIOS chip vulnerabilities
EEPROM chips are advantageous because they can be easily updated by the user; hardware manufacturers frequently issue BIOS updates to upgrade their products, improve compatibility and remove bugs. However, this advantage had the risk that an improperly executed or aborted BIOS update could render the computer or device unusable. To avoid these situations, more recent BIOSes use a "boot block"; a portion of the BIOS which runs first and must be updated separately. This code verifies if the rest of the BIOS is intact (using hash checksums or other methods) before transferring control to it. If the boot block detects any corruption in the main BIOS, it will typically warn the user that a recovery process must be initiated by booting from removable media (floppy, CD or USB memory) so the user can try flashing the BIOS again. Some motherboards have a backup BIOS (sometimes referred to as DualBIOS boards) to recover from BIOS corruptions. In 2007, Gigabyte began offering motherboards with a QuadBIOS recovery feature.
There was at least one virus which was able to erase Flash ROM BIOS content, rendering computer systems unusable.[[CIH], also known as "Chernobyl Virus", affected systems BIOS and often they could not be fixed on their own since they were no longer able to boot at all. To repair this, Flash ROM IC had to be ejected from the motherboard to be reprogrammed somewhere else. Damage from the CIH virus was possible since most motherboards at the time of CIH<d propagation used the same chip set, Intel TX, and most common operating systems such as Windows 95 allowed direct hardware access to all programs.
Modern systems are not vulnerable to CIH because of numerous and different chip sets used which are incompatible with the Intel TX chip set, another Flash ROM IC types, there is also extra protections from accidental BIOS rewrites and either boot blocks which are protected from accidental overwrite even more or dual BIOS used so in case of crash, second BIOS getting used. Also all modern operating systems like Windows XP, Windows Vista, Linux just do not allow direct hardware access to usual non-privileged programs. So, as of year 2008 CIH became almost harmless and at very most just bothers users by infecting executable files without being able to cause any real harm and only toggling numerous virus alerts from antivirus software.
Firmware on adapter cards
A computer system can contain several BIOS firmware chips. The motherboard BIOS typically contains code to access fundamental hardware components such as the keyboard, floppy drives, ATA (IDE) hard disk controllers, USB human interface devices, and storage devices. In addition, plug-in adapter cards such as SCSI, RAID, Network interface cards, and video boards often include their own BIOS, complementing or replacing the system BIOS code for the given component.
In some devices that can be used by add-in adapters and actually directly integrated on the motherboard, the add-in ROM may also be stored as separate code on the main BIOS flash chip. It may then be possible to upgrade this "add-in" BIOS (sometimes called an option ROM) separately from the main BIOS code.
Add-in cards usually only require such an add-in BIOS if they:
PC operating systems such as DOS, including all DOS-based versions of MS Windows, as well as bootloaders, may continue to make use of the BIOS to handle input and output. However, other modern operating systems will interact with hardware devices directly by using their own device drivers to directly access the hardware. Occasionally these add-in BIOSs are still called by these operating systems, in order to carry out specific tasks such as preliminary device initialization.
To find these memory mapped expansion ROMs during the boot process, PC BIOS implementations scan real memory from
0xF0000 on 2 kibibyte boundaries looking for the ROM signature bytes of 55h followed by AAh (
0xAA55). For a valid expansion ROM, its signature is immediately followed by a single byte indicating the number of 512-byte blocks it occupies in real memory. The BIOS then jumps to the offset located immediately after this size byte; at which point the expansion ROM code takes over, using the BIOS services to register interrupt vectors for use by post-boot applications and provide a user configuration interface, or display diagnostic information.
There are many methods and utilities for dumping the contents of various motherboard BIOS and expansion ROMs. Under a Microsoft OS, DEBUG can be used to examine 64 KiB segments of memory and save the contents to a file. For UNIX systems the dd command can be used by a user with root privileges: "dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8".
The BIOS boot specification
If the expansion ROM wishes to change the way the system boots (such as from a network device or a SCSI adapter for which the BIOS has no driver code), it can use the BIOS Boot Specification (BBS) API to register its ability to do so. Once the expansion ROMs have registered using the BBS APIs, the user can select among the available boot options from within the BIOSes user interface. This is why most BBS compliant PC BIOS implementations will not allow the user to enter the BIOS's user interface until the expansion ROMs have finished executing and registering themselves with the BBS API.
Changing role of the BIOS
Some operating systems, for example MS-DOS, rely on the BIOS to carry out most input/output tasks within the PC. A variety of technical reasons makes it inefficient for some recent operating systems written for 32-bit CPUs such as Linux and Microsoft Windows to invoke the BIOS directly. Larger, more powerful, servers and workstations using PowerPC or SPARC CPUs by several manufacturers developed a platform-independent Open Firmware (IEEE-1275), based on the Forth programming language. It is included with Sun's SPARC computers, IBM's RS/6000 line, and other PowerPC CHRP motherboards. Later x86-based personal computer operating systems, like Windows NT, use their own, native drivers which also makes it much easier to extend support to new hardware, while the BIOS still relies on a legacy 16-bit runtime interface. As such, the BIOS was relegated to bootstrapping, at which point the operating system's own drivers can take control of the hardware.
There was a similar transition for the Apple Macintosh, where the system software originally relied heavily on the ToolBox—a set of drivers and other useful routines stored in ROM based on Motorola's 680x0 CPUs. These Apple ROMs were replaced by Open Firmware in the PowerPC Macintosh, then EFI in Intel Macintosh computers.
Later BIOS took on more complex functions, by way of interfaces such as ACPI; these functions include power management, hot swapping and thermal management. However BIOS limitations (16-bit processor mode, only 1 MiB addressable space, PC AT hardware dependencies, etc.) were seen as clearly unacceptable for the newer computer platforms. Extensible Firmware Interface (EFI) is a specification which replaces the runtime interface of the legacy BIOS. Initially written for the Itanium architecture, EFI is now available for x86 and x86-64 platforms; the specification development is driven by The Unified EFI Forum, an industry Special Interest Group.
Linux has supported EFI via the elilo boot loader. The Open Source community increased their effort to develop a replacement for proprietary BIOSes and their future incarnations with an open sourced counterpart through the coreboot and OpenBIOS/Open Firmware projects. AMD provided product specifications for some chipsets, and Google is sponsoring the project. Motherboard manufacturer Tyan offers coreboot next to the standard BIOS with their Opteron line of motherboards. MSI and Gigabyte have followed suit with the MSI K9ND MS-9282 and MSI K9SD MS-9185 resp. the M57SLI-S4 models.
The BIOS business
The vast majority of PC motherboard suppliers license a BIOS "core" and toolkit from a commercial third-party, known as an "independent BIOS vendor" or IBV. The motherboard manufacturer then customizes this BIOS to suit its own hardware. For this reason, updated BIOSes are normally obtained directly from the motherboard manufacturer.
Major BIOS vendors include American Megatrends (AMI), Insyde Software, Phoenix Technologies (which bought Award Software International in 1998 and General Software in 2008) and Byosoft (which is a Chinese firmware company located at Nanjing, China).
ESCD or Extended System Configuration Data is a part of nonvolatile BIOS memory (aka CMOS memory) on the motherboard of a personal computer, where information about ISA PnP devices is stored. It's used by the BIOS to allocate resources for devices like expansion cards.
The BIOS also updates the ESCD each time the hardware configuration changes, after deciding how to re-allocate resources like IRQ and memory mapping ranges. After the ESCD has been updated, the decision need not be made again, which thereafter results in faster startup without conflicts until the next hardware configuration change.
========================================================================================Non-volatile BIOS memory refers to the memory on a personal computer motherboard containing BIOS settings and sometimes the code used to initialize the computer and load the operating system. The non-volatile memory was historically called CMOS RAM or just CMOS because it traditionally used a low-power CMOS memory chip (the Motorola MC146818, or one of its higher-capacity clones), which was powered by a small battery when the system power was off. The term remains in wide use in this context, but has also grown into a misnomer. The non-volatile BIOS storage in contemporary computers might be in an EEPROM or flash memory chip and not in a volatile CMOS RAM. In these cases, the battery back-up is meant to keep the RTC chip synchronized. The NVRAM normally has a storage capacity of 512 Bytes, which is enough for all BIOS-settings.
CMOS mismatch errors typically occur if the computer's power-on self-test program:
The memory and real-time clock are generally powered by a CR2032 lithium coin cell. These cells last two to ten years, depending on the type of motherboard, ambient temperature and the time that the system is powered off, while other common cell types can last significantly longer or shorter periods, such as the CR2016 which will generally last about 40% as long. Higher temperatures and longer power-off time will shorten cell life. When replacing the cell, the system time and CMOS BIOS settings may revert to default values. This may be avoided by replacing the cell with the power supply master switch on. On ATX motherboards, this will supply 5V standby power to the motherboard even if it is apparently "switched off", and keep the CMOS memory energized.
Resetting the CMOS settings
To access the BIOS setup when the machine fails to operate, occasionally a drastic move is required. In older computers with battery-backed RAM, removal of the battery and short circuiting the battery input terminals for a while did the job; in some more modern machines this move only resets the RTC. Some motherboards offer a CMOS-reset jumper or a reset button. In yet other cases, the EEPROM chip has to be desoldered and the data in it manually edited using a programmer. Sometimes it is enough to ground the CLK or DTA line of the I?C bus of the EEPROM at the right moment during boot, this requires some precise soldering on SMD parts. If the machine lets you boot but does not want to let you into the BIOS setup, one possible recovery is to deliberately "damage" the CMOS checksum by doing direct port writes using debug.exe, corrupting some bytes of the checksum-protected area of the CMOS RAM; at the next boot, the computer typically resets its setting to factory defaults.
On power up, the main duties of POST are handled by the BIOS, which may hand some of these duties to other programs designed to initialize very specific peripheral devices, notably for video and SCSI initialization. These other duty-specific programs are generally known collectively as option ROMs or individually as the video BIOS, SCSI BIOS, etc.
The principal duties of the main BIOS during POST are as follows:
The BIOS will begin its POST duties when the CPU is reset. The first memory location the CPU tries to execute is known as the reset vector. In the case of a hard reboot, the northbridge will direct this code fetch (request) to the BIOS located on the system flash memory. For a warm boot, the BIOS will be located in the proper place in RAM and the northbridge will direct the reset vector call to the RAM.
During the POST flow of a contemporary BIOS, one of the first things a BIOS should do is determine the reason it is executing. For a cold boot, for example, it may need to execute all of its functionality. If, however, the system supports power savings or quick boot methods, the BIOS may be able to circumvent the standard POST device discovery, and simply program the devices from a preloaded system device table.
The POST flow for the PC has developed from a very simple, straightforward process to one that is complex and convoluted. During POST, the BIOS must integrate a plethora of competing, evolving, and even mutually exclusive standards and initiatives for the matrix of hardware and OSes the PC is expected to support. However, the average user still knows the POST and BIOS only through its simple visible memory tests and setup screen.
The original IBM BIOS reported errors detected during POST by outputting a number to a fixed I/O port address, 80. Using a logic analyzer or a dedicated POST card, an interface card that shows port 80 output on a small display, a technician could determine the origin of the problem. (Note that once an operating system is running on the computer, the code displayed by such a board is often meaningless, since some OSes, e.g. Linux, use port 80 for I/O timing operations.) In later years, BIOS vendors used a sequence of beeps from the motherboard-attached loudspeaker to signal error codes.
BIOS Interrupt Calls are a facility that DOS programs, and some other software such as boot loaders, use to invoke the BIOS's facilities. Some operating systems also use the BIOS to probe and initialise hardware resources during their early stages of booting.
|INT 00h--||CPU: Executed after an attempt to divide by zero or when the quotient does not fit in the destination|
|INT 01h||CPU: Executed after every instruction while the trace flag is set|
|INT 02h||CPU: NMI, used e.g. by POST for memory errors|
|INT 03h||CPU: The lowest non-reserved interrupt, it is used exclusively for debugging, and the INT 03 handler is always implemented by a debugging program|
|INT 04h||CPU: Numeric Overflow. Usually caused by the INTO instruction when the overflow flag is set.|
|INT 05h||Executed when Shift-PrintScreen is pressed, as well as when the BOUND instruction detects a bound failure.|
|INT 06h||CPU: Called when the Undefined Opcode (invalid instruction) exception occurs. Usually installed by the operating system.|
|INT 07h||CPU: Called when an attempt was made to execute a floating-point instruction and no numeric coprocessor was available.|
|INT 08h||IRQ0: Implemented by the system timing component; called 18.2 times per second (once every 55 ms) by the PIC|
|INT 09h||IRQ1: Called after every key press and release (as well as during the time when a key is being held)|
|INT 0Bh||IRQ3: Called by serial ports 2 and 4 (COM2/4) when in need of attention|
|INT 0Ch||IRQ4: Called by serial ports 1 and 3 (COM1/3) when in need of attention|
|INT 0Dh||IRQ5: Called by hard disk controller (PC/XT) or 2nd parallel port LPT2 (AT) when in need of attention|
|INT 0Eh||IRQ6: Called by floppy disk controller when in need of attention|
|INT 0Fh||IRQ7: Called by 1st parallel port LPT1 (printer) when in need of attention|
|INT 10h||Video Services - installed by the BIOS or operating system; called by software programs |
|INT 11h||Installed by the BIOS; returns equipment list|
|INT 12h||Installed by the BIOS or operating system; returns Conventional Memory Size|
|INT 13h||Low Level Disk Services; installed by the BIOS or operating system; called by software programs |
|INT 14h||Routines for communicating via the serial port. Used by software programs. |
|INT 15h||Miscellaneous (System services support routines) |
|INT 16h||Implemented by the BIOS or operating system. Provides routines to be called by software programs which communicate with the keyboard. |
|INT 17h||Print Services - used by software programs to communicate with the printer |
|INT 18h||Execute Cassette BASIC: True IBM computers contain BASIC in the ROM to be interpreted and executed by this routine in the event of a boot failure (called by the BIOS)|
|INT 19h||After POST this interrupt is used by BIOS to load the operating system.|
|INT 1Ah||Real Time Clock Services - called by software programs to communicate with the RTC |
|INT 1Bh||Installed by the operating system; automatically called by INT 9 when Ctrl-Break has been pressed|
|INT 1Ch||Called automatically by INT 08; available for use by software programs when a routine needs to be executed regularly|
|INT 1Dh||Not to be called; simply a pointer to the VPT (Video Parameter Table), which contains data on video modes|
|INT 1Eh||Not to be called; simply a pointer to the DPT (Diskette Parameter Table), containing a variety of information concerning the diskette drives|
|INT 1Fh||Not to be called; simply a pointer to the VGCT (Video Graphics Character Table), which contains the data for ASCII characters 80h to FFh|
|INT 41h||Address pointer: FDPT = Fixed Disk Parameter Table (1st hard drive)|
|INT 46h||Address pointer: FDPT = Fixed Disk Parameter Table (2nd hard drive)|
|INT 4Ah||Called by RTC for alarm|
|INT 70h||IRQ8: Called by RTC|
|INT 74h||IRQ12: Called by mouse|
|INT 75h||IRQ13: Called by math coprocessor|
|INT 76h||IRQ14: Called by primary IDE controller|
|INT 77h||IRQ15: Called by secondary IDE controller|
INT 18h: Execute BASIC
This interrupt traditionally jumped to an implementation of BASIC stored in ROM. This call would typically be invoked if the BIOS was unable to identify any bootable volumes on startup. (At the time the original IBM PC was released in 1981, the BASIC in ROM was a key feature.) As time went on and BASIC was no longer shipped on all PCs, this interrupt would simply display an error message indicating that no bootable volume was found (famously, "No ROM BASIC", or more self-explanatory messages in later BIOS versions); in other BIOS versions it would prompt the user to insert a bootable volume and press a key, and then after the user did so it would loop back to the bootstrap loader to try booting again.