Boot phase 0 (can load files using firmware)
With BIOS: - Load OS image into next available spot - Control passed to RM entry point - Boot information block placed at fixed low address - Initialize serial port - Set up text mode - Enable A20 - Retrieve boot drive info - Find ACPI, SMBIOS and MP tables - Relocate some functions to low memory - Get memory map - Initialize RM interrupt stubs - Enter PM Memory allocations made at next available address in memory map. Files are loaded going back into RM and invoking the loader.
With UEFI: - Allocate boot information block - Record boot device path - Set up GOP - Retrieve ACPI, SMBIOS and MP tables - Allocate and load OS image below 1MB - Record PXE information - Control passed to PM entry point - Memory allocations and file loading are done through UEFI
Common: - Setup page tables - Relocate OS above 1MB - Initialize GDT, IDT, TSS, retrieve CPU features - Relocate boot information block - Initialize threads, paging - If loaded using BIOS, initialize physical memory manager, reserve low memory and mark already allocated pages as such - Relocate stack - Initialize heap - If loaded using UEFI, load 8x8 and 8x14 fonts from media - If loaded using BIOS, acquire PIC - At this point, it would be a good idea to load a configuration file, but haven't got around to it yet - Initialize debugger - Load OS symbols - If ACPI present, initialize ACPI. Otherwise register PS/2 keyboard and mouse, PCI bus and floppy controller. - Load boot FS driver - If loaded from network, load bus and network drivers and initialize bus drivers, retrieve DHCP information, stop UNDI - If loaded from floppy using BIOS, load floppy controller driver - If loaded from hard disk using BIOS, load bus and storage drivers and initialize bus drivers - If loaded using UEFI, get memory map, map UEFI runtime, exit boot services, initialize physical memory manager, reserve pages for RM code and data, initialize RM interrupt stubs, initialize option ROMs, set up text mode, initialize interrupts - Otherwise, free and unmap stuff from low memory and initialize interrupts - Initialize LAPIC
Boot phase 1 (can't load files)
- Initialize other CPUs - Enable interrupts - Initialize timers and clock - Load and initialize network, bus and storage drivers - Identify the boot drive using BIOS drive info or the UEFI boot device path
Boot phase 2 (can load files natively) - Load and initialize remaining devices - Start thread which loads and initializes further devices as they are enumerated
|