A structured microkernel written in Rust for COMP 512. Implements capability-based security, SMP scheduling, IPC message
passing, and resource domains using onion architecture with strict layer separation. All library crates are #![no_std]
with zero external dependencies. Boots on QEMU via Multiboot1.
mkernel_domain Pure types, no logic
^
mkernel_services Trait definitions (16 traits, 76 methods)
^ ^ ^
mkernel_infra mkernel_hal mkernel_kernel
\ | / \
+-------+------+------+ \
mkernel_boot mkernel_bare
(std, dev/test) (bare-metal, x86_64-unknown-none)
| Crate | Role |
|---|---|
mkernel_domain |
Types only (ThreadId, Message, Capability, KernelError, etc.) |
mkernel_services |
All trait definitions: 6 infra + 4 HAL + 6 orchestration |
mkernel_infra |
Infra implementations (thread manager, scheduler, IPC, capabilities, memory, resource domains) |
mkernel_hal |
HAL implementations (timer, context switch, memory mapping, interrupt controller) |
mkernel_kernel |
Orchestration implementations (thread lifecycle, preemption, IPC orchestration, capability gate, resource enforcement, memory orchestration) |
mkernel_boot |
Host-side binary with full demo scenario and logging |
mkernel_bare |
Bare-metal binary for x86_64, boots on QEMU |
Traits in the same layer are mutually exclusive -- they cannot depend on each other. The layer above orchestrates them.
# Run all tests (123 tests)
make test
# Build workspace crates
make buildPrerequisites: rustup target add x86_64-unknown-none, QEMU, and objcopy.
# Build and run
make bare-run
# With GDB server
make bare-debugPress Ctrl+C to stop QEMU.
cargo run -p mkernel_bootRuns a simulated 9-phase scenario (domain setup, thread spawn, IPC, preemption, budget enforcement, memory management, teardown) with formatted event logging.