How abdelhalimyasser/lettuceos works
Lettuce is a research ARM64 microkernel. Its principal workflow is an EL0 service making a mediated call: the supervisor validates the caller’s capability and target, dispatches the operation, and switches protection context for execution. The graph also preserves the documented scheduling, POSIX-lite, memory-sharing, and Rust-runtime branches. Some subsystem links are based on README descriptions because their implementation files were not excerpted.
Main entry points: call.c Cross-Layer Gate · scheduler.c Scheduler Mechanism · capability.c Capability Table · gate.c Same-Layer Gate
Components 20
Mediated IPC
- Same-Layer Gate
ipc/same_layer/gate.c - Cross-Layer Gate
ipc/cross_layer/call.c - Elevator Gate
ipc/elevator/elevator.c
Supervisor Kernel
- Capability Table
kernel/main/capability.c - Service Dispatch
kernel/main/dispatch.c - Execution Context
kernel/main/context.c - Domain Protection
kernel/main/protection.c
ARM64 Platform
- MMU and ASIDs
kernel/arch/arm64/mmu.c - Pointer Authentication
kernel/arch/arm64/cpu.c - Platform Initialization
kernel/arch/arm64/main.c
User Runtimes
- C Call Wrappers
runtime/c/same_layer_call.c - Rust SDK
runtime/rust/src/service.rs - POSIX-lite
runtime/posix/src/posix.c
Memory and Scheduling
- Shared Buffers
memory/shared/buffer.c - Fixed Allocator
memory/allocator/fixed.c - Scheduler Mechanism
kernel/scheduler/scheduler.c - Round-Robin Policy
kernel/scheduler/rr.c - EEVDF Policy
kernel/scheduler/eevdf.c
Other components
- EL0 Service
- ARM64 Hardware
Connections 25
- EL0 Service → C Call Wrappers: invokes
- Rust SDK → C Call Wrappers: calls ABI
runtime/rust/src/service.rs - C Call Wrappers → Same-Layer Gate: requests call
- EL0 Service → Cross-Layer Gate: requests call
- EL0 Service → Elevator Gate: requests call
- Same-Layer Gate → Capability Table: checks rights
- Cross-Layer Gate → Capability Table: checks rights
ipc/cross_layer/call.c - Elevator Gate → Capability Table: authorizes first
- Same-Layer Gate → Service Dispatch: dispatches target
- Cross-Layer Gate → Service Dispatch: dispatches target
- Elevator Gate → Service Dispatch: dispatches target
- Cross-Layer Gate → Execution Context: preserves continuation
- Execution Context → Domain Protection: enters domain
kernel/main/context.c - Domain Protection → MMU and ASIDs: switches domain
- MMU and ASIDs → ARM64 Hardware: configures translation
- Pointer Authentication → ARM64 Hardware: signs continuations
- POSIX-lite → EL0 Service: issues syscalls
- EL0 Service → Shared Buffers: shares buffers
- Shared Buffers → Capability Table: checks access
memory/shared/buffer.c - Fixed Allocator → ARM64 Hardware: allocates memory
- Platform Initialization → ARM64 Hardware: initializes platform
- Platform Initialization → Scheduler Mechanism: starts scheduling
kernel/arch/arm64/main.c - Scheduler Mechanism → Round-Robin Policy: selects policy
kernel/scheduler/scheduler.c - Scheduler Mechanism → EEVDF Policy: selects policy
kernel/scheduler/scheduler.c - Scheduler Mechanism → MMU and ASIDs: enters task domain
kernel/scheduler/scheduler.c