diff --git a/src/main.rs b/src/main.rs index b9d15673df..04a561ba1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -178,6 +178,9 @@ fn kmain(cpu_count: u32, bootstrap: Bootstrap) -> ! { //Initialize the first context, stored in kernel/src/context/mod.rs context::init(); + //Initialize global schemes, such as `acpi:`. + scheme::init_globals(); + let pid = syscall::getpid(); info!("BSP: {:?} {}", pid, cpu_count); info!("Env: {:?}", ::core::str::from_utf8(bootstrap.env)); diff --git a/src/scheme/mod.rs b/src/scheme/mod.rs index 6c515704e2..0e90b99165 100644 --- a/src/scheme/mod.rs +++ b/src/scheme/mod.rs @@ -496,3 +496,12 @@ impl GlobalSchemes { SchemeId::new(self as usize) } } + +#[cold] +pub fn init_globals() { + #[cfg(all(feature = "acpi", any(target_arch = "x86", target_arch = "x86_64")))] + { + AcpiScheme::init(); + } + IrqScheme::init(); +}