#[unsafe(no_mangle)]pub extern "C" fn start_kernel(boot_info: &BootInfo) -> !Expand description
Main kernel entry point for the boot processor
This function is called by architecture-specific boot code and performs the complete kernel initialization sequence using information provided in the BootInfo structure.
§Boot Sequence
The kernel initialization follows this structured sequence:
- Early System Setup: Extract boot parameters from BootInfo
- Memory Initialization: Set up heap allocator with usable memory
- Early Initcalls: Initialize critical early subsystems
- Driver Initcalls: Load and initialize device drivers
- Virtual Memory: Set up kernel virtual memory management
- Device Discovery: Enumerate hardware from BootInfo device source
- Graphics Initialization: Initialize graphics subsystem and framebuffer
- Interrupt System: Set up interrupt controllers and handlers
- Timer Subsystem: Initialize kernel timer and scheduling infrastructure
- VFS Setup: Initialize virtual filesystem and mount root
- Initramfs Processing: Mount initramfs if provided in BootInfo
- Initial Task: Create and load initial userspace process
- Scheduler Start: Begin task scheduling and enter normal operation
§Architecture Integration
This function is architecture-agnostic and relies on the BootInfo structure to abstract hardware-specific details. Architecture-specific boot code is responsible for creating a properly initialized BootInfo before calling this function.
§Arguments
boot_info- Comprehensive boot information structure containing:- CPU ID for multicore initialization
- Usable memory area for heap allocation
- Optional initramfs location and size
- Kernel command line parameters
- Device information source (FDT/UEFI/ACPI)
§Memory Layout
The function expects the following memory layout:
- Kernel image loaded and executable
- BootInfo.usable_memory available for allocation
- Hardware description (FDT/ACPI) accessible via device_source
- Optional initramfs data at specified location
§Safety
This function assumes:
- Architecture-specific initialization has completed successfully
- BootInfo contains valid memory areas and addresses
- Basic CPU features (MMU, interrupts) are available
- Memory protection allows kernel operation
§Returns
This function never returns - it transitions to the scheduler and enters normal kernel operation mode.