System call latency
376ns
Rabbit
Linux 7.3.0: 29.3 µs · Linux, mitigations off: 1.04 µs
Rabbit is a Linux-ABI-compatible operating system kernel written in Rust.
- [0.000]Rabbit: boot OK
- [0.012]MM DIRECTMAP OK
- [0.018]HEAP OK 10000
- [0.041]USER OK exit=0
- [0.102]SCHED OK
- [1.254]TICKS 100
- [2.008]INFER OK tokens=42
- [12.9s]AGENT loop complete
Four layers, one system
Each layer owns a single responsibility. Together they run a local model and let it act.
No page table isolation, no LSM, no audit, no cgroups, no hooks. Demand paging, large pages, a scheduler with a short tail and real multiprocessing. Every number is published, including the losses.
Fewer milliseconds of work per operation, in a private single tenant guest.
The weights are mapped from the initramfs without being copied, kept resident, and read by a decoder written from scratch: RMSNorm, rotary embeddings, grouped query attention, the gated feed forward block and a key value cache. It generates the same tokens as the reference implementation, one for one.
No dependency outside the Rust standard library, and no copy of the weights.
The model answers with a tool call, the kernel runs the tool, and the model answers again. The shape of the call is not a request in the prompt but an automaton over bytes: the answer cannot be anything but a well formed call of a declared tool, with the keys that tool needs, each of them once, with the type the tool expects.
A grammar that makes a malformed tool call impossible.
The guest enumerates the bus, claims a network device, resolves the address of the gateway, sends a datagram to a server on the host and reads the answer, with the socket calls of the Linux ABI. The agent has a tool that does it, so the loop of the agent reaches the network.
A stack sized for the agent loop, not for the general case.
Rabbit is faster at every measured time, and uses less memory
Lower is faster on the same QEMU rig. The raw table below contains every measurement, including the losses.
Benchmark comparison between Rabbit and mainline Linux. Operation times span 6 kernel measurements on a logarithmic axis from 100 nanoseconds to 100 milliseconds. End-to-end times span 3 measurements from 1 second to 10000 seconds. Memory and throughput comparisons are shown in the table below.
The chart continues to the right: scroll it sideways for the two mainline series and their values.
Memory and throughput
Logarithmic scale: zero is not representable. The position of each mark encodes the order of magnitude, not the absolute difference.
Raw measurements
| Metric | Rabbit | Linux 7.3.0 | Linux, mitigations off |
|---|---|---|---|
| System call | 376 ns | 29.3 us | 1.04 us |
| Map and touch memory | 6.83 ms/MiB | 25.8 ms/MiB | 8.69 ms/MiB |
| Fault in memory, 4 KiB pages | 2.01 ms/MiB | 44.6 ms/MiB | 13.7 ms/MiB |
| Fault in memory, 2 MiB pages | 825 us/MiB | 44.9 ms/MiB | 13.0 ms/MiB |
| Futex round trip | 6.53 us | 407 us | 97.7 us |
| Four threads, spawn to join | 620 us | 7.73 ms | 4.59 ms |
| Boot to the first result | 12.9 s | 206 s | 63.8 s |
| Resident memory of the guest | 319 MB | 476 MB | 483 MB |
| Time to the first token | 11.25 s | 24.67 s | 22.82 s |
| Tokens per second | 0.45 tok/s | 0.20 tok/s | 0.21 tok/s |
| Seconds of an agent loop | 821 s | 2793 s | 2570 s |
| Resident memory with the model | 857 MB | 1021 MB | 1023 MB |
A ladder of exit criteria
Every milestone ends with a sentence a machine can check. No hand-waving, no “almost done”.
Kernel and memory
M0BootDone
Xen PVH handover, serial output, physical memory map.
Exit: Serial log contains "Rabbit: boot OK" and QEMU exits 33.
Verification: Headless QEMU with a serial assertion.
M1Exceptions and timersDone
GDT, TSS with an IST stack, IDT, recoverable exceptions, 8259 PIC, PIT.
Exit: Divide by zero prints "DIV0 RIP=..." and continues; 100 PIT ticks print "TICKS 100".
Verification: Golden serial log.
M2MemoryDone
Buddy allocator, size class heap, higher half kernel, direct map.
Exit: 10,000 allocate/free cycles without leaks or double frees; usable RAM matches -m.
Verification: Host unit tests plus an on target self test.
M2bDirect map onlyDone
The kernel reaches physical memory only through the direct map.
Exit: The same byte read before and after the switch.
Verification: On target self test.
M2cMetadata in its own memoryDone
Frame metadata carved out of the memory it describes, guests of 32 GiB.
Exit: A guest of 4 GiB boots, manages its memory and runs the workload.
Verification: QEMU with -m 4G.
M3ThreadsDone
Kernel threads, preemptive round robin scheduler, interrupt safe locks.
Exit: 10 threads make progress under preemption with fair scheduling.
Verification: On target self test.
Userspace and paging
M4UserspaceDone
Ring 3, SYSCALL/SYSRET, ELF64 loader, 59 Linux system calls.
Exit: A statically linked hello prints and exits 0; the system calls return the same values as Linux.
Verification: Golden log plus a diff against mainline.
M4bA real userlandDone
A standard library program running unmodified.
Exit: A standard library program runs unmodified, prints and exits 0.
Verification: Golden log.
M4cDemand pagingDone
Demand paging for anonymous mappings.
Exit: An anonymous mapping faults its pages in on demand, and the per page tail measures a real fault.
Verification: The weights workload against mainline.
E1InitramfsDone
The initramfs as a read only file system.
Exit: A user program reads a file from it.
Verification: openat, read, lseek, fstat.
E2File mapping and large pagesDone
A file backed mapping and large pages.
Exit: The weights are mapped with 2 MiB pages.
Verification: The weights workload, before and after.
E2bResident weightsDone
Large pages for file mappings and mlock residency of the weights.
Exit: The weights are resident: mlock keeps them in memory and the pages are large.
Verification: The "locked pages" line of the boot log.
E3aPrioritiesDone
A scheduler with priorities and wakeup preemption.
Exit: A scheduler with priorities and wakeup preemption.
Verification: The threads workload and the wakeup test.
E3bA short tailDone
The tail of the scheduler measured, and the policy that shortens it.
Exit: The tail of a runnable thread stays inside a budget.
Verification: The threads workload, published with its p99.
Parallelism and network
M9SMPDone
ACPI MADT, INIT-SIPI-SIPI, LAPIC and IOAPIC, IPIs, four processors.
Exit: Boots with 4 vCPUs; every processor runs its own threads and reports a heartbeat.
Verification: Boot gate with four processors in CI.
M10The networkDone
The PCI bus, a virtio device, IPv4 and UDP, the sockets of the ABI.
Exit: The kernel reaches the network: an agent calls an API and reads the answer.
Verification: The networking gate in CI.
M12TCPDone
TCP in the kernel, so the agent can speak HTTP.
Exit: A request and a reply over TCP.
Verification: The networking gate in CI, with a request and a reply over TCP.
Inference, agent and measurement
E4The inference runtimeDone
A real model, token for token against the reference.
Exit: A Rust inference runtime generates the same tokens as the reference implementation.
Verification: Token for token diff against the reference.
E5The runtime measuredDone
Tokens per second and time to first token, both kernels, same machine.
Exit: Tokens per second and time to first token, both kernels, same machine.
Verification: The rig, with the raw data published.
E6The agentDone
Model, tool call, tool result and model, with a grammar that forces the call.
Exit: The agent asks the model for a tool call, runs the tool and goes on, and the call is always well formed.
Verification: The agent gate in CI, and the grammar tests.
E7The agent measuredDone
The latency of a step and the tokens of a step, on both kernels.
Exit: The agent is measured on both kernels: the latency of a step and the tokens of a step.
Verification: The rig, with the raw data published.
E8The tools of an agentNext
The agent writes a file and lists a directory: the tools need a file system the kernel serves.
Exit: The tools need a file system the kernel serves.
Verification: The tools against the same program on both kernels.
M8The benchmark rigDone
Seventeen measurements, the comparison published with its raw data.
Exit: Published benchmark report: raw CSV, median, p99, sigma, N >= 30.
Verification: The bench scripts.
M11A quantized checkpointNext
A quantized model fits in the memory of the machine and keeps its answer.
Exit: A quantized model fits in the memory of the machine and keeps its answer.
Verification: The runtime against the reference, with the digest of the checkpoint.
M13TLSNext
TLS in the kernel, so the agent can read the certificate of an API.
Exit: Against a server with a certificate.
Verification: The networking gate in CI.
Deferred
M5A shellDeferred
A /init busybox shell runs "ls | wc -l" with the same output as Linux.
M6Dynamic linkingDeferred
A musl dynamic binary runs from a read-only ext2 rootfs.
M7Signals and pipelinesDeferred
A signal and pipeline test suite produces identical output to Linux.
Run it today
Clone, build, boot. The repository has everything: the kernel, the runtime, the agent, the benchmark rig.
git clone https://github.com/NicolasBecasAzagra/Rabbit.gitBoot in QEMU with make run. The serial log ends with exit status 33 when the boot is clean.
What people ask
Is this Linux?
No. Rabbit is an x86_64 kernel written from scratch that is compatible with the Linux userspace ABI: the same system calls, the same struct layouts, the same ELF loading rules. It is not a distribution and it does not replace Linux.
Does it run on my machine?
It runs in QEMU on x86_64, with -M q35. It is not bare metal yet, and without KVM or HVF the timings describe an emulator. Hardware acceleration is the open issue.
What does it need?
QEMU 8.2 or newer, 512 MiB of memory for the operations or 1024 MiB for the model and the agent, and a virtio network device for the network. The full comparison against mainline Linux needs a Linux host.
Which model does it serve?
SmolLM2-135M-Instruct, in bfloat16, with the revision pinned and the SHA-256 verified. A quantized checkpoint is produced by the same repository and measured too: Q8 reproduces the reference tokens, Q4 changes the answer, and that change is published as a loss.