● pre-alpha · built on MINIX 3

The OS that writes itself.

Mainix is a minimal UNIX where binaries don't exist until you need them. Type ls, and an LLM writes it, compiles it, tests it and pins it. The next time it's instant.

msh — mainix

    
How it works

Command not found? Not for long.

A fresh Mainix ships with almost nothing: a microkernel, a tiny shell, a compiler and a line to the Forge. Every other tool is generated the first time you ask for it.

You ask

You type ls -la. The shell looks in /forge/bin and finds nothing.

The Forge writes

The Forge on the host hands the tool's spec to a local LLM, which writes small C code that follows POSIX.

MINIX tests

The guest compiles it in a locked-down sandbox and runs the test suite. If a test fails, the error goes back to the LLM for another try.

Pinned forever

A passing binary is stored by its sha256 and pinned, so you get the same binary until a better one is promoted.

$ ls not in /forge/bin spec + tests tools/ls/ · 14 cases LLM writes ls.c cc + test in sandbox pin + run sha256:3fa9… tests fail → error output fed back (max N retries) next time: direct hit, ~4 ms pass
The forge loop. Generated code is never trusted. Only binaries that pass the tests get pinned.

First run vs. every run after

You pay the cost once. After that, a forged tool is a normal native binary. (Targets from the proof-of-concept spec, not measurements yet.)

ls · 1st run
spec LLM writes ls.c cc tests
ls · 2nd run
≈ 4 ms. It's just a binary now.
load specgeneratecompiletest / runwhole bar ≈ 30–60 s
Architecture

A tiny trusted core. Everything else is earned.

MINIX 3 is a microkernel: drivers and services run as separate user processes. That's exactly what you want when an AI writes your tools, because a bad binary can crash itself but not the kernel.

HOST · x86_64 · KVM · local GPU Forge • tool specs + test suites • prompt → C source • retry with test output • best-of-N selection python service Local LLM llama.cpp / vLLM coder model Signal log prompt · src · tests size · speed · 👍 RL fine-tune → better model virtio-serial / TCP GUEST VM · MINIX 3 (i386) · QEMU msh tiny shell forgec forge client sandbox cc · tests · rlimits /forge/store/<sha256> /forge/bin/ls → 3fa9…c1 · /forge/bin/cat → 81be…07 (pinned) USER SPACE SERVERS (isolated processes) pm vfs vm rs drv microkernel · ~15k lines · the only trusted code
The model and the Forge run on the host's GPU. MINIX only ever receives source code, compiles it and tests it itself. The microkernel is the trust boundary.
Learning loop

It gets better at building itself.

Every forge attempt produces a clear signal: did it compile, did it pass, how big is it, how fast is it, and did you keep it. That's what reinforcement learning needs.

  • Best-of-N. Generate several candidates and keep the smallest, fastest one that passes.
  • Dataset. Every success becomes a (spec → passing source) training pair.
  • Reinforcement learning. Fine-tune a local coder model, with test pass rate, binary size and speed as the reward.
  • Promote. A better ls replaces the pinned one only once it passes the same tests.
generate test log train mainix smaller · faster · righter
Each lap makes the next forge cheaper.
Backstory

Small is beautiful. Again.

In 1987 Andrew Tanenbaum wrote MINIX to teach how an operating system works. In 1991 a Finnish student built Linux after using it. Thirty-five years later Linus mostly reviews merges, says yes to Rust, and plays more guitar. So we went back to the small one and let it write its own tools.

Cartoon: a professor carefully builds MINIX, Linus relaxes with a guitar while robot crabs press MERGE on the Linux kernel, and a little Mainix robot forges ls
1987

MINIX

A teaching UNIX small enough for one book. Later rebuilt as a reliable microkernel (MINIX 3).

1991 → today

Linux

Started as a hobby and now runs the world. Rust is in the kernel, and there's more time for the guitar.

2026

Mainix

MINIX plus AI. Nothing is installed in advance, and every tool is written when you first need it.

Prior art

Standing on interesting shoulders

Others are exploring AI-native systems. Mainix combines a UNIX microkernel, a normal command line and a self-improving forge.

ProjectWhat it isTools generated at runtimeUNIX CLILearns from use
AIOSAgent scheduling framework (Python) on top of an existing OS———
NOSRust PID 1, AI-generated ARM64 agents✓——
PneumaDesktop: describe an app and it gets generated✓——
VibeOS"AI-native OS", mostly built with AI ahead of timepartly——
MainixMINIX 3 + Forge + pinned, tested binaries✓✓✓