<title>The role of BIOS</title> The role of BIOS
Real Mode : 20-bit, 1M of memory can directly access the BIOS and hardware, no paging and multitasking, a boot is real mode
BIOS : Boot by hardware, he is located in 0xffff0, hardware power will automatically execute his cs:0xf000,ip:fff0–> 0xffff0
Protection Mode : The pattern that we normally use. In real mode IP is 16 bits, in protected mode, IP becomes 32 bit, called EIP
The role of BIOS startup, detecting hardware, and More importantly , creating interrupt vector tables and interrupt service programs in memory
1k:0x0 ~ 0X3FF
256b:0x0 ~ 0xFF
Interrupt vector table in memory:
0x00000 ~ 0x003ff: Interrupt vector table
0x00400 ~ 0x004ff:bios Data area
0x0e05b ~ 0x0ffff: Several interrupt service programs related to interrupt vector table
Interrupt vector table has 1 K, the other contains 256 interrupt vectors, each interrupt vector table occupies 4K, which contains CS and IP values
Each interrupt vector points to a specific interrupt service program
Computer load OS kernel 3 times
- The BIOS interrupts int 0x19 to load the contents of the first sector bootsect into memory
- 2 and 3, under the command of Bootsect, load the contents of the next 4 sectors and the subsequent 240 sectors into memory, respectively.
Other BIOS interrupts 0x19 are initiated by the computer's BIOS. Interrupt vector 0x19 points the CPU to 0X0E6F2 (there are several interrupt service programs associated with the interrupt vector table in 0x0e05b ~ 0x0ffff, where the 0x19 corresponding interrupt service program is 0XE6F2). His role is to:
Load the first section of the floppy disk program (512B) into the specified location in memory
Interrupt vector tables Interrupt Verctor table: is an important part of the real-mode interrupt mechanism, recording the memory address of all interrupts corresponding to the interrupt service program
Interrupt Services Interrupt Service: A program with a specific function
After the int 0x19 executes, the contents of the first sector are copied to the memory 0x07c00
The content inside this sector is the Linux boot program, which is the bootsect boot sector, and then Bootsect executes the second batch in the floppy disk, and the third batch of code is loaded into memory
The role of BIOS