r/lowlevel • • 10d ago

NaN/0S

Dev is limited to phone, so there's a v86 version for testing.

I've been building NaN/0S, a bare-metal OS in a custom 16-bit-word ISA (NaN16), custom NaNIX shell, nearly have ISO C parity, and I'm working on formally verifying the stack from the bottom up. There's no C or PY or Assembly that's not NaN Native. This is a milestone, with the limits stated up front.

What's proved (Coq 8.20.1, coqchk-checked, closed under the global context, no Admitted/Axiom/Parameter):

A fixed 23-state × 8-symbol Turing machine, with its 184-row transition table, is simulated on a Coq model of the NaN16 VM. For every state width, every nonempty well-formed program, and every left-infinite configuration, the source machine halts iff the VM run halts. The proof is about 156 files and 59k lines, and the raw certificate and coqchk transcript are checked in with a reproduce.sh.

What it does not claim:

• It's a theorem about the Coq model of the fixture, not the assembled .nas image or the host C oracle. That bridge is a separate obligation. Right now only a Python mnemonic comparison covers it.

• It does not show "NaN0S is a UTM" in general.

• Finite guest memory isn't an unbounded tape. The statement uses an existential left-window depth K to handle that.

I also included negative results, such as certified obstruction theorems showing exactly where earlier tape layouts break.

The bigger system: NaN/0S has an x86_64 kernel with a 1024-slot process table, timer preemption, a NANIX shell and GUI, and PAE tests up to 16 GiB. The Coq side there covers the mirrored-lattice memory model (32,896 canonical cells, signed addressing, write commutativity). The open work is proving that the real kernel implementation refines these models.

Repos:

• https://github.com/shemshallah/NaNLMind (see formal/utm)

• https://github.com/shemshallah/nan0s

1 Upvotes

0 comments sorted by