Repository navigation
Bootloaders bootloader
rust-osdev/bootloader, a Rust x86_64 kernel loader.
| Type | OS bootloader (type2) |
| Upstream | https://github.com/rust-osdev/bootloader |
| CVEs attributed | 0 |
| Vulnerability-fixing commits | 0 naming a CVE, 0 keyword-matched |
| CVEs with a linked fix | 0 |
Loads a Rust kernel from BIOS or UEFI and sets up paging before handoff.
Type 2: it starts from an initialised platform and prepares a kernel.
See Boot-Stages for the eight-stage model these phases map onto.
- BIOS or UEFI first stage -- On BIOS a 512-byte stage loads stage 2 and stage 3, which switch to protected then long mode; on UEFI the firmware loads the bootloader directly.
- common stage -- Shared Rust code takes over: it reads the kernel ELF from the disk image.
- paging setup -- Builds page tables, maps the kernel, and optionally maps all physical memory at a configurable offset.
- boot info assembly -- Fills in a BootInfo struct with the memory map, framebuffer, physical memory offset and ACPI pointer.
- kernel entry -- Jumps to the kernel entry point with a reference to BootInfo.
The interesting property is that the handoff is typed. The bootloader and the kernel are both Rust crates that share the bootloader_api crate, so the BootInfo structure the loader fills in is the same definition the kernel destructures -- an ABI mismatch becomes a compile error rather than a corrupted pointer. Configuration is done at build time through the API's BootloaderConfig, not through a file read at boot.
The kernel is entered in long mode with its page tables installed and a &'static mut BootInfo as its argument. On UEFI, ExitBootServices() has already been called and the memory map captured into that structure.
Detected in its build configuration and source:
- rollback protection
- stack protector
See Security-Mechanisms for how these are detected and what a detection does and does not prove.
git -C oss-bootloaders submodule update --init type2/bootloader
./scripts/analysis/run-tool.sh codeql bootloaderSee Tools for what each tool applies to.
Home · OS bootloader · Tools