Clan OS is an experimental operating system written in Rust, built from the ground up to explore modern kernel architecture, low-level hardware control, and safe systems programming.
Named for the idea of a shared craft — building a system together with intention — the project represents strength, control, and raw system power: a developer should fully understand and command the machine they use.
Clan OS is both a learning platform and a long-term experimental system, focused on transparency, performance, and deep system knowledge.
Clan OS follows a simple belief:
The best way to understand a computer is to build the system that runs it.
Modern operating systems hide enormous complexity behind layers of abstraction. Clan OS instead embraces that complexity and exposes how systems truly work.
The project focuses on:
- Understanding the machine
- Writing software close to the hardware
- Designing systems intentionally rather than inheriting legacy design
Rust provides the safety guarantees needed to build such a system without sacrificing performance.
Clan OS draws inspiration from several legendary operating system projects.
One of the strongest influences is TempleOS, created entirely by Terry A. Davis.
TempleOS demonstrated what a single determined developer could achieve by building a complete operating system from scratch. Its bold philosophy and uncompromising approach to system design helped inspire many modern hobby OS projects.
While Clan OS follows a different technical path—using Rust and modern system architecture—it shares the same spirit of deep curiosity, independence, and exploration of computing at the lowest level.
Other inspirations include:
- Linux
- Redox OS
- Minix
Clan OS aims to become a small but powerful experimental operating system that demonstrates:
- modern kernel design
- memory-safe systems programming
- transparent system behavior
- efficient hardware interaction
The project also serves as a long-term exploration of operating system engineering.
- Rust bare-metal kernel
- interrupt handling
- memory management
- virtual memory and paging
- keyboard input
- timer interrupts
- device driver framework
- modular kernel design
- multitasking scheduler
- kernel logging and debugging
- filesystem support
- disk drivers
- persistent storage
- terminal shell
- system utilities
- process management tools
Runtime validation uses a unified validation gate — not per-scope numbered boot serial lines.
| Gate | Module | Final serial line |
|---|---|---|
| Unified | kernel/src/validation_gate.rs |
ClanOS-Gate: ok=true |
Full reference: docs/VALIDATION_GATES.md
python scripts/gate/run.py --gate all --timeout 360Per-scope entries below document completed implementation scope. CI and QEMU smokes use the gates above.
- freestanding Rust kernel
- bootloader integration
- basic screen output
Status: ✅ Complete (validated 2026-03-17)
Checklist: docs/scope-1-checklist.md
- interrupt descriptor table
- keyboard driver
- timer interrupts
Status: ✅ Complete (validated 2026-03-17)
Checklist: docs/scope-2-checklist.md
- paging implementation
- frame allocator
- heap allocation
Status: ✅ Complete (validated 2026-03-17)
Checklist: docs/scope-3-checklist.md
- multitasking scheduler
- context switching
- task management
Status: ✅ Complete (validated 2026-03-17, cooperative async; context switching in context-lab mode)
Checklist: docs/scope-4-checklist.md
- preemptive scheduler mode (
preemptionfeature) - process abstraction + PID allocator
- fairness telemetry and preemption observability
Status: ✅ Complete (validated 2026-05-06)
Checklist: docs/scope-5-checklist.md
Scheduler deep dive: docs/SCHEDULER.md
- command shell
- system utilities
- basic programs
Status: ✅ Complete (validated 2026-05-06; shell + utilities + syscall/storage baseline)
Checklist: docs/scope-6-checklist.md
- block-device storage boundary
- simple persistent filesystem format
- shell and syscall file operations
Status: ✅ Complete (validated 2026-05-13; remount persistence + QEMU storage smoke)
Checklist: docs/scope-7-checklist.md
Storage deep dive: docs/STORAGE.md
- device registry and PCI discovery skeleton
- block-device manager
- QEMU-friendly driver-backed storage path
Status: ✅ Complete (validated 2026-05-13; device/block smoke + storage-through-manager)
Checklist: docs/scope-8-checklist.md
Device deep dive: docs/DEVICES.md
- executable manifest format
/bin/*program discovery- file-backed launch path for built-in program entries
Status: ✅ Complete (validated 2026-05-13; stored manifests + loader smoke)
Checklist: docs/scope-9-checklist.md
Program loader deep dive: docs/PROGRAMS.md
- static users, roles, and credential model
- file owner/mode metadata with checked shell/syscall operations
- executable trust fields and process ownership policy
Status: ✅ Complete (validated 2026-05-13; permission denial + process ownership smoke)
Checklist: docs/scope-10-checklist.md
Security deep dive: docs/SECURITY.md
- conservative ELF64 image validation
- descriptor-only address-space and virtual-region model
- image manifest discovery without unsafe binary execution
Status: ✅ Complete (validated 2026-05-13; image validation + unsupported execution smoke)
Checklist: docs/scope-11-checklist.md
Executable image deep dive: docs/EXECUTABLE_IMAGES.md
- page-aligned executable load plans
- copy and zero-fill action accounting
- frame/page reservation metadata without page-table mutation
Status: ✅ Complete (validated 2026-05-13; load-plan preparation + execution-block smoke)
Checklist: docs/scope-12-checklist.md
Load-plan deep dive: docs/LOAD_PLANS.md
- deterministic mapping-stub records for prepared load plans
- frame-token, copy-byte, and zero-fill accounting
- mapped-stub process metadata without executable scheduling
Status: ✅ Complete (validated 2026-05-13; mapping-stub smoke + execution-block preservation)
Checklist: docs/scope-13-checklist.md
Mapping-stub deep dive: docs/MAPPING_STUBS.md
- persistent frame ownership registry
- bounded physical-frame accounting after heap initialization
- frame allocation/release counters for future executable backing
Status: ✅ Complete (validated 2026-05-13; frame ownership smoke)
Checklist: docs/scope-14-checklist.md
Frame ownership deep dive: docs/FRAME_OWNERSHIP.md
- frame-backed image records for mapped executable pages
- owned-frame consumption from the Scope 14 registry
- copy and zero-fill accounting attached to backed pages
Status: ✅ Complete (validated 2026-05-13; frame-backed image smoke)
Checklist: docs/scope-15-checklist.md
Frame-backed image deep dive: docs/FRAME_BACKED_IMAGES.md
- inactive user page-table descriptors for frame-backed images
- virtual-to-physical translation validation
- blocked
PageTableReadyprocess metadata without CR3 switching
Status: ✅ Complete (validated 2026-05-13; inactive page-table smoke)
Checklist: docs/scope-16-checklist.md
User page-table deep dive: docs/USER_PAGE_TABLES.md
- GDT user code/data selectors
- initial user entry frame and stack descriptors
- blocked
UserContextReadyprocess metadata without Ring 3 entry
Status: ✅ Complete (validated 2026-05-13; user-context smoke)
Checklist: docs/scope-17-checklist.md
User context deep dive: docs/USER_CONTEXT.md
- controlled user-entry/trap result records
- reserved user trap vector metadata
- blocked
UserTrappedprocess metadata
Status: ✅ Complete (validated 2026-05-13; controlled Ring 3 trampoline smoke)
Checklist: docs/scope-18-checklist.md
Ring 3 trampoline deep dive: docs/RING3_TRAMPOLINE.md
- user syscall register-frame ABI
- syscall dispatch return metadata
- blocked
UserSyscallReturnedprocess metadata
Status: ✅ Complete (validated 2026-05-13; syscall return smoke)
Checklist: docs/scope-19-checklist.md
User syscall deep dive: docs/USER_SYSCALLS.md
- guarded
/bin/helloELF execution path - deterministic output and exit status for
run hello - blocked
UserElfExitedprocess metadata
Status: ✅ Complete (validated 2026-05-13; user ELF smoke)
Checklist: docs/scope-20-checklist.md
User ELF MVP deep dive: docs/USER_ELF_MVP.md
- real x86_64 page tables from inactive descriptors
- descriptor vs hardware translation verification
- blocked
HwPageTableReadyprocess metadata
Checklist: docs/scope-21-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- activate and restore user CR3 without execution
- translation verification under switched page tables
- blocked
Cr3Activatedprocess metadata
Checklist: docs/scope-22-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- CPU Ring 3 entry via
iretqto a controlled stub - return through invalid-opcode trap during bring-up
- blocked
UserEnteredHwprocess metadata
Checklist: docs/scope-23-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- IDT vector
0x80handler for cooperative user return - blocked
UserHwTrappedprocess metadata
Checklist: docs/scope-24-checklist.md
Status: ✅ Complete (validated 2026-05-22)
syscall/sysretMSRs and entry stub- hardware tick-probe syscall path
- blocked
UserHwSyscallReturnedprocess metadata
Checklist: docs/scope-25-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- bounded
copy_from_user/copy_to_user - copy-probe syscall round-trip
Checklist: docs/scope-26-checklist.md
Status: ✅ Complete (validated 2026-05-22)
R_X86_64_RELATIVE/R_X86_64_64for seeded images- relocation accounting during frame backing
Checklist: docs/scope-27-checklist.md
Status: ✅ Complete (validated 2026-05-22)
run hellothrough hardware Ring 3 + syscall path- blocked
UserHwElfExitedprocess metadata
Checklist: docs/scope-28-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- allowlisted
helloandexit42ELF programs - seeded manifests and images
Checklist: docs/scope-29-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- save/restore distinct user CR3 values
- isolation verification across switches
Checklist: docs/scope-30-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- CR3 binding on process records and preemptive context switch
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-31-checklist.md
Status: ✅ Complete (validated 2026-05-22)
Scheduler deep dive: docs/SCHEDULER.md
- saved
UserHwFrameacross scheduler yield - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-32-checklist.md
Status: ✅ Complete (validated 2026-05-22)
helloandexit42under distinct hardware page tables- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-33-checklist.md
Status: ✅ Complete (validated 2026-05-22)
ExitProcess/WaitProcesssyscalls- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-34-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- allowlisted hardware syscall IDs
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-35-checklist.md
Status: ✅ Complete (validated 2026-05-22)
User syscall deep dive: docs/USER_SYSCALLS.md
- storage probe syscalls with validated user copies
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-36-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- discover
elf64-imagemanifests; gated execution includingtickprobe - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-37-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- user
#PFhandler and demand-zero mapping - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-38-checklist.md
Status: ✅ Complete (validated 2026-05-22)
Demand paging deep dive: docs/DEMAND_PAGING.md
DT_NEEDEDdetection for CLAN seed ELFs- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-39-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- end-to-end validation of scopes 31–39
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-40-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- map
libc_stubdependency at0x700000whenDT_NEEDEDis present - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-41-checklist.md
Status: ✅ Complete (validated 2026-05-22)
Shared library deep dive: docs/SHARED_LIBRARIES.md
R_X86_64_GLOB_DATimports against mapped shared library- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-42-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- run
trust=systemmanifests without name allowlist (systrustfixture) - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-43-checklist.md
Status: ✅ Complete (validated 2026-05-22)
ReadPathProbesyscall with validated user paths- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-44-checklist.md
Status: ✅ Complete (validated 2026-05-22)
OpenFile/CloseFilesyscalls with bring-up FD table- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-45-checklist.md
Status: ✅ Complete (validated 2026-05-22)
File I/O deep dive: docs/FILE_DESCRIPTORS.md
ReadFd/WriteFdwith validated user buffers- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-46-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- demand-map file pages from storage on user
#PF - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-47-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- reject writable+executable user page flags
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-48-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- CPU count detection, AP accounting, TLB flush hooks
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-49-checklist.md
Status: ✅ Complete (validated 2026-05-22)
SMP deep dive: docs/SMP.md
- end-to-end validation of scopes 41–49
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-50-checklist.md
Status: ✅ Complete (validated 2026-05-22)
- FD tables stored on
Process;current_process_idfrom CR3 - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-51-checklist.md
DupFdsyscall; per-processcwd; relativeOpenFile- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-52-checklist.md
Mprotectsyscall within W^X; stack guard probe- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-53-checklist.md
- anonymous RW at
0x600000; read-only file mmap - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-54-checklist.md
WritePathProbesyscall; storage round-trip smoke- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-55-checklist.md
/lib/*.elfsearch;libc_stub+libaux_stubmapping- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-56-checklist.md
R_X86_64_JUMP_SLOTbinding; covered by validation gatedynamic_runtime
Checklist: docs/scope-57-checklist.md
digest=sha256:manifest field; SHA-256 verification- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-58-checklist.md
- BSP runqueue accounting on preempt; APs remain parked
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-59-checklist.md
- cumulative validation of scopes 51–59
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-60-checklist.md
Chdirsyscall; collapse..in resolved paths- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-61-checklist.md
Munmapsyscall; TLB shootdown on unmap- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-62-checklist.md
- region list on
Process; mmap overlap rejection - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-63-checklist.md
ForkLitesyscall; shallow-copy FD table and cwd- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-64-checklist.md
- hardware
syscallpath forWritePathProbe/Mprotect - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-65-checklist.md
F_GETFDandF_DUPFDviaFcntlsyscall- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-66-checklist.md
- defer
R_X86_64_JUMP_SLOTuntilbind_lazy_plt - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-67-checklist.md
- per-CPU shootdown counters on unmap/map flush
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-68-checklist.md
- parked AP idle tick counter under QEMU
-smp 2 - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-69-checklist.md
- cumulative validation of scopes 61–69
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-70-checklist.md
- hardware
syscallstub withsysretback to user - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-71-checklist.md
Chdirsyscall from Ring 3 HW path with user path pointer- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-72-checklist.md
Munmaparg1length; VMA truncate; TLB shootdown on unmap- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-73-checklist.md
WaitLite = 78waits for fork-lite child exit code- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-74-checklist.md
/bin/syscallprobemanifest; HW syscall probes- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-75-checklist.md
- per-FD flags with
FD_CLOEXEC - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-76-checklist.md
- lazy PLT bind under Ring 3 smoke flag
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-77-checklist.md
- logical IPI counters on
request_tlb_shootdown - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-78-checklist.md
- AP
hlttrampoline entry accounting - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-79-checklist.md
- cumulative validation of scopes 71–79
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-80-checklist.md
HW_SYSRET_REALcounter; HW probe viahw-sysret-probefeature on QEMU boot- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-81-checklist.md
GetCwd = 79copies process cwd to user buffer- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-82-checklist.md
/bin/chdirprobemanifest;Chdir+GetCwdsmoke- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-83-checklist.md
- middle
munmapsplits VMA registry (VMA_SPLITS) - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-84-checklist.md
- shallow
fork_duplicate_cr3for fork-lite child - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-85-checklist.md
ExecLite = 81replaces image; sweepsFD_CLOEXECfds- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-86-checklist.md
Pipe = 80; ring buffer; read/write on pipe fds- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-87-checklist.md
#PFat PLT slot triggers lazy bind under smoke flag- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-88-checklist.md
LAPIC_IPI_SENDon TLB shootdown request- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-89-checklist.md
- cumulative validation of scopes 81–89 counters (no nested re-run)
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-90-checklist.md
- anon page COW break after
fork_lite; parent/child write isolation smoke - Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-91-checklist.md
Poll = 82single-fd readiness on pipe fds- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-92-checklist.md
next_anon_hintfills lowest gap before high-water bump- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-93-checklist.md
- bounded argv copy from user pointer vector
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-94-checklist.md
/bin/pipeprobeseed; HW pipe +Pollpath underhw-sysret-probe- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-95-checklist.md
- merge adjacent anon VMAs on munmap boundary
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-96-checklist.md
- BSP steals from CPU1 runqueue counter when empty
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-97-checklist.md
- synthetic runnable enqueue on CPU1 without AP scheduler loop
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-98-checklist.md
- discard-backed ICR-low write counter (no real MMIO in QEMU tests)
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-99-checklist.md
- cumulative validation of scopes 91–99 counters (no nested re-run)
- Covered by validation gate (see VALIDATION_GATES.md)
Checklist: docs/scope-100-checklist.md
Scopes 1–100 answered whether the OS can exist. Scopes 101–110 freeze semantic constitutionalism: axioms, rights algebra, temporal visibility, IPC guarantees, governance gates G1–G5, and clan-semantics-v1 — before native implementation (111+).
Status: complete (validated 2026-05-25 — semantic lint + Scope 110 constitutional smoke)
Checklist index: docs/scope-101-checklist.md … docs/scope-110-checklist.md
Validation:
python scripts/semantic_lint.py
python scripts/gate/run.py --gate constitutional --timeout 300
Key guides:
- NATIVE_MODEL.md — post-Unix capability civilization
- AXIOMS.md — constitutional axioms A1–A10 (A7+A10 anti-entropy pair)
- ROADMAP_POST100.md — scopes 101–150 table
Kernel object table, native cap lifecycle (IDs 256+ kernel-only), storage grants, compat path broker, ambient/namespace policy, and cap+compat integration milestone.
Status: complete (validated — ClanOS-Gate: name=capabilities ok=true)
Checklist index: docs/scope-111-checklist.md … docs/scope-120-checklist.md
Validation:
cargo check -p kernel
cargo test -p kernel --features preemption --test preemption_integration
python scripts/gate/run.py --gate capabilities --timeout 300
Service loaders, brokers, endpoints, service-centric scheduling — see ROADMAP_POST100.md.
Status: complete (validated — ClanOS-Gate: name=boundary ok=true)
Epochs 7–20 through fully operational OS. See:
- ROADMAP_151_350.md — epochs 7–14 (release foundation)
- ROADMAP_351_400.md — desktop + userland + network
- ROADMAP_401_500.md — production SMP, signed ELF, external network
Status: complete (VALIDATION_GATE_VERSION = 2.1.0, unified validation_gate.rs)
Validation:
python scripts/gate/run.py --gate all --timeout 360
python scripts/gate/host.py
python scripts/gate/clan_rt.py
.\scripts\run_desktop.ps1
Full index: docs/INDEX.md · Gate reference: docs/VALIDATION_GATES.md
Clan OS
├── Cargo.toml workspace manifest
├── docs/ validation gates, guides, historical checklists (INDEX.md)
├── scripts/ validation gate checks + validation_matrix.py
├── kernel/
│ ├── Cargo.toml kernel crate manifest
│ ├── x86_64-unknown-none.json
│ ├── src/
│ │ ├── main.rs kernel entry + validation gate smokes
│ │ ├── lib.rs modules, init (GDT, IDT, SMP)
│ │ ├── storage.rs simple persistent filesystem
│ │ ├── security.rs identity + permission policy
│ │ ├── syscall.rs syscall IDs + dispatch
│ │ ├── device.rs device registry + PCI skeleton
│ │ ├── block.rs block-device manager
│ │ ├── exec_image.rs ELF64 image validation
│ │ ├── elf_reloc.rs static + GLOB_DAT relocations
│ │ ├── shared_loader.rs shared library mapping (scope 41)
│ │ ├── load_plan.rs executable load-plan accounting
│ │ ├── mapping_stub.rs mapping-stub records
│ │ ├── frame_ownership.rs frame ownership registry
│ │ ├── frame_backing.rs frame-backed image pages
│ │ ├── user_memory.rs inactive page-table descriptors
│ │ ├── user_paging.rs hardware page tables, CR3, W^X
│ │ ├── demand_paging.rs demand-zero + file-backed #PF
│ │ ├── user_context.rs user entry-frame descriptors
│ │ ├── user_entry.rs Ring 3 / iretq / syscall entry
│ │ ├── user_syscall.rs syscall ABI + copy helpers
│ │ ├── user_syscall_hw.rs hardware syscall/sysret path
│ │ ├── user_copy.rs validated user copies
│ │ ├── user_path.rs bounded user path copyin
│ │ ├── fd_table.rs per-process file descriptor table
│ │ ├── mmap.rs mmap bring-up (Scope 54)
│ │ ├── image_digest.rs SHA-256 manifest digests (Scope 58)
│ │ ├── smp.rs CPU detect, TLB hooks, runqueues
│ │ ├── ring3_trampoline.rs controlled user-entry traps
│ │ ├── task/ scheduler, loader, keyboard shell
│ │ └── performance/ metrics + profiler
│ └── tests/
│ └── preemption_integration.rs
└── .cargo/config.toml target + runner configuration
Install dependencies:
rustup component add llvm-tools-preview
cargo install bootimage
rustup component add rust-src
Install QEMU (example on Ubuntu/Debian):
sudo apt install qemu-system-x86
Install QEMU on Windows (winget):
winget install --id SoftwareFreedomConservancy.QEMU --accept-package-agreements --accept-source-agreements
Build the OS:
cargo build -p kernel
GitHub Actions (.github/workflows/ci.yml) runs cargo fmt --check and the full validation matrix on every push and pull request to main/master (Ubuntu, QEMU; expect roughly 4–6 hours):
python scripts/validation_matrix.py --soak-duration 30 --latency-duration 30 --boot-wait 90 --smoke-timeout 180
Run Clan OS using QEMU:
cargo run -p kernel
Run Clan OS in QEMU (interactive shell + desktop):
cargo run -p kernel
Preemption lab (CI fairness/latency telemetry — does not reach the shell):
cargo run -p kernel --features preemption
Serial telemetry: ClanOS-Preemption: name=fairness … and name=latency …
Integration tests:
cargo test -p kernel --features preemption --test preemption_integration
Preemption validation:
python scripts/preemption/soak.py --duration 120 --min-samples 3 --boot-wait 90
python scripts/preemption/latency.py --duration 120 --min-samples 5 --max-latency-ms 100 --boot-wait 90
Validation gate:
python scripts/gate/run.py --gate all --timeout 360
Full validation matrix:
python scripts/validation_matrix.py --soak-duration 30 --latency-duration 30 --boot-wait 90 --smoke-timeout 180
Resume from a specific check:
python scripts/validation_matrix.py --from-check gate-check --smoke-timeout 180
See docs/VALIDATION_GATES.md for subsystem --gate names and scope-index routing.
Clan OS is an experimental post-Unix capability system with semantic constitutionalism — not “Linux but smaller.”
Scopes 1–100 built kernel mechanics (paging, ELF, syscalls, SMP groundwork). The long-term challenge is preserving semantic coherence across decades, not only shipping features.
Preserving semantic coherence is harder than building the kernel.
- Native: capabilities, async endpoints, no ambient paths, service-centric design — see NATIVE_MODEL.md
- Compat: ELF, FDs, paths, POSIX (future shim) — substrate, not architectural truth
- Governance: AXIOMS.md (especially A7 semantic laws override convenience, A10 minimization), gates G1–G5, SEMANTIC_SPECS.md
What happens when you build a civilization on the OS on your own terms — and write the laws before the code?
Licensed under the Apache License, Version 2.0.
See LICENSE for the full text.
