Skip to main content

Crate kernel

Crate kernel 

Source
Expand description

Kernel entry point and early-boot global state.

Authors: MarioS271

Modulesยง

arch ๐Ÿ”’
Architecture-specific subsystems: GDT, TSS, IDT, and interrupt controllers.
config ๐Ÿ”’
Global Compile-Time Kernel Configuration
logging ๐Ÿ”’
Kernel logging: serial output and the [kprint!] macro.
mem ๐Ÿ”’
Memory subsystem: physical memory manager, virtual memory manager, and heap allocator.
panic ๐Ÿ”’
Kernel panic paths: kernel_panic for explicit kernel panics and the required #[panic_handler] for language-level panics.
screen ๐Ÿ”’
Screen output: linear framebuffer access and PSF2 font rendering.
state ๐Ÿ”’
Global kernel state: [KState] aggregate and [KStateSubCategory] trait.
types ๐Ÿ”’
Shared kernel types: IrqMutex, FmtBuffer, AlignedStack, and panic codes.

Macrosยง

kalert
Log a line at alert severity (action must be taken immediately).
kcrit
Log a line at critical severity.
kdebug
Log a line at debug severity; compiled out unless the debug-logging feature is enabled.
kemerg
Log a line at emergency severity (system is unusable).
kerror
Log a line at error severity.
kinfo
Log a line at info severity.
kprint
Print a formatted message (like print!) to all active kernel output sinks.
kwarn
Log a line at warning severity.

Structsยง

SimpleKernelState ๐Ÿ”’
Early-boot singleton resources; written once in kmain, then read-only.

Staticsยง

LIMINE_FRAMEBUFFER_REQUEST ๐Ÿ”’
Limine request for the linear framebuffer.
LIMINE_HHDM_REQUEST ๐Ÿ”’
Limine request for the Higher-Half Direct Map (HHDM) offset.
LIMINE_MEMMAP_REQUEST ๐Ÿ”’
Limine request for the physical memory map.
SIMPLE_STATE ๐Ÿ”’
Global early-boot state, readable from anywhere in the kernel once initialized.

Functionsยง

kmain ๐Ÿ”’
Kernel entry point called by the Limine bootloader; runs boot init and never returns.