Skip to main content

Crate kernel

Crate kernel 

Source
Expand description

Kernel entry point

Authors: MarioS271

ModulesΒ§

arch πŸ”’
Architecture-specific code Each arch’s top level mod.rs should provide a public boot function to make initializing that arch easier
config πŸ”’
Compile-Time Kernel Config; configure the compiled kernel’s default params
cpu πŸ”’
Arch-abstract CPU definitions and state (mainly contains KSTATE::cpu)
drivers πŸ”’
Drivers; includes TTY system, GPU/display drivers and much more
ipc πŸ”’
Inter-Process Communication: Pipes, Sockets and more
kprint πŸ”’
Kernel Print: the [macros!] macro, kernel serial logging, kernel log ringbuffer and more
lib πŸ”’
Shared kernel lib: IrqMutex, FmtBuffer, AlignedStack, panic codes and more
mm πŸ”’
Memory subsystem: physical memory manager, virtual memory manager, and heap allocator.
net πŸ”’
Networking
sched πŸ”’
Scheduler, ELF loading and more
state πŸ”’
Global kernel state: [KState] aggregate and [KStateSubCategory] trait.
syscall πŸ”’
Syscalls
vfs πŸ”’
The VFS subsystem; creates and managed VFS namespaces like fs:/, dev:/, …

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.
knotice
Log a line at notice severity.
kwarn
Log a line at warning severity.

StructsΒ§

AlignedBytes πŸ”’
BootInfo πŸ”’
Standardized Boot Info passed to kernel_main
FramebufferInfo πŸ”’
Bootloader-provided info for constructing the basic framebuffer
VirtAddr πŸ”’
A type representing virtual addresses in the CPU’s virtual address space

EnumsΒ§

PanicCode πŸ”’
SpawnError πŸ”’
Indicates an error when attempting to spawn a new process

ConstantsΒ§

USER_BINARY_LEN πŸ”’

StaticsΒ§

KSTATE πŸ”’
SIMPLE_STATE πŸ”’
Data structure for keeping the serial UART logger and basic_fb fb resources for early boot and panic The default initializations should not contain any non-null value in order for SIMPLE_STATE to be able to live in .bss to reduce binary size
USER_BINARY
USER_BINARY_ALIGNED πŸ”’

FunctionsΒ§

basic_fb_init πŸ”’
Initializes the Basic Framebuffer
kernel_main πŸ”’
Abstract kernel entry point, called from the per-arch entry
kernel_panic πŸ”’
Halt the kernel with a diagnostic message; re-entrant calls skip straight to the halt loop.
spawn_from_elf πŸ”’ ⚠
Spawn a new process, returning its PID