Repository Map
This map names the main source locations for the current system. It is not an ownership file; use it to find the code behind architecture and validation claims.
Root Files
README.mdgives the compact project overview.ROADMAP.mdrecords long-range stages and broad feature direction.WORKPLAN.mdrecords the current selected milestone and implementation ordering.REVIEW_FINDINGS.mdrecords open review findings and verification history.REVIEW.mddefines review expectations.Makefilebuilds pinned tools, userspace binaries, manifests, ISO images, QEMU targets, formatting checks, generated-code checks, and policy checks.rust-toolchain.tomlpins the Rust toolchain..cargo/config.tomlsets the default bare-metal target and useful cargo aliases.
Schema and Shared ABIs
schema/capos.capnpdefines capability interfaces, manifest structures, exceptions, ProcessSpawner, ProcessHandle, and transfer-related schema.capos-config/src/manifest.rsdefines the host and no_std manifest model.capos-config/src/ring.rsdefinesCapRingHeader, SQE/CQE structures, opcodes, flags, and transport error constants shared by kernel and userspace.capos-config/src/capset.rsdefines the read-only bootstrap CapSet ABI.capos-config/src/cue.rssupports evaluated CUE-style manifest data.capos-config/tests/ring_loom.rsmodels bounded ring protocol behavior with Loom.
Validation: cargo test-config, cargo test-ring-loom,
make generated-code-check.
Shared Pure Logic
capos-lib/src/elf.rsparses ELF64 images for kernel loading and host tests.capos-lib/src/cap_table.rsimplementsCapId, capability-table storage, stale-generation checks, grant preparation, transfer transaction helpers, commit, and rollback.capos-lib/src/frame_bitmap.rsimplements the host-testable physical frame bitmap core.capos-lib/src/frame_ledger.rstracks outstanding FrameAllocator grants.capos-lib/src/lazy_buffer.rsprovides bounded lazy buffers used by ring scratch paths.
Validation: cargo test-lib, cargo miri-lib, make kani-lib, fuzz targets
under fuzz/fuzz_targets/.
Kernel
kernel/src/main.rsis the boot entry point, hardware setup sequence, manifest parsing path, and boot-launched service creation path.kernel/src/spawn.rsloads user ELF images, creates process state, maps bootstrap pages, and enqueues spawned processes.kernel/src/process.rsdefinesProcess, process states, kernel stacks, and initial userspace CPU context.kernel/src/sched.rsimplements the single-CPU scheduler, timer-driven preemption, blockingcap_enter, direct IPC handoff, and deferred cancellation wakeups.kernel/src/serial.rsimplements COM1 output and kernel print macros.kernel/src/pci.rsimplements the current QEMU virtio-net PCI enumeration smoke path.
Validation: cargo build --features qemu, make run, make run-spawn,
make run-net.
Kernel Architecture
kernel/src/arch/x86_64/gdt.rssets up kernel/user segments and TSS state.kernel/src/arch/x86_64/idt.rshandles exceptions and timer interrupts.kernel/src/arch/x86_64/syscall.rsimplements syscall MSR setup and entry.kernel/src/arch/x86_64/context.rsdefines timer context-switch state.kernel/src/arch/x86_64/pic.rsandpit.rsconfigure legacy interrupt hardware.kernel/src/arch/x86_64/smap.rsenables SMEP/SMAP and brackets user memory access.kernel/src/arch/x86_64/tls.rshandles FS-base/TLS support.kernel/src/arch/x86_64/pci_config.rsprovides legacy PCI config I/O.
Kernel Memory
kernel/src/mem/frame.rswraps the shared frame bitmap with Limine memory map initialization and global kernel access.kernel/src/mem/paging.rsmanages page tables, address spaces, permissions, user mappings, W^X enforcement, and address-space teardown.kernel/src/mem/heap.rsinitializes the kernel heap.kernel/src/mem/validate.rsvalidates user buffers before kernel access.
Related docs: DMA Isolation, Trusted Build Inputs.
Kernel Capabilities
kernel/src/cap/mod.rsinitializes kernel capabilities and resolves manifest service capability tables.kernel/src/cap/table.rsre-exports shared capability-table logic and owns the kernel-global table.kernel/src/cap/ring.rsvalidates and dispatches ring SQEs.kernel/src/cap/transfer.rsvalidates transfer descriptors and prepares transfer transactions.kernel/src/cap/endpoint.rsimplements Endpoint CALL, RECV, RETURN, queued state, cleanup, and cancellation behavior.kernel/src/cap/console.rsimplements serial Console.kernel/src/cap/frame_alloc.rsimplements FrameAllocator.kernel/src/cap/virtual_memory.rsimplements per-process anonymous memory operations.kernel/src/cap/process_spawner.rsimplements ProcessSpawner and ProcessHandle.kernel/src/cap/null.rsimplements the measurement-only NullCap.
Related docs: Capability Model, Authority Accounting.
Userspace
init/is the standalone init process. In the spawn smoke, it uses ProcessSpawner, grants initial child capabilities, waits on ProcessHandles, and checks hostile spawn inputs.capos-rt/src/entry.rsowns the runtime entry path and bootstrap validation.capos-rt/src/alloc.rsinitializes the userspace heap.capos-rt/src/syscall.rsprovides raw syscall wrappers.capos-rt/src/capset.rsprovides typed CapSet lookup helpers.capos-rt/src/ring.rsimplements the safe single-owner ring client, out-of-order completion handling, transfer descriptor packing, and result-cap parsing.capos-rt/src/client.rsimplements typed clients for Console, ProcessSpawner, and ProcessHandle.capos-rt/src/bin/smoke.rsis the runtime smoke binary packaged by the default manifest.
Validation: make capos-rt-check, make run, make run-spawn.
Demo Services
demos/ is a nested userspace smoke-test workspace. Each demo is a release-built
service binary packaged into the boot manifest:
capset-bootstrapconsole-pathsring-corruptionring-reserved-opcodesring-nopring-fairnessunprivileged-strangertls-smokevirtual-memoryframe-allocator-cleanupendpoint-roundtripipc-serveripc-client
Shared demo support lives in demos/capos-demo-support/src/lib.rs.
Validation: make run, make run-spawn.
Manifest and Tooling
system.cueis the default manifest source.system-spawn.cueis the ProcessSpawner smoke manifest source.tools/mkmanifest/evaluates manifest input, embeds binaries, validates manifest shape, and writes Cap’n Proto bytes.tools/check-generated-capnp.shverifies checked-in generated schema output.tools/qemu-net-harness.shruns the current QEMU net harness.fuzz/contains fuzz targets for manifest Cap’n Proto decoding, mkmanifest JSON conversion/validation, and ELF parsing.
Validation: cargo test-mkmanifest, make generated-code-check,
make fuzz-build, make fuzz-smoke.
Documentation
docs/capability-model.mdis the current capability architecture reference.docs/*-design.mdfiles record targeted implemented or accepted designs.docs/proposals/contains accepted, future, exploratory, and rejected designs.docs/research.mdanddocs/research/summarize prior art.docs/proposals/mdbook-docs-site-proposal.mddefines the documentation site structure and status vocabulary used by these Start Here pages.