Linux boot process

Source: Internet
Author: User
BIOS boot

1. The hardware will load the BIOS to the end of memory when the power is on. This is the real mode, the address space is 1M.
2. The CS segment register is forced by the hardware to set the 0XFFFF,IP instruction register to 0x0000. This cs:ip points to the address location of the OxFFFF0. This location is the entry address of the BIOS program.
3. Execute the BIOS program. In the memory start address 0x00000 set the 1K size of the interrupt vector table. The size of each interrupt vector is 4 bytes. The interrupt vector holds the entry address of the interrupt service.
The 4.BIOS program sets the BIOS data area (256B) immediately after the interrupt vector table.
The 5.BIOS program sets the interrupt Service program (8KB) in the position of 56K behind the BIOS data area.
The 6.BIOS program executes an int 0x19 interrupt, and after the CPU receives the interrupt, it finds the corresponding interrupt service entry address in the interrupt vector table. The Interrupt service program is then executed to load 1 sector 512-byte (MBR) data from 0 Disk 0 tracks into the 0X07C00 location in memory.

To start the boot program

After the BIOS loaded the MBR into memory, it retire, handing control over to the MBR, followed by the MBR.
The 1.MBR is written by the assembly and is 512B in size, and the main function is to load the operating system's boot program (boot sector) into memory.
2. The bootloader loads the kernel kernel to the memory corresponding location.
3. The bootloader transforms the current real mode into protected mode. During this period a great deal of work was done:

  • Off interrupt
  • Move the kernel to the starting memory location
  • Set Interrupt descriptor (IDT) and Global Descriptor Descriptor (GDT)
  • Set up page catalog tables and Industry tables
  • Turn on protected mode, set the CR0 register to the No. 0 bit 1.
  • Ready to execute main function, control transfer to a kernel
Boot the kernel

Execute main function, kernel start, Mount Initramfs, execute user space first program init ...

Linux boot process

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.