Booting process of Linux: Difference between revisions

Content deleted Content added
Bootloader stage: Make it clear that the boot record is read into memory, not the partition
Line 10:
 
== Bootloader stage ==
The first stage bootloader, which is a part of the MBR, is a 512-byte image containing the vendor-specific program code and a partition table.{{Sfn|M. Tim Jones|2006|loc=, "Stage 1 boot loader"}} As mentioned earlier in the introduction part, the first stage bootloader will find and load the second stage bootloader.{{Sfn|M. Tim Jones|2006|loc=, "Stage 1 boot loader"}} It does this by searching in the partition table for an active partition.{{Sfn|M. Tim Jones|2006|loc=, "Stage 1 boot loader"}} After finding an active partition, first stage bootloader will keep scanning the remaining partitions in the table to ensure that they're all inactive.{{Sfn|M. Tim Jones|2006|loc=, "Stage 1 boot loader"}} After this step, thisthe active partition's boot record is read into RAM and executed as the second stage bootloader.{{Sfn|M. Tim Jones|2006|loc=, "Stage 1 boot loader"}} The job of the second stage bootloader is to load the Linux kernel image into memory, and optional initial RAM disk.{{Sfn|M. Tim Jones|2006|loc=, "Stage 2 boot loader"}} Kernel image isn't an executable kernel, but a [[Vmlinux|"compressed file" of the kernel]] instead, compressed into either [[Vmlinux|zImage or bzImage]] formats with [[zlib]].{{Sfn|M. Tim Jones|2006|loc=, "Kernel"}}
 
In x86 PC, first- and second-stage bootloaders are combined into the [[GNU GRUB|GRand Unified Bootloader]] (GRUB), and formerly Linux Loader ([[LILO (bootloader)|LILO]]).{{Sfn|M. Tim Jones|2006|loc=, "Stage 2 boot loader"}} [[GRUB 2]], which is now used, differs from GRUB 1 by being capable of automatic detection of various operating systems and automatic configuration. The stage1 is loaded and executed either by the [[BIOS]] from the [[Master boot record]] (MBR). The intermediate stage loader (stage1.5, usually core.img) is loaded and executed by the stage1 loader. The second-stage loader (stage2, the /boot/grub/ files) is loaded by the stage1.5 and displays the GRUB startup menu that allows the user to choose an operating system or examine and edit startup parameters. After a menu entry is chosen and optional parameters are given, GRUB loads the linux kernel into memory and passes control to it. GRUB 2 is also capable of chain-loading of another bootloader. In [[UEFI]] systems, the stage1 and stage1.5 usually are the same UEFI application file (such as grubx64.efi for [[x64]] UEFI systems).