Input

July 16, 2026 · View on GitHub

How a keystroke or a pointer motion reaches an application. NØNOS keeps input in one place in the kernel, a bounded ring, and moves the policy of routing events to windows out into a capsule. Driver capsules post events into the ring, the kernel wakes a single router capsule, and the router fans each event out to the consumer that owns the focus.

PageWhat it covers
ring.mdThe bounded MPSC ring, drop-on-full with a counter, the monotonic sequence number, and the single-waiter wakeup.
path.mdThe InputEvent record, the MkInputEventPost / Drain / Wait syscalls, and the driver-to-router-to-consumer path.
drivers.mdThe four input driver capsules (PS/2, i2c-PCI, i2c-HID, USB-HID), the claim / grant / IRQ / read / post model each follows, and how real hardware splits input across all of them at once.

The shape to keep in mind is that the kernel does the least it can: it holds a 1024-entry ring, counts drops rather than blocking a producer, publishes a sequence number so the consumer can wait on an edge, and wakes exactly one router capsule. Everything above that, which window has focus, how a scancode becomes a character, how events are delivered to a shell or a GUI, is a capsule's job, reached over IPC. This mirrors the hardware broker: the kernel owns the minimal shared mechanism, capsules own the policy.

Sources

The ring is src/kernel_core/surface_registry/input_ring.rs with its types in the same directory; the syscalls are src/syscall/dispatch/router/input_ops.rs; and the router capsule is src/userspace/capsule_input_router/. Driver capsules that post live under src/hardware/ and src/userspace/. Every page is verified against those trees with file:line references.