COMP 3000 Operating Systems
The Boot Process
Lianying Zhao
The Boot Process
What happens from when you turn on the power of your computer to when you can log in?
What we have: • The CPU
• The disk (SSD/HDD/USB…) with the OS files
Source: clipartpng.com
COMP 3000 (Winter 2021) 2
Firmware
• A special type of software that is tightly coupled with hardware • Complements hardware
• Updatable and stored on non-volatile storage
• Usually small in size
COMP 3000 (Winter 2021) 3
BIOS vs. UEFI
• BIOS (Basic Input Output System)
• aka. the legacy mode
• Part of the firmware on PC platforms
• UEFI (Unified Extensible Firmware Interface) • Boot-time services and run-time services
• An EFI partition
• EFI executables
• More abstraction layers
• Not necessarily the UI change
COMP 3000 (Winter 2021) 4
Master Boot Record (MBR)
• The first sector of a disk drive • Contains four partition entries • Signature (0xAA55)
• 0x07c00?
• Segment:0x07c0 • Offset
COMP 3000 (Winter 2021) 5
Boot loader
• A pre-OS program (usually lightweight) that prepares the environment for and loads the OS
• Various bootloaders
• GRUB, LILO, Windows Boot Manager, NTLDR, U-Boot
• Dual boot
• Sometimes vague boundary with firmware
COMP 3000 (Winter 2021) 6
Backward Compatibility
• Pretending to be a 16-bit 8086 processor
• Real mode
• Real -> no virtual addresses
• Even the latest powerful CPUs boot in real mode
• Protected mode
• Introduced by 80286
• Protected -> paging, memory protection, privileges…
• Long mode
• A sub-mode: 64-bit mode
COMP 3000 (Winter 2021) 7
GRUB
• Multiboot
• GRand Unified Bootloader • Stage1 and stage2
COMP 3000 (Winter 2021) 8
Booting the Kernel
• Kernel image
• Initial RAMDISK (initrd) • Kernel command line
• The root file system
COMP 3000 (Winter 2021) 9
After Booting the Kernel
• Kernel modules
• Recall the .ko files, which run in the kernel space
• First user process • init
• Then, the login process
COMP 3000 (Winter 2021) 10
The Overall Process
• Firmware
• Bootloader
• Kernel
• Kernel modules • init
• Login
COMP 3000 (Winter 2021) 11
COMP 3000 (Winter 2021) 12
COMP 3000 (Winter 2021) 13