Fluid Language Universal eXecution β An intelligently hardware-agnostic operating system written in pure C where the kernel IS the compiler.
βββββββ βββββββ βββββββ βββββββ
ββββββββββββββββββββββββββββββββββ
βββ βββ ββββββ ββββββ βββ
βββ βββ ββββββ ββββββ βββ
ββββββββββββββββββββββββββββββββββ
βββββββ βββββββ βββββββ βββββββ
FLUX OS is a microkernel operating system written entirely in C11 that fundamentally rethinks how an operating system interacts with its hardware, its applications, and its developers. Instead of the traditional model where an OS loads pre-compiled binaries, FLUX OS contains a self-compiler that can write, compile, and execute code from kernel-space to user-space β making it the first OS where the kernel itself acts as both developer and compiler.
The system is intelligently hardware-agnostic: all hardware access flows through a pluggable Hardware Abstraction Layer (HAL), enabling the same OS image and the same FLUX bytecode to run natively on x86_64 servers, ARM64 edge devices, RISC-V microcontrollers, and even WebAssembly in the browser. The self-compiler uses hardware capability data from the HAL to generate optimized native code for whichever platform it happens to be running on, meaning a single FLUX.MD specification can produce x86_64 machine code on a server and ARM64 machine code on a Raspberry Pi without any human intervention.
| Principle | Description |
|---|---|
| The Kernel IS the Compiler | The OS contains a full compilation pipeline (FLUX.MD β FIR β bytecode/native) accessible from kernel-space via syscalls |
| Hardware Agnostic | All hardware access goes through the HAL; the OS adapts to x86_64, ARM64, RISC-V, WASM at boot time |
| Agent-Native | Every process can be an autonomous agent with built-in A2A (Agent-to-Agent) messaging protocol |
| Bytecode-First | FLUX bytecode is a first-class execution format, running in a 64-register VM with sandboxed regions |
| Self-Hosting | The OS can rebuild itself from FLUX.MD specifications β it writes its own code |
| Edge-Ready | Develop, build, and deploy to IoT devices from the same TUI, CLI, or Web interface |
| Hot-Swap A/B Testing | Compiler-generated binaries can be hot-swapped to redundant devices for instant A/B testing |
FLUX OS provides three ways to interact with the system, all exposing the same underlying capabilities. Whether you're a human developer at a terminal, an operator monitoring a fleet of devices through a web dashboard, or an AI agent orchestrating edge deployments programmatically, the interface adapts to your workflow while keeping the same build-deploy-test cycle.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FLUX OS β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ β
β β CLI β β TUI β β Web β β
β β flux cli β β flux tui β β flux web β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β β β β β
β βββββββββββββββββΌββββββββββββββββ β
β β β
β ββββββββββββΌβββββββββββ β
β β flux-core API β β
β β (compiler + HAL + β β
β β agent runtime) β β
β ββββββββββββ¬βββββββββββ β
β β β
β βββββββββββββββββΌββββββββββββββββ β
β β β β β
β ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ β
β β x86_64 β β ARM64 β β RISC-V β ... β
β βββββββββββ βββββββββββ βββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Edge Device Fleet Manager β β
β β (hot-swap, A/B test, OTA updates) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The CLI is designed for scripted automation, CI/CD pipelines, and developers who live in the terminal. Every operation is a single command with structured output (JSON or table format).
# Build for current host
flux build --target native
# Cross-compile for Raspberry Pi
flux build --target arm64 --board rpi4
# Deploy to device fleet
flux deploy --fleet greenhouse-sensors --strategy canary
# A/B test two compiler outputs
flux ab-test --variant-a build/v1.flux --variant-b build/v2.flux --devices 50%
# Agent-first: let an AI agent build and deploy
flux agent run --task "deploy temperature monitor to edge fleet"The TUI provides an interactive, terminal-based experience for developers who want a rich visual interface without leaving their terminal. It features split-pane layouts, real-time logs, and keyboard-driven workflows reminiscent of htop, tmux, and k9s.
ββ FLUX OS TUI βββββββββββββββββββββββββββββββββββββββββββ
β [1] Dashboard [2] Build [3] Deploy [4] Agents [5] β
β β
β ββ Build Config βββββββββββββββββββββββββββββββββββββββ β
β β Target: ARM64 (Raspberry Pi 4) β β
β β Source: ./apps/greenhouse-monitor.flux.md β β
β β Optimization: -O2 (balanced) β β
β β Output: ./build/greenhouse-monitor.fluxbc β β
β β β β
β β ββ Compiler Output βββββββββββββββββββββββββββββββ β β
β β β [OK] Parsing FLUX.MD... β β β
β β β [OK] FIR generation (34 functions, 128 values) β β β
β β β [OK] Codegen: ARM64 assembly β β β
β β β [OK] Emitting binary (48.2 KB) β β β
β β β [OK] Hot-swap ready β β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β
β β [Build] [Deploy] [A/B Test] [Terminal] β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββ Device Fleet ββββββββββββββββββββββββββββββββββββββββ β
β β Device Status Variant Uptime β β
β β greenhouse-pi-01 β ACTIVE v2 (B) 14d 6h β β
β β greenhouse-pi-02 β ACTIVE v1 (A) 14d 6h β β
β β greenhouse-pi-03 β ACTIVE v2 (B) 14d 5h β β
β β greenhouse-esp-01 β IDLE v1 (A) 0d 0h β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The Web interface is designed for fleet operators, non-developers, and monitoring scenarios. It runs as a lightweight HTTP server embedded in FLUX OS itself and is accessible from any browser on the network.
ββ FLUX OS Dashboard β https://flux.local:8080 βββββββββββ
β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
β β 12 β β 48.2KB β β 99.97% β β
β β Devices β β Avg Build β β Uptime β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
β β
β ββ A/B Test: Temperature Sensor v1 vs v2 βββββββββββββ β
β β β β
β β v1 (Control) v2 (Treatment) β β
β β ββββββββββββ 52% ββββββββββ 48% β β
β β Latency: 12ms Latency: 8ms β β
β β Memory: 2.1MB Memory: 1.8MB β β
β β Errors: 0.01% Errors: 0.003% β β
β β β β
β β [Promote v2] [Extend] [Rollback] [Stop] β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
FLUX OS is structured as a microkernel with six core subsystems, each communicating through well-defined C APIs. The architecture follows a strict layering principle where upper layers never directly access lower layers β they go through the kernel's syscall interface.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Space β
β ββββββββββββ ββββββββββββ ββββββββββββ β
β β FLUX.MD β β Agents β β Apps β β
β β Source β β (A2A) β β β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β ββββββββββββββββΌβββββββββββββββ β
β β Syscalls β
ββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ€
β Kernel Space β
β βββββββββββββββββββββΌββββββββββββββββββββββββ β
β β FLUX Microkernel β β
β β βββββββββββ ββββββββ ββββββββββ βββββββ β β
β β βCompiler β β VM β β Agent β β Schedβ β β
β β β(FIR) β β(64R) β βRuntimeβ β β β β
β β βββββββββββ ββββββββ ββββββββββ βββββββ β β
β β βββββββββββ ββββββββ ββββββββββ β β
β β β Memory β β IPC β βSyscallβ β β
β β β Manager β β(A2A) β βDispatchβ β β
β β βββββββββββ ββββββββ ββββββββββ β β
β βββββββββββββββββββββββββ¬ββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββΌββββββββββββββββββββ β
β β Hardware Abstraction Layer β β
β β βββββββββββ ββββββββ ββββββββββ β β
β β β x86_64 β βARM64 β βRISC-V β WASM β β
β β β Backend β βBack. β βBack. β Back. β β
β β βββββββββββ ββββββββ ββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββ β
β Hardware β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Subsystem | Location | Description |
|---|---|---|
| Microkernel | kernel/ |
Core process management, scheduling, syscalls, panic handling |
| HAL | hal/ |
Hardware abstraction with pluggable backends (x86_64, ARM64, RISC-V, native) |
| VM | vm/ |
64-register bytecode virtual machine with sandboxed memory regions |
| Compiler | fluxc/ |
FLUX.MD β FIR (SSA IR) β bytecode/C/native code generation |
| Agent Runtime | agent/ |
A2A messaging, capability security, agent lifecycle, sandboxing |
| Opcodes | include/flux/opcodes.h |
Shared 184-opcode instruction set across all implementations |
- GCC or Clang with C11 support
- Make (or CMake for cross-compilation)
- For bare-metal targets: QEMU, cross-compiler toolchain
# Clone the repo
git clone https://github.com/SuperInstance/flux-os.git
cd flux-os
# Build the library
make
# Run hosted-mode tests (verifies kernel, HAL, VM, opcodes)
make testββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FLUX OS β Hosted Mode Test Suite β
β Version 0.1.0 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
--- HAL Tests ---
TEST: HAL boot sequence [PASS]
TEST: HAL arch name [PASS]
TEST: HAL console putc [PASS]
...
--- VM Basic Tests ---
TEST: VM init [PASS]
TEST: VM load bytecode [PASS]
...
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Results: 32 PASSED, 0 FAILED, 32 Total
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
One of FLUX OS's key capabilities is the ability to develop, build, and deploy to edge devices from a single interface. The self-compiler generates optimized binaries for each target architecture automatically, and the fleet manager handles distribution, hot-swapping, and A/B testing across your device fleet.
# Define your application in FLUX.MD (human-readable + agent-readable)
cat > apps/sensor.flux.md << 'EOF'
# Temperature Monitor Agent
## Compile
target: arm64
optimize: -Os (size)
board: raspberry-pi-4
## Agent
name: temp-monitor
capabilities: IO_READ, NETWORK, MEMORY
heartbeat: 30s
## Loop
1. Read temperature from I2C sensor (addr 0x48)
2. If temperature > threshold:
- DELEGATE to alert-agent: send_notification(temp, location)
3. Every 60s: TELL cloud-agent: publish_metric(temp, device_id)
4. YIELD (sleep until next reading)
EOF
# Build for ARM64 edge devices
flux build --source apps/sensor.flux.md --target arm64
# Deploy to your device fleet
flux deploy --fleet greenhouse --strategy rolling --batch-size 25%
# Monitor deployment
flux fleet status --watch# Create variant A (current stable)
flux build --source apps/sensor.flux.md --target arm64 --output v1.fluxbc
# Create variant B (new version with changes)
flux build --source apps/sensor-v2.flux.md --target arm64 --output v2.fluxbc
# Run A/B test: 50/50 split across fleet
flux ab-test \
--variant-a v1.fluxbc \
--variant-b v2.fluxbc \
--split 50/50 \
--duration 24h \
--metrics latency,memory,error_rate
# See results and promote winner
flux ab-test results --name sensor-ab-2024-04-10
flux ab-test promote --variant v2.fluxbc --name sensor-ab-2024-04-10FLUX OS provides two distinct onboarding paths, recognizing that the system has two primary audiences: human developers and AI agents.
See docs/ONBOARDING.md for the complete human onboarding guide, including environment setup, first build, first deploy, and progressive skill development.
See docs/AGENT-ONBOARDING.md for the machine-readable onboarding specification, including API contracts, capability negotiation, and programmatic workflow descriptions.
| Document | Description |
|---|---|
| README.md | This document β project overview and quick start |
| docs/QUICKSTART.md | 5-minute quick start for all three interfaces |
| docs/ONBOARDING.md | Complete human onboarding guide |
| docs/AGENT-ONBOARDING.md | Agent-first onboarding specification |
| docs/ARCHITECTURE.md | System architecture deep-dive |
| docs/CLI-REFERENCE.md | CLI command reference (all commands, flags, examples) |
| docs/TUI-GUIDE.md | TUI keyboard shortcuts, layouts, and workflows |
| docs/WEB-INTERFACE.md | Web dashboard features and REST API |
| docs/EDGE-IOT-DEPLOYMENT.md | Edge device deployment and fleet management |
| docs/HOTSWAP-AB-TESTING.md | Compiler hot-swap and A/B testing |
| CONTRIBUTING.md | Contributing guidelines |
flux-os/
βββ include/flux/ # Public API headers
β βββ kernel.h # Microkernel types, syscalls, PCB
β βββ hal.h # Hardware abstraction layer
β βββ vm.h # Bytecode VM (64 registers, regions)
β βββ compiler.h # Self-compiler (FIR SSA IR)
β βββ agent.h # Agent runtime (A2A protocol)
β βββ opcodes.h # 184-opcode instruction set
βββ kernel/ # Microkernel implementation
β βββ main.c # Boot sequence, banner, subsystem init
β βββ info.c # Kernel introspection
β βββ log.c # Logging subsystem
β βββ mem.c # Memory manager (free-list allocator)
β βββ proc.c # Process management (PCB table)
β βββ sched.c # Priority round-robin scheduler
β βββ ipc.c # Inter-process communication (A2A)
β βββ syscall.c # System call dispatcher (28 syscalls)
β βββ panic.c # Kernel panic handler
βββ vm/ # Bytecode VM implementation
β βββ vm.c # VM core (init, load, run, halt)
β βββ opcodes.c # Opcode name lookup and execution
β βββ region.c # Sandboxed memory regions
βββ fluxc/ # Self-compiler (FLUX.MD β FIR β output)
β βββ lexer.c # FLUX.MD lexer
β βββ parser.c # FLUX.MD parser β AST
β βββ fir.c # FIR SSA IR construction
βββ hal/ # Hardware abstraction layer
β βββ hal.c # HAL core (backend selection, boot)
β βββ arch/
β β βββ native/ # Hosted mode (Linux/POSIX)
β β βββ x86_64/ # x86_64 bare metal backend
β β βββ ... # ARM64, RISC-V backends
βββ agent/ # Agent runtime
β βββ agent.c # Agent lifecycle (spawn, terminate, schedule)
β βββ capability.c # Capability security model
β βββ discovery.c # Agent discovery and service registry
β βββ sandbox.c # Execution sandboxing
β βββ a2a.c # A2A messaging protocol
βββ tests/ # Test suites
β βββ test_hosted.c # Hosted mode integration tests (32 tests)
βββ docs/ # Documentation
β βββ QUICKSTART.md
β βββ ONBOARDING.md
β βββ AGENT-ONBOARDING.md
β βββ ARCHITECTURE.md
β βββ CLI-REFERENCE.md
β βββ TUI-GUIDE.md
β βββ WEB-INTERFACE.md
β βββ EDGE-IOT-DEPLOYMENT.md
β βββ HOTSWAP-AB-TESTING.md
βββ Makefile # Build system
βββ README.md # This file
FLUX OS is part of a larger ecosystem of three repositories, each targeting a different abstraction level:
| Repository | Language | Purpose | Status |
|---|---|---|---|
| flux-runtime | Python | Research, rapid prototyping, 1907 tests, 104 opcodes | Stable |
| flux | Rust | Production runtime, 286 tests, 100 opcodes | Stable |
| flux-os | C | Operating system, hardware-agnostic, self-compiling | v0.1 Alpha |
| Metric | Value |
|---|---|
| Instruction Set | 184 opcodes |
| VM Registers | 64 general-purpose |
| Syscalls | 28 (process, memory, IPC, bytecode, compiler, I/O, hardware) |
| HAL Backends | 5 (x86_64, ARM64, RISC-V, WASM, Native) |
| Agent Capabilities | 11 capability flags |
| A2A Message Types | 11 (tell, ask, reply, delegate, result, barrier, subscribe, event, error, capability, heartbeat) |
| FIR Types | 17 (including agent, capability, bytecode, region) |
| Memory Regions | 16 per VM instance (sandboxed) |
| PCB Slots | 256 processes |
| Test Coverage | 32 integration tests (hosted mode) |
MIT License β see LICENSE for details.
"The Kernel IS the Compiler"