RESENTMENT 2.0.0
2.0.0 — three architectures, SMP, all tests green

Authority
that expires.

RESENTMENT is a from-scratch operating system kernel for x86_64, ARM64 and RISC-V. It is not a Unix clone. Every capability carries a cryptographic seal with a deadline inside it, the whole machine has one Merkle root digest, and inference is a scheduling class rather than a userspace afterthought.

1440 host assertions 168 QEMU assertions, all green 0 dependencies ~120 ms to a shell
qemu-system-x86_64 · -smp 4 · serial
[ 0.000000] pmm physical memory: 505.7 MiB usable, 131040 frames [ 0.021841] kaalka temporal keying active, epoch 29798350 [ 0.025446] graph runtime graph online, root node 1 [ 0.045804] smp ACPI reports 4 usable processors [ 0.082106] smp 4 of 4 processors started [ 0.118176] selftest all 7 self-tests passed [ 0.119217] boot boot complete in 119 ms, 505.4 MiB free RESENTMENT 2.0.0 (kaalachakra) x86_64 4 cpu a capability-secure, AI-native kernel resentment> 2 + 2 4 resentment> now() not allowed to now. This script was not granted permission to read the clock. resentment> .allow time granted permission to read the clock resentment> .digest 7d4a1f0e83c25b9a6f1e0d4c8b3a7e2f5d9c1b8a4e7f0c3d6a9b2e5f8c1d4a7b
3 architectures
x86_64, aarch64, riscv64 — each boots to a shell and passes the same suite
4 scheduling classes
realtime, inference, interactive, batch — with admission control
24 capability types
every one sealed, time-bounded, and revocable in constant time
29 sandboxed builtins
behind 11 permission grants the kernel, not the interpreter, enforces
Why it exists

Three things a conventional kernel cannot express

Each of these is a property of the design rather than a feature bolted on top. Take any one away and the other two stop being interesting.

01

Authority expires

There is no ambient authority. A task cannot open a file because it knows a path; it can only act on objects it holds a capability for, and every capability is checked four ways on every use — type, rights, generation, and a Kaalka seal.

The seal is the part a conventional design does not have. Revocation elsewhere is a sweep somebody has to remember to run. Here the deadline lives inside the MAC, so a forgotten permission stops working on its own and widening the window by editing the struct invalidates the seal.

02

The system is a graph you can hash

Every kernel object is a node carrying a SHA-256 digest over a canonical encoding of its own fields plus the sorted digests of its children. The whole machine has one root hash.

Timestamps, ids and pointers are deliberately excluded from that encoding, so two machines that booted at different times but reached the same configuration hash identically. That single property is what makes state diffable, attestable and replayable instead of something you infer from logs.

03

Inference is a system resource

A token-generation loop never sleeps for a human, so sleep-credit heuristics give it nothing. It is not batch either — it has a rate the user can see. It is a soft real-time stream, and SCHED_INFERENCE treats it as one: admitted with a declared rate, given a per-period budget, demoted rather than dropped when it overruns.

Attention caches are paged like memory, because they behave like memory. Pages are content-addressed by the digest of the tokens they cover, so two sessions with the same system prompt store it once.

Kaalka

Time as a dimension of authority

Kaalka derives keying material from the angles between the hands of a clock. In userspace that is a cipher. In a kernel it is how time becomes something authority is measured in: epoch keys that are unrecoverable seconds later, capability seals that expire by construction, and replay defence with no protocol of its own.

Two departures from the reference implementation, both documented and both verified. The trig core is Q32.32 fixed point, because a kernel cannot use the FPU in interrupt context and libm is not bit-reproducible across three architectures — and make kaalka-check reports it 100% byte-identical to the reference on every vector. And Kaalka supplies the schedule while ChaCha20 and HMAC-SHA256 supply the strength; saying that plainly is part of the design.

system state digest 7d4a1f0e83c25b9a6f1e0d4c8b3a7e2f5d9c1b8a4e7f0c3d6a9b2e5f8c1d4a7b

How Kaalka works in the kernel

h–m m–s h–s
Load-bearing, not integrated

Three projects the kernel is built out of

These are not libraries the kernel calls. Remove any one and a whole property of the system disappears with it.

temporal cryptography

Kaalka ↗

Time-driven encryption derived from the angles between the hands of a clock.

Becomes the kernel's temporal authority layer: every capability seal, IPC envelope and snapshot is bound to a time window and an epoch key.
deterministic state

WebWeaveX ↗

Runtime graphs with stable node identity and content-addressed structure.

Becomes the kernel's own state model: a Merkle DAG of every object, exportable, diffable, snapshottable and deterministically replayable.
sandboxed language

SHE ↗

An English-like language whose programs start with exactly zero permissions.

Becomes the system shell and policy language, with its sandbox enforced by the kernel's capability space rather than by an interpreter.
Portability

Three architectures, one test suite

Nothing above arch/ includes an architecture header. Each port boots to an interactive shell, uses every core the machine has, and passes the same 28 assertions driven over a serial link — including the attestation scenario the whole design exists for.

x86_64

boots · SMP
  • Higher-half at −2 GiB with a 4 GiB direct map
  • Multiboot 1 and 2; boots with no ISO
  • APIC and I/O APIC, 8259 fallback, TSC calibrated against the PIT
  • SYSCALL/SYSRET, IST stacks, SMEP/SMAP/NX
  • Image hardened to r-x and r-- after boot, with huge-page splitting so it is exact
  • SMP via ACPI MADT and a real-mode AP trampoline

aarch64

boots · SMP
  • EL2 → EL1, or EL1 directly, depending on what the firmware left
  • PL031 wall clock, so Kaalka keys from real time rather than zero
  • 39-bit VA MMU, 4 KiB granule, block splitting
  • GICv2, generic timer, PL011, PSCI
  • Device tree parsing, with a fault-tolerant RAM probe when there is no tree
  • SMP via PSCI CPU_ON

riscv64

boots · SMP
  • SBI for timer, reset, IPI and hart state management
  • goldfish wall clock, so Kaalka keys from real time rather than zero
  • PLIC, NS16550, supervisor trap vector
  • /reserved-memory honoured, so OpenSBI's PMP regions are never touched
  • No assumption that the firmware chose hart zero to boot
  • SMP via SBI HSM hart_start
Porting is bounded work. A new machine means implementing include/rk/arch.h and a boot stub — roughly forty functions and one assembly file. The porting guide lists every one of them, in the order a bring-up actually needs them.
Verification

How you know it works

A status table that overstates is worse than none. Everything below is a command you can run, and the output is what it prints.

  • make test1440 assertions against the real kernel sources, compiled for the host on a synthetic machine. It found a live alignment bug in the slab allocator on its first run.
  • make qemu-test-allEvery architecture booted twice — single core, then with four — and driven through its shell over a serial socket.
  • make kaalka-checkThe fixed-point port compared against the reference implementation, vector by vector.
  • make verifyThe linked image read the way a bootloader will read it, before a bootloader gets the chance to be confused by it.
  • Seven self-tests, on every bootAllocator, crypto, Kaalka, graph, capabilities, AI, SHE — on the machine about to be trusted. A kernel whose crypto is wrong should not be able to look healthy.
$ make qemu-test-all

=== x86_64 ==================================================
  x86_64: all 28 checks passed
=== aarch64 =================================================
  aarch64: all 28 checks passed
=== riscv64 =================================================
  riscv64: all 28 checks passed
=== x86_64-smp ==============================================
  x86_64-smp: all 28 checks passed
=== aarch64-smp =============================================
  aarch64-smp: all 28 checks passed
=== riscv64-smp =============================================
  riscv64-smp: all 28 checks passed

every check passed on x86_64, aarch64, riscv64,
x86_64-smp, aarch64-smp, riscv64-smp

$ make test
1440 checks, 0 failures
Quick start

No cross-compiler required

One command fetches a portable toolchain that targets all three architectures. No installer, no administrator rights, nothing added to your PATH.

git clone https://github.com/ni-sh-a-char/RESENTMENT---kernel
cd RESENTMENT---kernel

make toolchain     # portable zig + nasm into .toolchain/
make               # build for x86_64
make test          # 1440 host assertions
make run           # boot it under QEMU, no ISO needed

make run works because the build repackages the same segments at the same physical addresses in Multiboot 1 headers, which is what QEMU's -kernel loader understands. That is the difference between a one-command test and a five-minute one.

# the other two architectures
make ARCH=aarch64
make ARCH=riscv64
make all-arch       # all three — the portability check

# or use the container, which needs nothing installed
docker build -t resentment-build buildenv
docker run --rm -v "$PWD":/root/env resentment-build make iso

Everything is in the tree. There are no dependencies: the kernel builds from its own sources plus a compiler, and the test suite needs nothing but Python.

The full building guide →

Honest status

What is done, and what is not

Written down because the absences are choices rather than oversights. The full list, with reasons, is in the roadmap.

Working and tested

Boot to a shell on three architectures · SMP on all three · buddy allocator and slab heap · paging, address spaces, copy-on-write · four scheduling classes with admission control · capabilities with Kaalka seals · the runtime graph, snapshots and replay · the federated memory fabric · SHE compiler, VM and shell · SHA-256, HMAC, HKDF, ChaCha20, CSPRNG · VFS, ramfs, devfs, graphfs, initrd · IPC endpoints, channels, notifications · tensors, operators, accelerator HAL, paged KV cache, GGUF · VGA, framebuffer, serial and PS/2 consoles · syscall entry on all three.

Next

Ring-3 userspace. The entry path and the syscall entry exist; the ELF64 loader does not. The interesting part is not the loader — it is what capability set a new process is handed, and how a parent narrows it.

Storage and network. PCI enumeration, virtio, a block layer and a protocol stack. Capabilities make a socket more interesting than usual: "this process may talk to this host until Tuesday" is expressible.

A model, end to end. Quantised kernels and a worked example generating tokens under SCHED_INFERENCE, with the scheduler trace visible in /graph/events.

Start here

Read it, build it, or port it to something new.

The documentation on this site is the documentation in the repository — the same files, rendered. Nothing here is a marketing page for something that does not exist yet.