Booting Into OS
Power on - motherboard waits for the power to stabilize
Reset Vector - CPU fetches code from a hard coded physical location which is mapped to flash memory containing the BIOS
BIOS - BIOS code is executed to detect and initialize various resources such as RAM, Platform Controller Hub and interupt controllers
Device scanning - BIOS scans the PCI/PCI to detect all the attached devices.
Runtime Firmware Setup - BIOS sets up the runtime firmware, providing critical services for the use by the system
Boot Device Determination - For older BIOS, checks all the devices in CMOS memory including disks.
Master Boot Record - First sector from the boot device (MBR) is read and this sector contains a program that examines the partition table to find the active partition.
Secondary Boot Loader - A secondary boot loader is read from the active partition which then reads the OS into memory.
OS initilization - OS queries BIOS for config information and checks if all device drivers are present.
Kernel and process - OS loads the device drivers into kernel, initializes its tables, creates processes.
UEFI
-
GUID Partition Table (GPT): Unlike the old BIOS that relies on a Master Boot Record (MBR) located in the first sector of the boot device, UEFI looks for the partition table in the second sector. This GPT contains detailed information about the locations of the various partitions on the SSD or disk.
-
File System Support: The UEFI firmware can read file systems directly. According to the UEFI standard, it must support at least FAT-12, FAT-16, and FAT-32 file systems. This capability allows UEFI to interact with a special partition called the EFI System Partition (ESP).
-
EFI System Partition (ESP): This partition contains a proper file system (like FAT-32) and stores files such as boot loaders, drivers, and other necessary programs and configuration files needed during the boot process.
-
Executable Format: UEFI firmware expects programs to be in a specific executable format called PE (Portable Executable). This is the same format used by Windows executables.
-
Advanced Functionality: UEFI behaves much like a mini operating system, with the ability to understand and manage partitions, file systems, and executables. It also includes a shell with standard commands, offering a more powerful and flexible environment compared to the traditional BIOS.