วันพฤหัสบดีที่ 28 กุมภาพันธ์ พ.ศ. 2551

BIOS

From Wikipedia, the free encyclopedia
Jump to: navigation, search

This article needs additional citations for verification.Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (December 2006)
For other uses, see Bios.
BIOS: Basic Input/Output System
Phoenix AwardBIOS CMOS (non-volatile memory) Setup utility on a standard PC
BIOS (pronounced /ˈbaɪoʊs/), in computing, stands for Basic Input/Output System.[1] [2]
The term is incorrectly known as Binary Input/Output System, Basic Integrated Operating System and occasionally Built In Operating System. BIOS refers to the firmware code run by a personal computer when first powered on. The primary function of the BIOS is to identify and initiate component hardware (such as hard disk, floppy and optical disk drives). This is to prepare the machine so other software programs stored on various media can load, execute, and assume control of the PC.[3] This process is known as booting, or booting up, which is short for bootstrapping.
BIOS can also be said to be a coded program embedded on a chip that recognizes and controls various devices that make up x86 personal computers. 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 proposed alternatives for Legacy BIOS in the x86 world: Extensible Firmware Interface, Open Firmware (used on the OLPC XO-1) and LinuxBIOS.
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.

How the BIOS boots
Layers
Computer hardware
System BIOS
Operating system
Application software
The BIOS runs from the PROM, EPROM or, most commonly, flash memory when the computer is powered on. It initializes several motherboard components and peripherals, including:
The clock generator.
The processors and caches.
The chipset (memory controller and I/O controller).
The system memory.
All PCI devices (by assigning bus numbers and resources).
The primary graphics controller.
Mass storage controllers (such as SATA and IDE controllers).
Various I/O controllers (such keyboard/mouse and USB).
Finally, it loads the boot loader for the operating system, and transfers control to it. The entire process is known as power-on self-test (POST). On the original IBM PC, the hardware only needed minimal configuration and POST was indeed used for testing; on modern systems, most of POST actually consists of hardware configuration.
Once system memory is initialized, the BIOS typically copies/decompresses itself into that memory and keeps executing from it.
Nearly all recent BIOS implementations can optionally execute a setup program interfacing the nonvolatile BIOS memory (CMOS). This memory holds user-customizable configuration data (passwords, time, date, hard drive details, etc.) accessed by BIOS code. The 80x86 source code for early PC and AT BIOS was included with the "IBM Personal Computer Technical Reference Manual".[4]
In most modern BIOS implementations, users select where the BIOS obtains its boot image: CD, hard disk, floppy disk, USB device or via a networked connection. This is particularly useful for installing operating systems or booting to a LiveCD or flash keydrive, and for selecting the order of testing for the presence of bootable media.
Some BIOSes allow the user to select the operating system to load (e.g. load another OS from the second hard disk), though this is more often handled by a second-stage boot loader.

The BIOS Chip and BIOS Recovery

ROM with BIOS
Before 1990 or so BIOSes were held on ROM chips that could not be altered. As its complexity and need for updates grew, BIOS firmware was subsequently stored on EEPROM or flash memory devices. The first flash chips attached to the ISA bus. Starting in 1998, the BIOS flash moved to the LPC bus, a functional replacement for ISA, following a new standard implementation known as "firmware hub" (FWH). In 2006, the first systems supporting a Serial Peripheral Interface (SPI) appeared, and the BIOS flash moved again.
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 can not be altered by updates. 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.[5]
Due to the limitation on the number of times flash memory media can be flashed, a flash-based BIOS is vulnerable to "flash-burn" viruses that repeatedly write to the flash, permanently corrupting chip content. Such attacks can be prevented by some form of write-protection, the ultimate protection being the replacement of the flash memory with a true ROM.
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.

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:
Need to be used prior to the time that the operating system loads (e.g. they may be used as part of the process which loads (bootstraps) the operating system), and:
Are not sufficiently simple, or generic in operation to be handled by the main BIOS directly
Older operating systems such as DOS, as well as bootloaders, may continue to make use of the BIOS to handle input and output. However, most 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 modern 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 0xC0000 to 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. Another utility written for Unix and Windows/DOS systems is REE; it dumps the bytes of any "add-in" BIOS it finds in memory to a file (usually "C0000.ROM").

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.

Evolution of the role of the BIOS
Older PC operating systems, which were developed for 16-bit CPUs, such as MS-DOS, relied on the BIOS to carry out most input/output tasks within the PC. A variety of technical reasons eventually made it inefficient for more 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, better-performing, native drivers and also made it much easier to extend support to new hardware, while 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 could 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 MB 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 LinuxBIOS and OpenBIOS/Open Firmware projects. AMD provided product specifications for some chipsets, and Google is sponsoring the project. Motherboard manufacturer Tyan offers LinuxBIOS 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 modems.

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), General Software, Insyde Software, and Phoenix Technologies (which bought Award Software International in 1998).

See also
Firmware
Extensible Firmware Interface (EFI)
coreboot, a project which aim is to create a free replacement for the BIOS
Open Firmware
Input/Output Base Address
Advanced Configuration and Power Interface (ACPI)
BIOS boot devices
BIOS interrupt calls
Power-On Self Test (POST)
Nonvolatile BIOS memory
ARCS

Sources
How BIOS Works - HowStuffWorks

External links
Changing PC BIOS Settings at HowStuffWorks
Flashing the BIOS at HowStuffWorks
BIOS Recovery, Chip replacement, Update instructions
Wim's BIOS Page
TweakBIOS - BIOS information and tweaking
BIOS options explained
Award BIOS identification page
Boot-CDs and Boot-Diskettes
Information about the BIOS, POST, BIOS recovery and chip replacement
BIOS from A to Z
BIOS for Beginners
BIOS Password reset
Some universal and/or firmware flash tools are: UniFlash and flashrom - a Linux tool.

Specifications
Preventing BIOS Failures Using Intel® Boot Block Flash Memory (December 1998)
BIOS Boot Specification 1.01 (January 1996)
Implementing a Plug and Play BIOS Using Intel's Boot Block Flash Memory (February 1995)

Notes and References
^ IBM Personal Computer Technical Reference manual, IBM Corporation, First Edition, Revised March 1983, page iii
^ Mukherjee, Anindya & Narushoff, Paul (1993), Programmer's Guide to the AMIBIOS, Windcreat/McGraw-Hill, ISBN 0-07-001561-9
^ HowStuffWorks: What BIOS Does.
^ This is how the book refers to itself on page i (first edition, August 1981). The actual title is merely Technical Reference, but both the slipcase cover and binder include the phrase "Personal Computer Hardware Reference Library" to separate it from other IBM "Technical Reference" works; e.g., those of the PC's Programming Family. This particular Hardware Reference may also be cited as IBM Part Number 6025008 in which the listing of the BIOS code in small typeset fills 79 pages of Appendix A.
^ "Quad BIOS is a unique GIGABYTE feature that includes DualBIOS™ and Xpress BIOS Rescue Technology. This combination delivers a safety assurance mechanism that sports a total of 4 copies of BIOS distributed between the Flash ROM, hard-disk and driver CD." Gigabyte Corporate News, January 15, 2007.
Retrieved from "http://en.wikipedia.org/wiki/BIOS"
Categories: BIOS Boot loaders
Hidden category: Articles needing additional references from December 2006

ไม่มีความคิดเห็น: