Expand description
Component initialization system for Strat9-OS.
Provides modular component registration and dependency-ordered initialization.
Components are registered at compile time via #[init_component] and discovered
at runtime through the .component_entries linker section.
§Usage
#[component::init_component(bootstrap, priority = 1)]
fn vfs_init() -> Result<(), component::ComponentInitError> {
vfs::init();
Ok(())
}
#[component::init_component(kthread, priority = 2, depends_on = vfs_init)]
fn fs_ext4_init() -> Result<(), component::ComponentInitError> {
fs_ext4::init();
Ok(())
}Call component::init_all(InitStage::Bootstrap) at the appropriate point
in kernel_main to run all registered components in dependency order.
Macros§
- parse_
components_ toml - Emit compile-time dependency metadata parsed from
Components.toml. - parse_
metadata - Parse
Components.tomlat compile time and return the dependency metadata.
Structs§
- Component
Entry - Entry placed in
.component_entriesby#[init_component]. - Component
Info - Human-readable component metadata (not stored in the linker section).
Enums§
- Component
Init Error - Errors that a component initializer may return.
- Init
Stage - Initialization stages for components.
Functions§
- init_
all - Initialize all components registered for
stagein dependency order. - list_
components - Return all registered components sorted by stage then priority (for debug).
Attribute Macros§
- init_
component - Register a function as a kernel component initializer.