Notes on the mysteries of Linux operating system (the first two chapters of BIOS and boot Management Program)

Source: Internet
Author: User

Notes on the mysteries of Linux operating system (the first two chapters of BIOS and boot Management Program) chapter 1 Bios boot power -- Initial North Bridge -- load program into memory -- read South Bridge COMS data -- Build SMBIOS--POST North Bridge control CPU, memory South Bridge control all peripherals BIOS (Basic Input Output System) main functions: automatic detection and initialization; Recording System settings (such as the memory size of the onboard graphics card); interrupt processing; loading the operating system. Power on stage: · Port 80 information · choppy voice · POST (Power On Self Test) hardware check CPU: Lists basic CPU information, such as speed and Cache size. RAM: Check the memory size and whether the HDD is damaged: it is listed in the order of cabling. CDROM: BIOS options are listed in the same order as hard disks. Settings: · fast boot: Tests in some POST stages can be skipped. boot sequence: HDD, CD/dvd rom, USB or Nic boot · BIOS password · Onboard VGA memory size: Its RAM occupies the physical memory, and the leading sector of the hard disk can be adjusted: (MBR) -- the first rail of the hard disk, the Boot manager can take the pointer to the core of the system. The 512-byte Bootloader Partition table Magic Number 446-byte 64-byte 2-byte Bootloader (storage boot Management Program ): loading sector and pointing to kernel loading sector boot sector (sector guide): the first sector of each partition (512 bytes) · The first boot screen Bootload is provided, the second interface/option is provided by the file in Partition or the boot sector. · Loading kernelPartion table (storage Hard Disk Partition table) Magic Number (55AA), so that the bootloader administrator can identify MBR · Linux and obtain the memory size for direct Hardware Reference without BIOS. Main Boot partition program: You can use the bios driver to provide the GRUB (GRand uniied Bootloader) (GRUB is a kind of bootloader) in the form of soft interruptions) stage1 (backup file of bootloader in MBR) · basic hardware initialization, this includes shielding all interrupts, setting the CPU speed and clock frequency, initializing RAM, initializing LEDs, and disabling CPU Internal commands and data cache lights. · Prepare a RAM space for loading stage2. Generally, stage2 is loaded into the RAM space for execution at a faster speed, therefore, an available RAM space range must be prepared for the stage2 loaded with Bootloader. · Copy stage2 to RAM. here we need to determine two points: ① The starting address and ending address of the executable image of stage2 on the solid state storage device; ② the starting address of the RAM space. · Set the stack pointer sp, which is used to prepare the C language code for stage2 execution. E2fs_stage_1_5 (File System directory accessible after loading): The 32 k stage2 followed by the hard disk (operating system loading, adding parameters, modifying options ): provides options, access the setting file, and connect to the next boot sector. Grub. conf · since stage2 code is usually implemented in C language, the purpose is to implement more complex functions and achieve better code readability and portability. However, unlike general C-language applications, you cannot use any supported functions in the glibc library when compiling and linking a program such as Bootloader. · Initialize the hardware devices to be used in this phase, including the initialization serial port and initialization timer. Some print information can be output before the device is initialized. · Detects the memory ing of the system. The so-called memory ing refers to specifying the address ranges allocated for addressing the system's RAM unit in the entire 4 GB physical address space. · Load the kernel image and the root file system image, including planning the memory usage layout and copying data from Flash. · Set kernel startup parameters. Multiple Operating Systems: stage1 + stage2. conf structure: A annotation Area B boot settings: hiddenmenu (comment out, boot countdown); Default = 0; Timeout = 5 (-1 not reciprocal); splashimage = (hd0.0) /boot/grub/splashxpm.gz (boot background picture) password (grub-md5-crypt set password) C boot options · title (operating system name, configurable) · which hard disk does the root system use the Kernel and intrd files. Hd (0.0) first partition of 1st hard disks · kernel (location of loading kernel) · intrd (location of loading intrd) stage2 find kernel (Bios entity location, hd (0.0 )) kernel root file system (Linux File System Format/dev/sda1) Multiple boot management-GRUB operation method: directly load the connection to load: direct to boot sector ** Windows + Linux first install Windows (Windows boot forces write into MBR and 1st Partition boot sector, Windows boot modifies boot. ini) · reinstall the operating system: Replace the bootloader of MBR.

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.