notes

Prior art and reuse

Where to look before building, what is worth taking, and the rule that decides it. Written after the question "nife looks a lot like Redox; can we reuse their components?" The answer generalizes past Redox, so this note is the standing survey checklist for every milestone design, not a one-off comparison.

The rule: the reuse boundary is the TCB boundary

Inside the TCB, always build. Two reasons, both structural rather than cautious:

  1. Verification. Anything in the TCB must be provable, and nobody writes code to be proved by accident. Foreign kernel code imported into the TCB is unverified surface that undercuts DECISIONS §14 directly. The proofs we have (caps, IPC, MMU invariants; see notes/verification.md) exist because the code was shaped for them.
  2. The thesis. The demonstrator's claim is about this capability core. A kernel that is partly someone else's demonstrates less, whatever its quality.

Pure-logic crates: prefer a maintained no_std crate, unless building it is the point. The §7 (testing: host-testable crates) crates we wrote by hand (device_tree_blob, elf, page_tables, heap, capability, ...) were the point; they are also now proved or provable, so they stay. For peripheral plumbing not yet built (a PCI capability walker, a GPT parser, a font rasterizer), the calculus flips: a well-maintained kernel-agnostic crate beats a bespoke one we then have to trust anyway.

Userspace components: actively prefer porting. This is not a compromise of the demonstrator; it can be evidence for it. Milestone 23's ambition is vendor-shippable components confined by the kernel. A ported foreign component running confined behind the capability contract demonstrates exactly that: the kernel safely runs code we did not write. Userspace reuse feeds the thesis.

Two guards, regardless of layer. No reuse may widen the system call surface (that is a design fork, per CLAUDE.md), and no reuse may smuggle in POSIX assumptions (open-by-path, fork/exec, ambient authority). A component that cannot live behind explicit capabilities is not a candidate, however good its code.

Redox specifically

The similarity is shallower than it looks. Redox is Unix-shaped: a scheme namespace ("everything is a URL"), POSIX via relibc, a system call ABI modeled on Linux's, a kernel with a heap. nife is seL4-shaped: capabilities, endpoint-only naming, explicit spawn endowment, a kernel that cannot allocate (milestone 14). Their kernel is not a donor, even of fragments. Their userspace is where the portable assets live:

Component Fit When
RedoxFS (redoxfs crate) Best single candidate, named in milestone 32 and audited (notes/redoxfs-audit.md): the no_std core compiles for both bare-metal targets at 0.9.1, two import lines from clean; port plan fixed in the roadmap block. Milestone 32
relibc Long shot; the only credible one if 19's "Linux-compat later" fork is taken. It has a platform layer targeting Linux and Redox; a third backend against our native ABI (notes/abi.md) is conceivable. The catch: it assumes fork/exec-ish process semantics that explicit-endowment Spawn deliberately does not provide. Note it, do not plan on it. 19 compat fork, if taken
Userspace drivers (NVMe, e1000, xHCI, ps2) Reference implementations, not code. Written against Redox's scheme and interrupt model, but the register-level logic is the hard-won part and it reads well. 16, 24 (real hardware)
ion, Orbital, pkgutils No. ion needs POSIX and we have a shell; the rest is out of scope. never

Licensing is a non-issue: Redox is MIT, compatible with our MIT/Apache-2.0 dual license.

The wider survey list

Redox is not the richest donor. For crate-level plumbing, the kernel-agnostic no_std ecosystem is closer to our shape, because those crates were built to be embedded in someone else's kernel:

Calls on the record

The convention

Every milestone file in design/roadmap/ carries a "Prior art" section. The convention, from here on: that section covers reuse too, answering three questions before building: is there code to use, a design to copy, or a mistake to avoid, in the ecosystems above? The build-vs-reuse call gets recorded with its reason, the same as any decision. When the answer is "build", say why; when it is "port", the two guards above still apply.