Capabilities · 1 of 7
How capabilities work
In Orus a process can act only through the capabilities it holds, and memory is one of them. This section explains what a capability names, where a process keeps it, and what holding one costs.
Authority is something a process holds
A capability is a reference to a kernel object together with the rights its holder has over that object. A process reaches an object only through a capability it holds or one derived from it; that is the reach the proof is stated over. There are twelve kinds: untyped memory, frames, processes, threads, endpoints, replies, notifications, address spaces, devices, the console, power, and processor cores.11 The kinds are CapKind in table.rs.
Rights depend on the kind. A frame carries read, write and execute; an untyped carries retype; an endpoint carries send, receive and grant; a thread or a process carries control. A device capability carries none, since holding it is the authority.22 The design record sharing-by-derive lists them, along with a core capability’s maximum priority and an endpoint’s badge.
Memory is a capability too
The kernel allocates nothing after boot. Boot hands all free memory to the first process, the root, as untyped capabilities. To make anything, whether a thread, an endpoint, a process, or a frame to map, a process retypes untyped memory it holds into that object. So a process can consume only what it was granted, and no process can exhaust a kernel resource it was never given.33 The design record is untyped-memory. This is the model seL4 published, taken from its papers; no seL4 code was read.
Paging and allocation policy therefore live in user space, in a pager library an application can replace. The kernel decides no policy of its own, and never kills a process on its own initiative.
Sharing is derive, taking back is revoke
The only way to share a capability is to derive a child of it: a new capability whose rights and memory lie within its parent’s, placed in the deriver’s own table or in the table of a process the deriver controls. There is no copy, because a copy would be a peer its grantor could not take back. Whoever derived a capability can revoke it, and revoking removes exactly its lineage.
That exactness comes from one structure. Every capability, every mapping made through one, and every binding of one object to another is a node of one doubly linked list, kept in depth-first order: a child goes straight after its parent, one level deeper. A capability’s descendants are then exactly the run of nodes after it that are deeper than it, so revoke needs no search. It walks down from the node after the capability to one with no children and unlinks it, a bounded number of times per entry into the kernel, until the next node is no deeper.44 The design record is revoke-by-depth-first-list, and the list and its proofs are list.rs and revoke.rs.
The list runs left to right, and each level of depth is drawn one step lower. The frame and the endpoint were both retyped from the untyped, so they are its children. Revoking the frame removes its mapping, the child frame derived from it, and that frame’s mapping, and stops at the endpoint.
A capability can also be moved, which keeps its place in the list and so keeps everything derived from it. A service hands its capabilities to its replacement this way, and a supervisor can claim the capabilities of a service that died.
Where a process keeps its capabilities
Capabilities belong to a process, not to a thread: the threads of a process share its authority as they share its memory. A process keeps them in a table of two fixed levels, a root of 512 pointers inside the process object and leaves of 127 slots each, retyped from untyped memory as the process needs them. No capability names a table, so a lookup takes a fixed number of loads and a table can never reach itself.55 The design record is process-holds-capabilities.
An object is dead as soon as nothing refers to it, or as soon as its controller destroys it, and every operation then refuses it. The kernel keeps no list of dead objects. The holder of the untyped memory underneath tears the object down by retyping that memory, a bounded slice at a time, so whoever wants the memory back pays for reclaiming it.66 The design record is teardown-driven-by-retype.
Questions this section answers
Each page below takes one question about the table and the memory capabilities in it, and answers it from the source.
- How one slot names a block of memoryA capability to memory does not name a page. It names an aligned block of pages, so one slot of a process’s table can cover anything from 4 KiB to the whole address space.
- How one frame backs many mappingsMapping memory names a frame capability and a page offset inside its block. Each mapping is an entry in a page table, not a capability, so one slot can back every page a process maps from that frame.
- What takes a slot, and what does notA process’s table fills with the capabilities it holds, not with the memory they cover. Mapping pages and building page tables take no slot; grants, the objects a process creates, and the frames a pager cuts up front do.
- Where a process’s slot budget runs outA full table holds 65,024 capabilities. That bounds how much memory a process can hold only when it holds memory as many small, separate blocks, and the bound depends on the block size.
- Growing the capability table, and what each way costsIf 65,024 slots ever prove too few, the table can grow in four ways. Each keeps lookup a fixed number of loads and keeps tables out of reach of capabilities; they differ in what a small process pays and how far the table grows.
- How boot hands out all free memoryBoot is the only time the kernel hands memory out. It gives the first process the machine’s free memory as untyped capabilities, and because each one names an aligned block, the machine’s memory fits in a fixed number of slots.
This section describes kernel commit 31399c5, 17 November 2026.