The operating system found its system library.
Yggdrasil had already run substantial Lux programs. RedMagic turns that growing pile into a named layer: the programs that make a minimal runtime feel like a system.
Its first commit collects the TCP/IP stack, persistent disk adapter, secure-random bridge, pure-Lux TLS 1.3 client and server, GPU programs, font demo, terminal, and TCP REPL. Yggdrasil’s build compiles them with the sibling Lux compiler and installs one content-addressed module pack in the boot image.
The capture predates the virgl fast path, but it already proves the layer boundary: font rasterization, terminal state, colors, cursor, and scanout policy live in Lux.
The next commit made it behave like a terminal, not a framebuffer demo.
RedMagic’s renderer now marks dirty cells, batches glyph vertices into a VBO, presents
only the affected rectangle, drains serial input without blocking, and paces frames at
sixteen milliseconds. It prefers the reusable gpu_text virgl pipeline and
retains a 2D CPU-blit fallback. The optimization belongs in the system library because
it is policy about text, cells, and frames—not a kernel concern.
A compiler frontend with nowhere to hide an OS dependency.
Commit 3b467ff extracts lux-frontend: lexer, parser, type
inference, Core lowering, and the Yggdrasil backend, with no filesystem, database,
network, or native-code backend attached.
The public call is compile_to_yggdrasil. A caller supplies source and a
SourceProvider; the frontend expands use dependencies, checks
types, translates each function, and returns encoded modules, aliases, and an optional
main/0 entry. On the host, the provider can read files. In the kernel, it
reads a boot-shipped source pack.
That includes in-memory compilation, provider-based use resolution, hostile-input coverage, content-address invariants, and interpreter execution.
Port kind five is a compiler service.
The kernel imports lux-frontend without std, gives its recursive
pipeline a bounded eight-mebibyte stack, and exposes two operations through the same
SQ/CQ port model used for disks, networks, random bytes, and the GPU.
OP 1 / COMPILEconsume a UTF-8 source bufferok entry · module count · aliaseserr span diagnostics
OP 2 / RUNconsume an entry-module hashformatted value · exit reasonor timeout
Successful output is loaded as immutable, content-addressed modules. Aliases are rebound only after load. That matters because the previous runtime commit can turn external calls between sealed modules into direct native calls: source compiled inside the kernel enters the same optimized code world as boot-time RedMagic.
Running is intentionally separate. OP_LUX_RUN resolves apply/0
and launches it in a disposable process. A waiter monitors that process, formats a
value or exit reason, and kills it if the caller’s timeout expires. A bad program can
fail, block, or loop without wedging the service port.
Compilation is not a privileged command bolted beside the process model. It is another process-owned service inside it.
The terminal can ask the system to make new code.
RedMagic’s in-flight repl_core opens port kind five from Lux. Everything
above that primitive—line editing, continuations, definition replacement, session
state, diagnostics, and formatted results—stays in Lux.
fn repl_init() -> ReplState {
ReplState { luxc: ygg::port_open(5), defs: [], cont: "", depth: 0 }
}
fn rc_compile(state: ReplState, source: String) -> String {
rc_port_call(state.luxc, 1, source, 0)
}
fn rc_run(state: ReplState, entry: String) -> String {
rc_port_call(state.luxc, 2, entry, 5000)
}
Expressions are wrapped in a temporary main, compiled, and run. Function,
struct, type, extern, and use definitions persist for the session and are
resubmitted as one unit. Both the serial GPU terminal and the TCP REPL share the same
core. The system is no longer limited to executing the program chosen when the ISO was
built.
The boundary is implemented. The milestone is not stamped complete.
The current self-test contract checks the dangerous edges, but the service remains an in-flight M12 change until its repository commit and full QEMU acceptance run land.
Unit and integration tests passed on the host.
Compile, verify, and interpreter execution tests passed.
Bytecode, interpreter, and JIT host tests passed.
In-kernel compile, hash parity, diagnostics, run, and timeout assertions are present.
One lock protects a single large compiler stack. Parallel compile requests wait.
use resolves from lux_src.pack; updating those libraries still means rebuilding the image.
The verifier still checks emitted bytecode, but frontend resource accounting needs to mature before arbitrary hostile users get this port.
The service and REPL core are working-tree evidence, deliberately separated here from the five public commit hashes.