Start the BIOS --Linux core design principle study notes

RAM: random access memory, it is a common type of memory RAM, characterized by optionally under power to read, write, the information disappears after a power failure.
When RAM what program did not, and who will complete the task load floppy disk operating system?
The answer is: BIOS.

Start the BIOS principle

Before looking at how the BIOS to load the operating system into memory, we first look at how the BIOS program itself is started. From our experience of using a computer to know: To execute a program, you must double-click it in the window, or enter the appropriate implementation of the command line interface. Actually execute a program in the operating system's visual interface or a command-line interface is already up and running in the computer in terms of the underlying mechanisms. However, in the boot power of the moment, there is no memory of what the program, no program is running, there can be no operating system, not to have the operating system's user interface. We can not artificially execute the BIOS program, the BIOS program in turn, who will perform it?
The secret is: 0xFFFF0! ! !

From the perspective of the system point of view, it is not difficult to conclude that: Since it is impossible to perform BIOS software method, it can only be done by a hardware approach. From a hardware perspective, Intel 80x86 family CPU can run in each 16-bit real mode and 32-bit protected mode. For compatibility, and to start to solve the problems of the beginning, Intel 80x86 series all the CPU, including the latest models of the CPU hardware are designed to be power-that is, into 16-bit real mode state operation. At the same time, there is very critical that the CPU hardware logic design to force the instantaneous power value is set to CS 0xF000, IP value is set to 0xFFF0, this CS: IP to point to this address 0xFFFF0 position, as  1- 1 shown in FIG. It can be clearly seen from Figure 1-1, 0xFFFF0 points to the address range of the BIOS.
Start the BIOS principle
FIG 1-1 BIOS executed in the initial state and the start location in memory

Tips

  • IP / EIP (Instruction Pointer): instruction pointer register, exists in the CPU, the memory address of the instruction to be executed instruction records in the code segment offset address, and CS is the combination to be performed. Real mode is the absolute address of the instruction pointer 16, i.e., the IP; is a protected linear address mode, the instruction pointer 32, i.e., EIP.

  • CS (Code Segment Register): the code segment register, is present in the CPU, the CPU code point in the memory area currently executed (defines the starting address stored in code memory).
    Note that this is a pure hardware to complete the action! If at this time the position is not executable code, then it did not have to say, this computer crashes. Conversely, if there is executable code in this position, the computer will begin the code here, it has been the implementation of the follow-up program to go along.
    BIOS program entry address is precisely 0xFFFF0! That is, the first instruction of the BIOS program to design in this position.

Guess you like

Origin blog.51cto.com/14441798/2421406