SexOS ยท Design Documents

Design Phases

Detailed design documents spanning Phases 3 through 16, covering Wayland lifting, signal trampolines, voxel rendering, font systems, and more.

Phase 3: sexfiles Design

Real PDX-based VFS on lock-free foundation. Block I/O dispatch to sexdrive via lent-memory.

Complete

Phase 4: Distribution

sexnet server PD for networking and remote proxy. Remote PDX routing via cluster fabric.

Complete

Phase 5: Hardware & sexdrive

ARM64 Design (Raspberry Pi 5). NVIDIA 3070 GPU PD. Pi 5 Peripheral support.

Complete

Phase 6: Signal Trampoline

Background trampoline thread per PD. Full POSIX sigaction ABI on dedicated stack. Lock-free signal state (RCU-style).

Complete

Phase 7: Memory Subsystem

Lock-free Buddy Allocator (4 KiB / 2 MiB / 1 GiB). Async #PF forwarding to sext server. Demand paging.

Complete

Phase 8: ELF Loader + PD Spawn

Kernel ELF loader, segment parsing, buddy-allocator mapping. sys_spawn_pd async path.

Complete

Phase 9: Driver Enablement

NVMe/AHCI driver in standalone PD. Zero-copy DMA. MSI-X interrupt routing. Input stack polish.

Complete

Phase 10: Wayland & sexinput

Wayland IPC emulation via PDX. Shared memory sext. libinput lifting. Mesa/wlroots bootstrap.

Complete

Phase 11: GNU Pipeline

POSIX pipe(), fork(), execve(). Coreutils as isolated PDs. End-to-end signal delivery.

Complete

Phase 12: Dynamic Translators

sexnode translator. On-the-fly ELF to Sex native. Capability-based translator loading.

Complete

Phase 13: Self-Hosting

sex-gemini agent. sexstore packages. Full build loop: kernel rebuild from source inside Sex.

Complete

Phase 14: Formal Verification

Refined physical allocator. Hardened PKU domain init. CHERI capability prep.

Complete

Phase 3: Services & sexfiles

Status: Stable ๐Ÿš€

Real PDX-based VFS on lock-free foundation. Standalone sexfiles server PD. Real block I/O dispatch to sexdrive. Minimal ramfs using Phase-7 lock-free buddy allocator. POSIX syscall bridge in sexc for VFS operations.

Phase 4: Distribution

Status: Complete โœ…

Standalone sexnet server PD for networking and remote proxy. Remote PDX routing via cluster fabric capabilities. Zero-copy packet transfer via lent-memory. Translucent network-local capability transparency.

Phase 5: Hardware & sexdrive

Status: Complete โœ…

ARM64 Design (Raspberry Pi 5). DDE-Sex Shim (Linux/BSD sexdrive lifting). NVIDIA 3070 GPU PD (Nouveau-lifted skeleton). Pi 5 Peripheral support design. Standalone sexdrive server PD. Pure PDX hardware dispatch and MSI-X interrupt routing. Zero-copy DMA via lent-memory capabilities.

Phase 6: Asynchronous POSIX Signal Trampoline

Status: Complete โœ…

Background trampoline thread per PD with FLSCHED::park. Zero busy-wait signal dequeuing from control ring. Full POSIX sigaction ABI (siginfo_t, ucontext_t) on dedicated stack. Lock-free signal state management (RCU-style).

Phase 7: Real Memory Subsystem

Status: Complete โœ…

Lock-free Buddy Allocator (4 KiB / 2 MiB / 1 GiB sharding). Hardware-enforced PKU domain management. Asynchronous #PF forwarding to standalone sext server. Demand paging via lent-memory capabilities.

Phase 8: Full ELF Loader + PD Spawn

Status: Complete โœ…

Kernel ELF loader: Segment parsing and buddy-allocator mapping (Lock-Free). PD creation: Pure PDX-based ELF loading and initial capability grants via RCU Table. sys_spawn_pd: Fully asynchronous spawn path.

Phase 9: Driver Enablement

Status: Complete โœ…

Production-grade NVMe/AHCI driver in standalone PD. Zero-copy DMA via Lent-Memory capabilities. MSI-X interrupt routing to driver SPSC rings. Polished Input stack (PS/2 + USB HID) with TTY routing. sexfiles real block I/O dispatch integration.

Phase 10: Wayland Ecosystem & sexinput

Status: Complete โœ…

Standalone sexdisplay server PD for framebuffer/GPU management. HID event routing from sexinput to sexdisplay via PDX. Zero-copy graphical command buffers via lent-memory. User-space Mesa/wlroots compatibility layer bootstrap.

Wayland Architecture on SASOS

  • Wayland IPC (AF_UNIX + FD Passing): Emulated in sexc using PDX primitives. FD passing mapped directly to Capability Passing.
  • Shared Memory (Wayland-SHM): Implemented via SHM sext using Memory Lending.
  • sexinput Handling: libinput lifted via DDE-Sex into sexinput PD, pushing events into ring buffers.

Phase 11: GNU Pipeline & Filesystem Parity

Status: Complete โœ…

Full POSIX pipe(), fork(), and execve() support via PDX. Pipes as lent-memory ring buffers. Coreutils (ash, ls, cat, grep) running as real isolated PDs. End-to-end signal delivery within pipelines. Lin-Sex (Linux Binary Compatibility). Multi-Filesystem support (Ext4, Btrfs, FAT, NTFS). GNU Toolchain integration (GCC/Bash).

Phase 12: Dynamic Translators

Status: Complete โœ…

Standalone sexnode server PD for translator discovery and loading. On-the-fly binary translation (ELF โ†’ Sex native) via PDX. Capability-based translator loading and lent-memory code pages. Distributed node discovery and cross-translator transparent routing.

Phase 13: Native Self-Hosting

Status: Complete โœ…

sex-gemini self-repair agent running as isolated PD. Standalone sexstore PD for package management via PDX. Full build loop: kernel rebuild from source inside Sex. Zero host dependencies for the self-hosted environment. Zero-Nits Polish: replaced hardcoded BAR0, full MSI-X completion, standardized FLSCHED park, eradicated all stubs.

Phase 14: Formal Verification Hooks

Status: Complete โœ…

Refined Physical Allocator: Per-core sharded queues and O(1) local allocation. Hardened PKU Domain Init: Runtime WRPKRU validation and isolation invariants. Formal Verification Hooks: Ownership and revocation asserts in Capability system. CHERI Capability Prep: Metadata alignment and safety-critical hardening.

Phase 16: Voxel & Multimedia

Status: Planned ๐Ÿ“…

Enable high-performance multimedia and 3D voxel rendering by porting Classic DOOM and ClassiCube. SDL2 SexOS Backend for PDX communication with srv_wayland. srv_audio for DMA-based playback. srv_font for TrueType rendering. Vibe Coding with integrated Gemini AI to assist porting legacy C code.

Change Report: Signal Trampoline

Key Implementation Details

The POSIX Signal Trampoline required background thread architecture per PD with FLSCHED::park for zero busy-wait signal dequeuing. Full sigaction ABI compatibility (siginfo_t, ucontext_t) is delivered on dedicated stacks with RCU-style lock-free state management. See CHANGE_REPORT_SIGNAL_TRAMPOLINE.md for full details.