A capability-based microkernel with WebAssembly sandboxing
Features β’ Quick Start β’ Architecture β’ Benchmarks β’ Docs
JerichoOS is a research microkernel built in Rust (no_std) exploring capability-based security and WebAssembly isolation in bare-metal environments. It runs untrusted WASM modules with fine-grained access control, demonstrating how modern sandboxing can work at the kernel level.
- Capability Security: Fine-grained access control for kernel services
- Memory Safe: Rust with
unsafecontained to narrow, audited boundaries - WASM Runtime: Run untrusted code safely using
wasmiinterpreter - Dual Architecture: Unified codebase for x86-64 and ARM64
- Research-Focused: Designed for learning and experimentation
|
Security
|
Runtime
|
Portability
|
| Component | x86-64 | ARM64 | Notes |
|---|---|---|---|
| Kernel Boot | β | β | QEMU virt machine |
| WASM Runtime | β | β | wasmi 0.31 |
| Demo Suite | β | β | 5 demos passing |
| Capability System | β | β | IPC enforcement working |
| Scheduler | β | β | Preemptive multitasking |
| CI/CD | β | β | GitHub Actions |
Latest Verification: October 19, 2026 ... both demo suites pass on QEMU 8.2.2
# Install Rust nightly toolchain
rustup toolchain install nightly
rustup component add rust-src llvm-tools-preview
# Install QEMU
# Ubuntu/Debian:
sudo apt install qemu-system-x86 qemu-system-arm
# macOS:
brew install qemu./demo_x86.sh./demo_arm64.shExpected Output:
β Demo 1: Pure Computation PASS
β Demo 2: Host Function Calls PASS
β Demo 3: Syscall & Capability PASS
β Demo 4: MQTT Broker Pub/Sub PASS
β Demo 5: Security & Isolation PASS
RESULT: PASS
ββββββββββββββββββββββββββββββββββββββββββββββ
β WASM Modules (Sandboxed) β
β βββββββββββββ ββββββββββββ ββββββββββββ β
β β mqtt.wasm β β app.wasm β β test.wasmβ β
β βββββββββββββ ββββββββββββ ββββββββββββ β
βββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββΌβββββββββββ
β wasmi Interpreter β
β (Host Bridge) β
βββββββββββ¬βββββββββββ
β
βββββββββββΌβββββββββββββ
β Capability Checker β
β (Access Control) β
βββββββββββ¬βββββββββββββ
β
βββββββββββΌβββββββββββββ
β Syscall Layer β
β IPC β’ Print β’ MQTT β
βββββββββββ¬βββββββββββββ
β
βββββββββββΌβββββββββββββ
β Scheduler Core β
β Memory β’ Interrupts β
βββββββββββ¬βββββββββββββ
β
βββββββββββΌββββββββββββ
β Architecture Layer β
β x86-64 β ARM64 β
βββββββββββββββββββββββ
- WASM Runtime: Sandboxed execution environment with
wasmiinterpreter - Capability System: Token-based access control for kernel resources
- IPC Layer: Message passing between isolated modules
- Scheduler: Cooperative/preemptive task switching
- Architecture Abstraction: Shared kernel logic across x86-64 and ARM64
The kernel includes five demonstration programs showcasing core features:
| Demo | Description | Key Features |
|---|---|---|
| 1. Pure Computation | Arithmetic operations in WASM | Basic execution, stack operations |
| 2. Host Functions | Calling kernel services | Host bridge, print syscalls |
| 3. Syscall & Capability | Protected resource access | Capability checks, syscall dispatcher |
| 4. MQTT Pub/Sub | Message broker simulation | IPC, multi-module coordination |
| 5. Security | Isolation enforcement | Sandbox escapes, unauthorized IPC |
Measured in QEMU TCG with a calibrated clock (TSC vs PIT on x86-64, CNTFRQ on ARM64):
| x86-64 | ARM64 | |
|---|---|---|
| Capability syscall (derive/revoke) | ~210-245 ns | ~250-290 ns |
| IPC send + receive, 64 B | ~1.1-1.2 Β΅s | ~1.4 Β΅s |
| Context switch | ~260-370 ns | ~370-590 ns |
| Boot (kernel entry to ready) | ~16-19 ms | ~1 ms |
See BENCHMARKS.md for exactly what each line times.
jerichoos/
βββ src/
β βββ main.rs, main_aarch64.rs # thin entry points, one per architecture
β βββ kernel.rs # shared boot sequence, heap, panic handler
β βββ arch/x86_64/ # GDT/TSS, IDT + PIC + PIT, paging + heap, TSC, context switch
β βββ arch/aarch64/ # boot.S, vectors, GIC, timer, MMU, context switch
β βββ scheduler.rs # round-robin, cooperative + timer preemption
β βββ sync.rs # irq-safe spinlock
β βββ capability.rs # rights, capabilities, CSpace
β βββ ipc.rs # capability-checked endpoints, blocking receive, cap transfer
β βββ syscall.rs # 5-call capability syscall dispatcher
β βββ wasm_runtime.rs # wasmi + the 7 host functions
β βββ benchmark.rs # measured benchmarks (see BENCHMARKS.md)
β βββ demos/ # 5 WASM demos + the kernel tasks
βββ demos/wasm/ # WASM modules (.wat sources + vendored .wasm)
βββ .github/workflows/ # CI pipelines
βββ demo_x86.sh, demo_arm64.sh, bench_x86.sh, bench_arm64.sh
βββ docs/ # project status and known limitations
# x86-64 kernel (two passes: build.rs creates boot images once the kernel binary exists)
cargo build --bin jericho_os --release --features bootloader-build
touch build.rs
cargo build --bin jericho_os --release --features bootloader-build
# ARM64 kernel
./build_arm64.shBefore committing, ensure all checks pass:
# Build verification
cargo check --bin jericho_os --release
cargo check --bin jericho_os_arm64 --release \
--target aarch64-jericho.json \
-Z build-std=core,compiler_builtins,alloc
# Run test suites
./demo_x86.sh && ./demo_arm64.sh- No user mode: syscalls are function calls from kernel tasks or the WASM bridge; WASM linear memory is the isolation boundary
- Revocation: removes one capability slot; there is no derivation tree, so derived copies survive
- Memory Management: x86-64 extends the bootloader's tables for the heap; ARM64 is an identity map with 2 MB blocks
- MQTT Demos: broker and publisher are vendored prebuilt
.wasmexample modules; the subscriber is built from.watin this repo (seedemos/wasm/README.md)
See PROJECT_STATUS.md for the full list of limitations.
- Project Status β Current capabilities and known issues
- Benchmarks β What each benchmark measures and its limits
JerichoOS is a research/learning project. Contributions are welcome for:
- Bug fixes and stability improvements
- Documentation enhancements
- Performance optimizations
- Architecture-specific improvements
Please ensure all quality gates pass before submitting PRs.
MIT License - See LICENSE for details.
Built with:
- Rust β Memory-safe systems programming
- wasmi β WebAssembly interpreter
- QEMU β Hardware emulation
Special thanks to the Rust embedded and OS dev communities.
Made with π¦ by BashfulHippo