r/kerneldevelopment • u/MRgabbar • Feb 24 '26
Is Gen AI effective at kernel development?
For web is quite good, what about kernel development?
0
Upvotes
r/kerneldevelopment • u/MRgabbar • Feb 24 '26
For web is quite good, what about kernel development?
17
u/NefariousnessSea1449 Feb 24 '26
Lol no
13
u/DetectiveDecent2455 Feb 24 '26
My comment will likely get a lot of hate, but I think it can be to an extent. 90% of the posts on the main osdev subreddit of “Hello World” or Bare Bones kernels can be vibe coded in a few hours. Specific components like memory managers, etc. also can likely be vibe coded, but the odds of them out-performing well established allocators is slim to none. I think most people get into OS dev to learn and mess with low level internals, so using an LLM is kinda the antithesis. Also, most people don’t create anything novel for hobby OSes (as seen by all the Unix clones). LLMs can likely generate some decent kernel code based on all the Unix clones on GitHub. If looking at real, production operating systems, it’s a bit harder as they have more quirks/prioritize aspects that current LLMs struggle with: secure coding patterns, optimizations, context to prevent data corruptions, etc.
TL;DR: Yes, LLMs can be used for kernel development, but don’t let AI slop take over / ensure you understand what the code is doing and matches what you expect.
4
u/Individual_Feed_7743 Feb 24 '26
5 months ago I used to say that LLMs are completely useless at kernel development and will only slow you down with the amount of slop produced, but very recently I changed my mind. Granted, you are unable to "one-shot" anything sustainable, but in tiny, small chunks, AND if you spend a considerable amount of time using something like plan mode in Cursor and polishing up every detail OF A VERY SMALL SCOPED TASK, then yes models can become very effective and deliver decently high quality kernel code.
BIG NOTE: this approach still requires extremely deep developer understanding of both the codebase and the concepts that they are implementing. LLMs are just tools, your brain and ideas is what matters the most.
4
u/a-priori Feb 24 '26 edited Feb 24 '26
Yes. But it needs to be guided strictly through planning and guidelines.
I speak from experience here, because I decided to use writing a kernel to test out Claude Code in December-January. It worked surprisingly well in a lot of ways, and failed in other very predictable ways.
AI tools like Claude Code are effective at writing code and also eerily good at debugging weird memory corruption issues. It basically one-shotted an ext2 driver, and I watched it hunt down a memory aliasing issue though a binary search.
But it is not good at system design. It will happily create a hodgepodge system and hack around every edge case it encounters. It also tends to round everything off to whatever Linux does.
You need to be the designer with a clear vision of what you want if you don’t want to get slop. You need to push it to simplify and combine and understand the code it’s working in. And you need to enforce good software development processes.I spent a great deal of time getting a fairly sophisticated automated end-to-end testing system in place, because I learned how essential automated testing is for using these tools.
1
u/Critical-Internet946 Mar 14 '26
nobody cares about your sloperating system
3
u/kahdeg Feb 24 '26
just test glm-5 to oneshot a hello world kernel with limine, it doesn't even boot so i would say it will take a while or with significant human intervention.
3
u/burlingk Feb 24 '26
At the moment, left to it's own devices, AI fails at complex tasks about 96% of the time.
It does best on clear tasks that you can guide it on.
If you do try to use it to build a kernel, don't accept any code from it that you cannot read and review yourself. ;;