tpt-kernel

Rust

A modern, capability-based microkernel written in 100% Rust (no_std), designed for minimal trusted computing base, zero ambient authority, and strict permissive licensing (MIT OR Apache-2.0).

0 stars0 forks0 watchersApache License 2.0
capability-based-securitykernelmicrokernelno-stdosdevrust

Languages

Rust99.7%Shell0.2%Linker Script0.1%Dockerfile0.1%
README

tpt-k

tpt-k is a capability-based microkernel written in Rust. The kernel does only what must run in privileged mode: memory, scheduling, IPC, capability tables and interrupt routing. Drivers, the root server and services run in user space and get their authority from capabilities.

It is a project by TPT Solutions, dual-licensed under MIT OR Apache-2.0. The design is in spec.txt.

Quickstart

You need a stable Rust toolchain. The repo pins 1.95.0 in rust-toolchain.toml, so rustup installs it on first use.

# 1. Targets for the bare-metal kernel and the UEFI loader
rustup target add x86_64-unknown-none x86_64-unknown-uefi

# 2. Sibling TPT repositories that the crates use by path
scripts/fetch-deps.sh

# 3. Check the machine; prints the fix for anything missing (run from the repo root)
cargo run -q -p tpt-k-toolchain --bin tpt-k-build -- doctor

# 4. Local gate: fmt, clippy (warnings denied), host tests, assurance gate, license gate
scripts/check.sh

# 5. Boot the kernel in QEMU and check the serial output (needs QEMU and OVMF)
scripts/qemu-smoke.sh

scripts/check.sh is the quick local subset of CI. The QEMU smoke test is the end-to-end check for kernel and loader changes. The developer guide in docs/developer-guide.md covers prerequisites, writing a crate and the review workflow.

Layers

The repo is one Cargo workspace. Each crate is named tpt-k-<layer>[-<part>] and belongs to one layer.

LayerRoleRuns in
bootUEFI loader; builds the handoff recordUEFI firmware
kernelMicrokernel core: frames, page tables, scheduler, IPC, capabilities, x86_64 archring 0
rootFirst user process; creates, grants and revokes capabilitiesuser space
halParsers for ACPI, FDT, PCI and USB descriptorsuser space
ipcClient and server framework, capability tokens, serialisationuser space
driversRestart policy, NVMe, VirtIO and USB HID encodingsuser space
userlandShell, libc core, network codecs, filesystem bridgeuser space
toolchaintpt-k-build: plans cargo commands, checks the toolchain, boots the image in QEMU, and runs the assurance gatehost

Per-layer notes are in docs/layers/, and the checklist for each layer is in docs/todos/.

Status

AreaState
UEFI loader and kernel boot in QEMUWorking; checked by the QEMU smoke test
Memory, page tables, address spacesWorking in the kernel; boot memory map used
SchedulingTimer-driven round-robin; priority queue host-tested, not yet wired in
IPC and capabilitiesWorking in the kernel: endpoints, grant, revoke, memory objects (map, unmap, free)
Drivers and root serverNot running yet; the parts are host-tested libraries
ShellHost-tested REPL; external programs are not started yet
Parsers (ACPI, PCI, FDT, USB, FAT32, ELF, GPT, network)Host-tested, with mutation tests
AArch64Not started
Real hardwareNot tested

todo.md is the authoritative list of what is open. Before a release, docs/release.md describes the steps and the assurance report at docs/assurance/report.md lists what is proven and what is only tested.

Contributing

See CONTRIBUTING.md. Contributions are licensed under the same dual license.