# BPF Capsule - Run complex C programs inside eBPF

Original title: Show HN: DOOM in the kernel, or fibers in eBPF

> Hacker News story 49630125 · language: en · submitted 2026-09-09
> Web version: https://zeli.app/story/49630125
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 51 · by [ayles](<https://news.ycombinator.com/user?id=ayles>) · 💬 14
[original](<https://ayles.github.io/doom-in-kernel/>) · [HN discussion](<https://news.ycombinator.com/item?id=49630125>)

## Summary

BPF Capsule is a compiler and runtime that transforms large C, C++, or no_std Rust programs into a form the stock Linux verifier accepts, enabling complex application logic to run directly in the kernel. It achieves this through regions, fibers, and a software stack, without kernel patches or a userspace VM. The project demonstrates its power by running DOOM entirely in eBPF, but the real value is in packet parsing, statistics, and other kernel-side tasks that previously required manual rewriting. Try it with one command on Linux 5.15+.

## Key quote

> DOOM initialization, game logic, and rendering all execute in the kernel. One game tick, including the complete frame, finishes in a single BPF invocation.

## HN discussion (14 comments)

### [tptacek](<https://news.ycombinator.com/item?id=49647586>)

> There's so much good content in here, it's a shame you sandblasted your writeup with AI. "To the verifier, it is a number with a biography" is where I veered off the road and into a culvert.

### [markrwilliams](<https://news.ycombinator.com/item?id=49649716>)

> Skip the first half of the article to learn how the project overcame eBPF programs' limited runtime environment:
>
> "On Linux 6.9 and newer (6.10 on arm64, where JIT support for the arena landed later), the window is backed by bpf_arena... On kernels without a usable arena, the same four gigabytes are assembled from 4-MiB pieces... [in] separate global-data maps."
>
> These maps are of type BPF_MAP_TYPE_ARRAY.
>
> See https://lwn.net/Articles/961941/ for a discussion of `bpf_arena`.

### [phishin](<https://news.ycombinator.com/item?id=49649117>)

> I appreciate adherence to the all caps requirement.

---

## Cite

- Page: https://zeli.app/story/49630125
- Date: 2026-09-09
- Source: ayles.github.io (https://ayles.github.io/doom-in-kernel/)
- Hacker News: https://news.ycombinator.com/item?id=49630125

## Other languages

- zh: https://zeli.app/zh/story/49630125 · markdown: https://zeli.app/zh/story/49630125.md
- ja: https://zeli.app/ja/story/49630125 · markdown: https://zeli.app/ja/story/49630125.md
- ko: https://zeli.app/ko/story/49630125 · markdown: https://zeli.app/ko/story/49630125.md
- de: https://zeli.app/de/story/49630125 · markdown: https://zeli.app/de/story/49630125.md
- es: https://zeli.app/es/story/49630125 · markdown: https://zeli.app/es/story/49630125.md
- ru: https://zeli.app/ru/story/49630125 · markdown: https://zeli.app/ru/story/49630125.md
