Skip to main content

starry_kernel/
lib.rs

1//! The core functionality of a monolithic kernel, including loading user
2//! programs and managing processes.
3//!
4//! Published page tables have no external mutable escape hatch. Callers must
5//! use the address-space mutation APIs, which own TLB invalidation and deferred
6//! reclaim:
7//!
8//! ```compile_fail
9//! fn bypass_mm_owner(aspace: &mut starry_kernel::mm::AddrSpace) {
10//!     let _page_table = aspace.page_table_mut();
11//! }
12//! ```
13
14#![no_std]
15#![cfg_attr(not(axtest), feature(likely_unlikely))]
16#![cfg_attr(not(axtest), feature(allocator_api))]
17#![allow(missing_docs)]
18#![allow(clippy::not_unsafe_ptr_arg_deref)]
19
20// The freestanding axtest target includes `root.rs` directly so that module-local
21// tests and kernel entry symbols are emitted exactly once. Keep Cargo's implicit
22// library dependency empty for that target; linking a second kernel instance
23// would duplicate trap handlers, allocators, and runtime state.
24#[cfg(not(axtest))]
25include!("root.rs");