BPF Capsule compiler runs full DOOM game logic inside Linux kernel via eBPF
A new project called BPF Capsule compiles large C programs, including a complete DOOM implementation, into standard eBPF bytecode that passes the unmodified Linux verifier and JIT. The system runs game initialization, logic, and rendering entirely inside the kernel, with userspace only supplying the WAD file and keyboard input and receiving back a finished framebuffer each tick. It works without kernel patches or a separate virtual machine, targeting kernels as old as Linux 5.15 on both x86-64 and arm64.
GoKawiil's interpretation of the reporting above, not reported fact.
eBPF's verifier is designed to reject exactly this kind of complex, stateful program, so getting DOOM to pass it demonstrates a technique for smuggling arbitrarily complex application logic into kernel space under strict safety constraints. The real value isn't gaming but running sophisticated parsing or processing logic directly in the kernel without writing a traditional kernel module, which could open new possibilities for high-performance, low-latency kernel-resident applications.
- BPF Capsule compiles full C programs into verifier-compliant eBPF bytecode without kernel modifications.
- DOOM's entire game tick, including rendering, executes inside a single BPF program invocation.
- The technique targets kernels from Linux 5.15 onward and works on both x86-64 and arm64 architectures.
Learning eBPF by Liz Rice (O'Reilly) — If watching DOOM run through the stock BPF verifier and JIT made you want to understand how any of that is possible, this O'Reilly book walks through writing, loading, and attaching eBPF programs yourself. It covers the bpf() syscall, maps, and the verifier rules that make hacks like this so impressive. A great companion for turning "how did they do that" into your own kernel-side experiments.
See Learning eBPF by Liz Rice (O'Reilly) on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.Source: ayles.github.io, 2026-09-09
Published there as: “Show HN: DOOM in the kernel, or fibers in eBPF”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.