AI编码
dev.to ·
@Shannon Dev
BooleOS:不亲手写一行代码,构建裸机 x86 操作系统
BooleOS 是一个面向 x86(32 位)的业余操作系统,使用 C99 与 NASM 编写,不依赖 Linux/BSD,也没有 libc。它通过 Multiboot2 引导,自带堆管理器(不使用裸 malloc)、FAT16/VFS 层,目前实现了协作式调度器。作者表示自己不写代码,而是指挥 Claude Code、审查每个 diff 并决定下一步构建内容,所有提交均由 AI 生成;项目 CONTRIBUTING.md 要求贡献同样必须为 AI 生成并附带可验证的 co-author trailer,否则直接关闭。作者认为裸机开发缺少框架、运行时、GC 和 libc 等保护,是比 Web 应用更严苛的 AI 编码测试场景。
AI推荐理由 作者以 Claude Code 生成全部提交、自己只做审查与决策的方式开发裸机 x86 操作系统 BooleOS(C99+NASM、Multiboot2 引导、自研堆管理、FAT16/VFS、协作式调度),并在 CONTRIBUTING.md 中要求贡献也必须为 AI 生成且带可验证 co-author trailer。裸机环境缺少 libc 与宿主 OS 兜底,是比 Web 应用更严格的 AI 编码测试场景,对 Agent 编码能力评估有参考价值;但项目仍处早期,摘要未给出可运行验证或性能数据,属个人项目自述。
72
正文
BooleOS is a hobby operating system for x86 (32-bit), written in C99
and NASM, no Linux or BSD underneath, no libc. It boots via
Multiboot2, has its own heap manager (no raw malloc), a FAT16/VFS
layer, and a cooperative scheduler so far. Repo:
https://github.com/BooleSystems/BooleOS
The actual premise
I don't write the code. I direct Claude Code, review every diff, and
decide what gets built next, but the implementation, every commit, is
AI-generated. This isn't a detail I'm downplaying, it's written into
the project's own CONTRIBUTING.md: contributions have to be
AI-generated too, with a verifiable co-author trailer in the commit,
or they get closed on sight.
Why bare-metal is a harder test for this than a web app
Most "I built this with AI" posts are about apps with a framework,
a runtime, a garbage collector, and years of guardrails baked in.
Bare-metal has none of that. There's no libc to catch a bad pointer,
no OS underneath to kill a runaway process, and the debugger you'd
normally reach for doesn't exist yet because you're the one building
the platform it would run on.
That changes what "reviewing AI output" actually means here. A few
constraints I hold non-negotiable, written into the project's own
CLAUDE.md so every session (including future me) doesn't have to
relearn them:
32-bit is the real target, not a formality. The project is
meant to run on real hardware eventually, and 32-bit vs 64-bit
behavior has to be identical, never diverging with an #ifdef. If
something only breaks in the 32-bit build, that's the bug to fix,
not a build to skip.
No sizeof(void*) == 8 assumptions, ever. Anything serialized
(save format, config) uses fixed-width types from ,
never size_t or long.
No raw malloc, no real threads. Everything goes through a heap
wrapper that mimics the actual constraints of a hobby kernel heap
manager (which has had real corruption bugs historically, so
"allocation is cheap and infinite" is not an assumption this
project gets to make). No pthread either, even though it's right
there on Linux, because it would hide concurrency bugs that only
show up once this ports to the project's real, cooperative
scheduling model.
The two mistakes an AI agent keeps drifting toward, if I don't stay
strict about it: reaching for pthread and malloc because they're
convenient on Linux, and treating the 64-bit dev build as the one
that matters because that's where the debugger runs.
What the workflow actually looks like
I don't hand off a feature request and walk away. For anything that
touches the kernel, I write out the constraint set in the prompt
explicitly (32-bit gate, fixed-width types, no libc), it implements,
I boot it in QEMU myself, read the serial output myself, and only
then decide the next step. Testing is never delegated, ever.
Where it's at
Pre-release, not a 1.0, but with ~20 tagged versions and real
changelogs behind each one. Currently at about USB HID input work,
heading toward a custom graphics API (Cathode) and eventually a
minimal GUI on top of it.
Happy to go deeper on any part of this, the constraint-writing
process, the heap wrapper design, or what a "cooperative scheduler
now, real SMP model later" migration path looks like when none of
the code was hand-typed to begin with.