Kore ABI
The Kore ABI
kore-abi, the frozen kernel⇄user contract: layouts and vocabularies only, two transports split by what moves, and an additive-only evolution rule.
Source: kore-abiA contract, not a library
kore-abi is the narrow waist between Kore and everything above it: the types and layouts that cross the boundary, and nothing else. It carries no kernel behavior. There is no stamping key in it, no revocation closure and no derive, revoke or verify logic. A program that links it can describe requests and read capability fields, but it cannot perform an authority operation, because that logic isn't in the crate.
The crate is no_std, forbids unsafe code and depends only on bitflags and zerocopy. The kernel builds its own typed view of a capability on these same wire types, so the two sides can't drift apart on a layout. A drift would be a security bug, not a style problem.
In kore-abi | Kernel only |
|---|---|
| Capability, session, device and memory layouts | The epoch stamping keys |
| Rights and resource-kind vocabularies | Minting and verifying stamps |
| Pure field readers and (de)serialization | Revocation closure and the retired set |
| Op-codes and status codes | The effects of derive, revoke and rendezvous |
Two transports, split by what moves
| Authority plane | Data plane | |
|---|---|---|
| Module | session | uring |
| Carries | Capability movement and synchronous device control | I/O a holder performs on authority it already has |
| Shape | A transactional batch, committed in one trap | io_uring submission and completion rings |
| Timing | Synchronous, all or nothing | Asynchronous, each completion independent |
| Capabilities | Land in stamped arena slots | Never: a completion names a slot and a status |
Because a completion can't carry a capability, no asynchronous authority state can exist. Mapping a device register window, mapping DMA or programming an interrupt are session operations, batched per flow into one crossing, never ring traffic.
One gate into the kernel
Every kernel effect is a session commit. A program stages a descriptor, traps once and reads results from its own arena slots. There are no system call numbers and no system call table: each architecture has one trap, and the kernel funnels it into a single commit entry. The caller's identity is the current thread, never a register.
| Architecture | Instruction | Control word | Inline payload | Return |
|---|---|---|---|---|
| x86-64 | syscall | rdi | rsi rdx r8 r9 r10 rax (48 bytes) | rax |
| AArch64 | svc #0 | x0 | x1–x17 (136 bytes) | x0 |
| RISC-V | ecall | a0 | a1–a7, t0–t6 (112 bytes) | a0 |
A small session rides in the payload registers: the control word sets bit 63 and holds the descriptor length in its low byte. A larger one is staged in the task's descriptor scratch window, and the control word gives its offset. The kernel snapshots a scratch descriptor once, so a sibling thread can't rewrite it between validation and commit.
The return word packs the session's status in bits 0–15, the index of the failing operation in bits 16–31 and the kernel's monotonic clock in milliseconds (mod 2³²) in bits 32–63. Decoding is fail-closed: an unknown status reads as Malformed.
The wire freeze
The surface is frozen at ABI_VERSION = 1. That covers cap, session, device and mem (memory and devices), task, image, uring and clock. After the freeze, changes are additive only:
- New op-code, status and flag values, and new meanings for reserved fields, are allowed.
- Reordering, resizing or changing a field's type is not.
- The io_uring byte compatibility is part of the freeze: those layouts track the Linux wire, not a Kore-private one.
Wire structs are size-pinned, and most are offset-pinned, by const assertions in each module. Sub-surfaces carry their own version stamps that do advance, and a mismatch fails closed rather than being reinterpreted:
| Stamp | Value |
|---|---|
DESCRIPTOR_ABI (session descriptor) | 4 |
BOOTSTRAP_ABI (boot block) | 4 |
GEOM_ABI (address-space geometry) | 7 |
IMAGE_ABI (loader wire) | 3 |
CLOCK_PAGE_ABI | 1 |
PROCESS_IO_ABI (process page) | 13 |
CrashRecord version | 2 |
Module map
| Module | What it defines |
|---|---|
cap | Capability identity, rights, resource kinds and the stamped record |
session | The session descriptor, op-codes, derive and revoke flavors, status codes, parking |
uring | io_uring-compatible ring structures, flags and op-codes |
task | The boot block, roles, geometry windows and spawn parameters |
mem, device | Allocation properties, DMA classes, device records and IOMMU addresses |
clock | The published clock page and timeout submissions |
execution, machine, processor_status | Execution advice, machine facts and processor telemetry |
founding | The boot chain's per-service testimony |
process | Arguments, results and foreground streams shared by a launcher and child |
crash | The bounded crash record |
svc | Wire forms for the system services' protocols |
image, pkg | The loader wire and package manifests |
pointer, input_status | Framed pointer input and input diagnostics |
guest | Virtual CPU exit and control rings for the hypervisor |