$ show gwsystems/composite
This repository implements Composite, a component-based research operating system where kernel policies (scheduling, memory management, synchronization) are implemented as user-level components. It runs on x86-32, x86-64, and ARMv7a architectures, primarily under QEMU. The system provides a minimal kernel with capability-based security, synchronous invocation (sinv) for inter-component communication, and shared-memory channels. It includes a full musl libc port for POSIX compatibility, a DPDK-based network stack, an lwIP adapter for TCP/IP, and a simple VMM with virtio-net and device emulation. The architecture is closer to a microkernel than a traditional monolithic kernel, with components loaded and composed via a Rust-based composer tool that reads TOML specifications. A large suite of microbenchmarks measures IPC, scheduling, and synchronization latency. The codebase is pre-alpha quality, with many FIXMEs and incomplete features, but demonstrates strong craftsmanship in its abstraction layers (assembly stubs, channel library, scheduler framework, perfdata utility).
The LLM identified 6 files worth highlighting for reuse:
Implements a multi-producer/single-consumer and single-producer/single-consumer channel library with configurable flags (BLOCK, ASYNC, TRY). The API provides create, send, receive, and teardown operations. The implementation uses atomic operations and careful memory ordering, making it a reusable lock-free queue library suitable for any low-latency inter-thread communication.
Defines the scheduling policy interface (slm_policy_block, slm_policy_wakeup, slm_policy_schedule) and timer prototypes (slm_timer_quantum_expire). This header enables composable scheduler implementations (e.g., FPRR, quantum) that can be swapped without modifying the scheduler core. Demonstrates clean separation of concerns and callback-based design.
Implements a virtio network device for the VMM, handling PCI configuration space, virtio queue setup, and packet transfer between guest and host network backends. The code is self-contained and could be extracted into other hypervisors or VMMs that need virtio-net device emulation.
A lightweight utility for collecting timing measurements and computing statistics (average, standard deviation, min, max). It provides macros for initializing, adding measurements, and printing results. Used across many benchmark components, demonstrating a reusable pattern for performance instrumentation.
The system composition tool written in Rust. It parses TOML component dependency specifications, assigns addresses, resolves invocation ordering, and generates the final ELF image. This tool is essential for building Composite system images and could serve as a reusable component composition framework for other capability-based systems.
Provides macro-based assembly stubs for synchronous invocation (sinv) on ARM. Generates both client-side and server-side stubs using a consistent pattern. The macro abstraction allows easy creation of new IPC interfaces without manual assembly, demonstrating efficient low-level code generation.