We have been using BIOS for more than 20 years. today, however, there are still many friends who do not know what the BIOS is, what it mainly does, and how it is positioned in the PC. in fact, BIOS is the most important underlying system software in the entire computer system. for more than 20 yearsProgramThe developers ignored the BIOS or the Development Technology derived from the BIOS. On the contrary, we talked about how to adjust one or two BIOS settings. today, the BIOS industry is quietly changing. The arrival of EFI or UEFI is about to change the world, thus completely changing our understanding of the past computer startup process. but our Chinese developers are still talking about Java or. net, I think it's time to study BIOS clearly.
I am willing to contribute to a brief entry as I have learned.ArticleTo bring everyone into the bios, an interesting and mysterious region. Let's explore the bios, especially the basic system software of the next generation of personal computers, or the basic firmware: uefi bios. since there are many similar articles on the internet, I will focus on some of the content that others generally ignore.
BiOS Definitions
BiOS -- Basic Input and Output System, is used for initializing, testing and putting the PC into the ready state so that an OS may be started. part of the BIOS remains in the system main memory after post, or power on self test. biOS provides a consistent software interface to varying types of the hardware devices. it also provides the basic system level services to OS. the BIOS is also used for helping ihv to fix their Hardware Design Bugs by using the SMM mode of the IA under echture.
When I was learning bios, my teacher, an outstanding BIOS engineer who was respected by the entire industry, told me that although this paragraph is short, however, it is clear that the basic features of BIOs are:
1) Check the hardware, also known as post.
2) initialize the hardware and set its basic State so that the entire computer reaches the so-called "available State" (ready state ).
3) Start the OS loader to load the operating system.
4) after the operating system is started, some of them will continue to reside in the memory and provide basic system-level services to the operating system and other software, such as disk read/write.
5) fix hardware defects.
Let's look at these functions one by one. the first hardware check may be easier to understand, that is, to see if your hardware is still working normally, but from the software perspective. among them, the most important thing is the memory detection. we still have memories of the memory size on the screen that has been jumping during startup, that is, we are doing memory test or memory sizing.
The second feature is hardware initialization. Many may ask: why do I still need to initialize my hardware? Well, the hardware design manufacturers tend to consider for the general market, and do not want to design the hardware into a custom state. A network card may be installed on a PC, it can also be installed on an embedded system. so in order to make the hardware work according to the PC architecture, BIOS must set the hardware according to the manual provided by ihv (indenpendent hardware vendor), such as writing a few necessary registers, do some enable work. this is very important. If a hardware does not have an enable, it will be invisible in the OS.
The third feature is to start the operating system, which is also one of the BIOS's tasks. the startup method is defined by BIOS, and the operating system must be designed according to BIOS requirements. this is why the operating system from DOS to Vista can only put its own loader in MBR, because BIOS read-only MBR. powerful Microsoft must follow this non-standard :) Of course, this has changed in the EFI era. The boot from file supported by EFI does not require MBR.
The fourth feature may have been familiar to DoS developers. Do you still remember the int 10 basic screen service and INT 13 Disk Service? How many viruses are transmitted by INT 13. Another friend tried to bypass int 10 and directly write the screen? In the Windows era, these things actually exist and continue to play a basic core role, but they are packaged by windows and cannot be accessed by General programs, but this does not mean they are useless. not long ago, Ms developers said that, in fact, even the Longhorn installation program in development still has a lot of code for Screen Writing Based on Int 10.
The fifth feature may not be known to common friends, that is, friends who have been slightly touched by BIOS may have heard of it for the first time! Intel has a special mode named System Management Mode in its CPU, which has the highest permissions. when SMM is interrupted, even the omnipotent windows do not know, so that the CPU can be supplemented with bugs. For example, for example, if a CPU of Intel returns an incorrect operation result for the Add command one day, SMM can be used to interrupt the command every time it executes the command, and the BIOS software will give the correct execution result. this achieves the goal of fixing hardware defects. in this way, Intel does not need to recruit its CPU. in addition, every time the BIOS is turned on, the CPU microcode will actually be updated, which is also used to add bugs to the CPU. so many times, a problem occurs when the BIOS is flushed. In fact, a CPU bug is not fixed, leading to a problem.
Where is the BIOS?
There are a lot of BIOS basics above, so where is the BIOS? The answer is in your computer: it is indeed boring. In fact, there are three BIOS states:
1) Before build
2) BIOS Image
3) BIOS Runtime
First, the BIOS is represented by a bunch of hard disks of BIOS developers.Source code. In the second type, the BIOS is an image sleeping in the flash. in the third mode, when the BIOS executes, controls the system, and interacts with the operating system.
EFI BIOS
EFI was proposed by Intel to establish a new framework for the next generation of BIOS development. EFI is the abbreviation of extensible firmware interfaces. As it is named, EFI is not a specific software, but a complete set of interface specifications between the operating system and platform firmware. EFI defines many important data structures and system services. If you fully implement these data structures and system services, it is equivalent to implementing a real BIOS core.
EFI was first proposed at Spring 2000 IDF (Intel Developer's Forum). Intel believed that since IBM launched its first PC in early 1980s, the personal computer hardware platform has undergone earth-shaking changes. The related system software, such as the operating system, also changed from the earliest Ms dos1.0 to today's Windows XP, however, the bios, which is one of the most fundamental and critical system software of the entire system, basically keeps the architecture unchanged for 20 years. This is an incredible thing in the entire software history. Today, BIOS has become a serious obstacle to the IT industry's advancement. We must make innovations in BIOS to provide more powerful support for the next generation of operating systems (such as Windows Server Longhorn.
The above is an introduction to efi I wrote a long time ago. It seems that some errors are inevitable, but the general meaning is very clear. EFI is used to replace the traditional BIOS. as a better bios, EFI can provide many things that could not be done in BIOS in the past. the subsequent articles will be gradually presented to you.
Some common questions about bios/EFI and my short answers:
1) What is the size of BIOS?
The traditional BIOS (later legacy BIOS) is generally kb, while the early efi bios is also kb. Currently, EFI is basically 1 MB.
2) what tools are used for BIOS development?
Legacy BIOS is generally developed using MASM 6.11. It is also matched with the buid tools. EFI written by some vendors, which uses Viusal Studio. NET 2003 and MASM 6.11 For Development (I didn't expect it ~)
3) What is EFI boot?
EFI has its own unique Boot Method, completely abandoning the traditional concept of MBR with 0 channels and 0 sectors. the Boot Mode of EFI is closely related to the file system. in the past, due to the absence of a file system, the legacy BIOS had to choose the method of loading programs from a specific space on the hard disk, while EFI included the complete file system support, therefore, there are no specific requirements on hard disks. The operating system loader under EFI is actually stored in the boot \ ia32 \ bootia32.efi file. (assuming the ia32 architecture ). this is an EFI application.
The following is a summary of some BIOS resources:
1. BIOS boot Specification
BBS is generally called in the industry. It describes in detail all the things that must be done during BIOS startup, how to differentiate boot devices and how to choose boot devices.
Http://www.phoenix.com/NR/rdonlyres/56E38DE2-3E6F-4743-835F-B4A53726ABED/0/specsbbs101.pdf
2. UEFI Specification
UEFI specifications: Describes the required uefi bios interfaces, uefi bios models, services, and so on.
Http://www.uefi.org
3. Ralf Brown's interrupt list
This person seems to have been collecting interrupted things all his life and is useful for legacy BIOS learning.
Http://www.ctyme.com/rbrown.htm
4. El torito CD-ROM boot
Describes how the BIOS boot from the optical drive.
Http://www.phoenix.com/NR/rdonlyres/98D3219C-9CC9-4DF5-B496-A286D893E36A/0/specscdrom.pdf
5. USB specification
USB device specification
Http://www.usb.org
6. plug-and-play specifications
Ms PNP Specification
Http://www.microsoft.com/hwdev/tech/pnp/default.asp
7. BIOS writer's Guide
The BIOS development Bible is provided by the CPU vendor. intel cannot see it. Intel is a top secret document. AMD can see that different CPUs have different BWG. here is a BWG of AMD's new CPU:
Http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116.pdf
There are also many related documents. In fact, the most difficult part of BIOS compilation is to support almost all general specifications in the industry at the same time. Read the full text
Category:View comments on EFI