Lecture: booting
preparation
administrivia
- okay to submit the same copy if working in pairs? yes
- lab X options
- review machine model & hellok
- lab 1 released
the booting process
- what happens after power on?
- high-level: firmware → bootloader → OS kernel
- what’re the “handover protocols” / machine state after each handover
- example: BIOS-bootloader handover
- BIOS firmware: a program stored in non-volatile memory
- detect & initialize hardware
- start in real mode: 16-bit registers, 20-bit (1 MB) addresses
- load the master boot record (the first sector, 512 bytes) to
0x7c00
& jump there
- example: bootloader-kernel handover via Multiboot
- the xv6 bootloader:
bootasm.S
and bootmain.c
- what’s the machine state when the bootloader starts?
- switch to protected mode: 32-bit registers/addresses
- load the kernel (in ELF) from hard drive
- prepare machine state & handover: jump to the entry point in
entry.S
- what’s machine state after the bootloader (before entering the OS)?
- why do we need the bootloader
- hard to fit the entire OS in 512 bytes
- more options for users: boot from cdrom, network, usb, etc.
- can have multiple stages
- BIOS-booting pros & cons
- simple but restrictive
- arch-specific: x86 real to protected (to long) mode
- drivers?
- Unified Extensible Firmware Interface (UEFI)
- see screenshots from googling “asus uefi bios”
- OS-specific boot protocols