Last modified 2 years ago
Linux Kernel Boot Process
Possibly it would be more accurate to call this the start-up or initialisation since it describes what happens once the boot-loader has handed over control to the kernel.
It is focused on operations that deal with memory reservation or detection - especially e820 and ACPI - that might affect the allocation of PCI IOMEM regions later.
This is a simplified diagram of the call-path followed for IA32 x86_64 (64-bit). The path for IA32 x86 (32-bit) is slightly different.
arch/x86/boot/header.S::start_of_setup
arch/x86/boot/main.c::main()
arch/x86/boot/memory.c::detect_memory()
arch/x86/boot/memory.c::detect_memory_e820() = boot_params.e820_entries
...
arch/x86/boot/pm.c::go_to_protected_mode()
arch/x86/boot/pmjump.S::protected_mode_jump
arch/x86/kernel/compressed/head_64.S::startup_32
arch/x86/kernel/compressed/head_64.S::startup_64
arch/x86/kernel/head_64.S::startup_64
kernel/main.c::start_kernel()
...
arch/x86/kernel/setup_64.c::setup_arch()
...
arch/x86/kernel/setup_64.c::memory_setup()
arch/x86/kernel/e820_64.c::machine_specific_memory_setup()
arch/x86/kernel/e820_64.c::sanitize_e820_map(boot_params.e820_map, &boot_params.e820_entries)
...
arch/x86/kernel/e820_64.c::finish_e820_parsing()
...
arch/x86/kernel/e820_64.c::e820_register_active_regions()
...
arch/x86/kernel/acpi/boot.c::acpi_boot_table_init()
arch/x86/kernel/pci-dma.c::dma32_reserve_bootmem()
arch/x86/kernel/acpi/sleep.c::acpi_reserve_bootmem()
arch/x86/kernel/efi_64.c::efi_reserve_bootmem()
...
arch/x86/kernel/acpi/boot.c::acpi_boot_init()
...
arch/x86/kernel/e820_64.c::e820_reserve_resources()
arch/x86/kernel/e820_64.c::e820_mark_nosave_regions()
arch/x86/kernel/e820_64.c::e820_setup_gap()
...
}
drivers/acpi/bus.c::acpi_early_init()
kernel/main.c::rest_init()
arch/x86/kernel/process_32.c::kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
}
kernel/main.c::kernel_init()
...
do_basic_setup()
...
drivers/base/init.c::driver_init()
...
init/main.c::do_initcalls()
}
...
init/main.c::init_post()
}
