One of Ubuntu's secrets: What does the bios do with __ios?

Source: Internet
Author: User
Tags reserved
one of Ubuntu's secrets: What does the BIOS do?

This post is a bit old, published in the school the year before the Water Riverside BBS, reprinted and Share with you.

-----------------Gorgeous split Line--------------------------------------------

Learning Linux for a long time, there is no time to put the experience and some of the skills of digging out, this summer vacation at home nothing, sorted out some share with you. Because they are their own understanding and experimental products, so there must be some improper, look forward to exchange corrections.   This series will be named after the Ubuntu Quest, covering the entire boot process and the hack of the GNOME desktop. Today's first tip: What does the BIOS do?
The BIOS (Basic input/output System) is a set of programs that are solidified into a computer to provide the lowest level and most direct hardware control to a computer, which is the hub for connecting software programs and hardware devices.
The purpose of the BIOS is to detect hardware, initialize hardware, allocate resources (such as IO addresses, IRQ numbers, DMA channels, and so on) and assist in loading the operating system.
First of all, understand two concepts: Bei Qiao (North Bridge), South Bridge (South Bridge).
The north and South Bridges make up the chipset on the motherboard. North Bridge main control CPU and memory, is the system bus and the first class PCI bus bridging equipment, also known as host bridges; South Bridge is responsible for peripheral bus devices such as PCI,PCI-E,USB,VGA, these peripherals hanging on the PCI bus, through their respective controllers and PCI bus interface, Different types of buses pass through the bridge interface.
In the low end of memory 640KB address space is called basic memory, generally used for fixed purposes, such as A0000H~BFFFFH reserved for video card memory use, C0000H~C7FFFH for the video card BIOS,C0000H~FFFFFH reserved to the system of the equipment Bios,ide , SATA and other bios are also in this space, where the "system BIOS" typically occupies the last 64KB or more. (This information can be found by Cat/proc/iomem | head)
Typically, the computer's boot process is performed under the motherboard's BIOS control, which is also known as the system BIOS, which is in a special area of the South Bridge Chip CMOS, and the battery on the motherboard provides the power for the CMOS save data. In addition to this "system BIOS", the PCI devices also provide their own BIOS, their function is to access the device's PCI configuration register directly to obtain information on PCI devices, configure PCI device parameters, complete the initialization of PCI devices, and so on. The system BIOS verifies that the data in the CMOS is correct when it is activated, and if it is correct, it integrates the information and the found hardware information into a single form, written into memory, the so-called SMBIOS (System Management BIOS), If the error is replaced by the default value of CMOS information provided. The main role played by Smbios is to present the motherboard or X86 architecture system to the user through the BIOS. The Dmidecode command allows you to view the table, which has many type, each representing a class of information that can be found in the Dmidecode man page.
When the computer power switch is pressed, the power supply began to power the motherboard and other devices, at this time the voltage is not stable, the motherboard control chipset (North Bridge Chip) will send a reset signal to the CPU, let the CPU reset initialization. When the power supply starts to stabilize the power supply, the chipset will remove the reset signal, the CPU immediately began to execute instructions from the address ffff0h, this address in the "system BIOS" address range, put here is generally a jump instruction, jump to the system BIOS real start code.
From the host to the load bootloader this process, the system BIOS has gone through three stages: Pown on, POST, loading bootloader.
Pown on stage
This phase starts at the end of the screen with the power on, which is called the activation phase. The primary task of this phase is to verify that the contents of the CMOS are correct, check the status of some hardware on the host to determine the next self-test, so the user cannot see the BIOS information on the screen (the VGA will be activated until the hardware is confirmed), and if the error is generally fatal (usually a black screen), The wrong type can only be judged by the sound of the horn. This phase only checks what devices are on the system and is not initialized.
POST (Power on self test) phase
Check for key devices such as memory, video card availability, and easy memory testing, which displays basic information about the hardware on the screen as long as the test is OK. The basic process of this phase is as follows: The system BIOS looks for the bios of the video card, the starting address of the ROM chip that holds the bios of the video card is usually at c0000h, then calls its initialization code, completes the initialization of the video card by the bios of the video card, and then the screen can display Most video cards will display some information about the video card at this point, but usually just flash through. By analogy, the system BIOS invokes the BIOS code of the device found in the previous phase to complete the initialization of the corresponding device. After all other devices have been checked, the BIOS will display its own splash screen, then check the CPU type and operating frequency, the memory capacity of the host, and then the system BIOS begins to test and configure some of the standard hardware devices installed in the system such as hard drives, optical drives, COM ports, and ports. The BIOS then starts checking and configuring the Plug and Play devices in the system. All devices that need to be powered on and after the boot are activated at this stage.
Loading bootloader phase
When all the hardware is detected and there is no problem, the way in which the BIOS takes a backseat is to give the OS-loaded master control to the main boot sector of the hard disk, which is the contents of the physical sector 0-column 0-side 1 sector of the hard disk, so that the boot management program (bootloader) that is hiding here takes the pointer to the system core The common Linux boot management program is grub. (Future sharing grub configuration and debugging methods ^_^)
In summary, the system activation process is: Turn on the power switch-CPU initialize-bios activation-read and verify CMOS data, Detect hardware status (when the BIOS code runs in Flash Memo)-Generate SMBIOS Forms-detect, configure, and initialize hardware-load bootloader
In addition, there are two commands for viewing system BIOS information: Dmidecode and Biosdecode. They can display information such as CPU, memory, motherboard model, OEM information, motherboard slots, etc., which is useful for viewing system hardware configurations.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.