Made a nature porter, introduced well, backed up under
The MBR is a sector on the hard disk that contains three parts (a bootstrapper, a partition table and a delimited identity, a total of 512 bytes in the MBR, a bootstrapper that takes up to 446 bytes), and why this MBR is needed, mainly because the BIOS is too small and has limited functionality. When the system is on power, the BIOS self-test will load the MBR into memory. This means that the bootstrapper is activated, the partition table information is loaded into memory, and it means that the control of the system transitions from BIOS to grub.
GRUB is the abbreviation for Grand Unified bootloader, which is a multiple operating system startup manager. Used to guide different systems. Grub is a system boot program that is divided into two phases 1. The first stage it is stored in the MBR. Written in assembly language, which is the part of the boot program in the MBR. ① Basic Hardware Device initialization (masks all interrupts, shuts down processor internal instructions/data cache, etc.). ② prepare space for the Stage2 that loads the Bootloader. ③ if it is from a solid-state storage medium, copy the Bootloader stage2 into RAM space. ④ set the stack. ⑤ jumps to Stage2 's C program entry point. 2. The second phase of the Grub boot program, usually written in C, has the following tasks: ① Initializes the hardware device to be used at this stage. ② detects system memory mappings. ③ reads the kernel image and the root file system image from Flash to ram space. ④ set the startup parameters for the kernel ⑤ call the kernel. It is usually stored in/boot/grub/. When we start the system into the grub interface, we see selective information, and if we compile the system kernel ourselves, you can choose to boot from a kernel. Also note that the grub configuration file and kernel are in the/boot partition. As we can see from the previous analysis, there is no inclusion relationship between the/boot and the MBR. The first phase of grub needs to go to the MBR to read the bootstrapper, and Grub II needs to read the system kernel and configuration files to the/boot partition.