Can AI Build Firmware Software? A Hands-On Account of Developing a Graphical UEFI Breakout Game from Scratch
This article documents an experiment in which an AI model built a graphical breakout game that runs in the UEFI Shell and displays Chinese text. The author set strict limits: a minimal Windows toolchain, no hand-written code, and little technical guidance. The article covers the two development rounds, the AI's self-directed debugging, the display and font challenges, the cost, and the author's conclusions about AI-assisted low-level development.
Background: Can Low-Level Development Be Handed to AI?
Interest in AI-assisted programming has grown quickly. Some developers now jokingly call hand-written coding “old-school” programming. In firmware and BIOS development circles, a common view holds that AI can handle upper-layer applications reasonably well, but it struggles with low-level work such as hardware register access, the UEFI protocol stack, and memory mapping. The reason given is that professional training data is scarce and the context is complex.
This view has some basis. Low-level development has several inherent difficulties:
- No support layer: There is no operating system to provide a graphics library, input framework, or memory manager. Everything must be built from scratch on top of firmware protocols.
- Long debugging feedback loop: A single line change often requires compiling, packaging, writing to a boot medium, and rebooting into the Shell to verify.
- Obscure knowledge: Relevant specifications are dense, community Q&A is sparse, and a model has seen only a limited number of examples during training.
There are also ways to improve results. These include building a local knowledge base with domain material, injecting specification summaries into prompts, and using an iterative approach of small commits with immediate verification. Beyond that, the value of AI is not limited to writing code on your behalf. It can restructure the development process itself. Instead of a human designing the system and then implementing it line by line, the human defines goals and acceptance criteria, while the AI handles exploration and implementation.
To test this, I designed a deliberately demanding experiment.
Experiment Design: Rules and Goals
Challenge Rules
To approximate the practical upper limit of autonomous AI development, I set strict constraints:
- Minimal environment: Install one mainstream C compiler toolchain on Windows and nothing else.
- No local code: The local machine has no existing codebase, and I wrote none of the code myself.
- Minimal guidance: I provided no expert-level technical details, so the AI had to explore and correct its own mistakes.
Goal
Build a graphical breakout game that runs directly in the UEFI Shell and displays Chinese text. Put simply, copy the program to a USB drive, plug it into a computer, boot into the BIOS Shell, and play.
I have used breakout as my go-to test project for years. It has a clear structure and complete logic, and it covers graphics rendering, user input, collision detection, and a game state machine. It is a classic benchmark for programming ability. I had already run similar tests on web and mobile platforms. Firmware is much harder, mainly because the support system is missing.
Model and Approach
I put some thought into model selection. Flagship models perform well, respond quickly, and reason clearly. However, pay-as-you-go pricing is expensive for everyday development. An analogy stuck with me: a Ferrari is excellent, but most people need an affordable family car. I chose a coding plan from a cloud provider and used a Chinese-developed model, aiming for a balance between capability and cost.
Round 1: From Zero to One
Side Note 1: A Fortunate Framework Copy
Early in the experiment, the AI did something I did not expect. It searched for and downloaded the source code of an open-source firmware development framework. This was not part of the plan. Still, it solved the problem of building the environment from nothing, since the framework’s build scaffolding is the most tedious part of low-level development. Finding an existing foundation and building on top of it is a strategy senior engineers also use.
Side Note 2: Detours During Compilation
The process was not smooth. When compiling modules, the AI first tried to organize the project according to its recollection of the directory structure and compiler flags. These did not match the actual framework version, and errors piled up. The correction process is worth noting. The AI read the compiler error output, compared it against the real directory structure, fixed the build configuration, and got the build working on its own. This error-driven self-debugging was key to going from zero to one.
First Successful Run
After several cycles of compiling, reading errors, and fixing, the program finally produced an application that runs in the Shell. The first time I saw the game render on a real machine, the core pipeline worked. The graphics output protocol call succeeded, keyboard input was read correctly, and the main game loop was running. The visuals were rough and the brick layout was simple, but the goal of going from zero to one was met. This showed that the AI could build a firmware application on its own without line-by-line guidance.
Round 2: From Working to Polished
Stage 1: Feature Expansion
After the game worked, I moved to feature iteration. The AI added paddle movement tuning, gradually increasing ball speed, multiple levels, scoring, and a lives system. In this stage, I could describe requirements in natural language, and the AI understood the game design intent and implemented it accurately. After each change, I ran the build and tested it. When I found a problem, I described it in a sentence, and the AI could locate and fix it.
Stage 2: Visual Polish
Once the features were complete, the AI added visual improvements at my prompting: borders, gradient-colored bricks, and simple animation effects. With only the basic graphics output protocol available, every effect was drawn pixel by pixel. The code was substantial, but the AI handled it methodically.
Stage 3: Display Challenges
This stage brought the largest technical obstacle in the project: adapting to different resolutions and display modes. Each machine’s firmware supports a different set of graphics modes. The AI had to enumerate the available modes, pick the best resolution, and handle scaling. Several test machines showed display errors. The AI output diagnostic information and checked the return value of each protocol call. Eventually, it covered a wide range of hardware.
Side Note 3: Chinese Comments Cause Build Failures
Adding Chinese comments to the source code caused a character encoding problem that broke the build. This is a typical pitfall of low-level toolchains. Encoding behavior in cross-compilation environments differs greatly from higher-level development. After several attempts, the AI fixed the problem by standardizing the source encoding and compiler flags.
Stage 4: Chinese Text Rendering
The last challenge was displaying Chinese text. The firmware environment has no system font library. The AI’s solution was clever: it embedded a minimal font built from bitmap data, which enabled pixel-level rendering of Chinese characters. The AI handled the whole process itself, from generating glyph data and converting it to bitmap arrays to writing the rendering functions. When the screen correctly displayed a Chinese title and prompt text, all the experiment’s goals were met.
Summary: What the AI Did on Its Own
Looking back, the AI completed all of the following work without my direct involvement:
- Environment exploration: Downloaded and understood the firmware development framework, and set up the build system.
- Implementation: Wrote all the code for graphics rendering, input handling, collision detection, and the state machine.
- Self-debugging: Read compile errors and runtime failures, and iteratively fixed them.
- Compatibility work: Adapted display modes across multiple machine models and resolved encoding issues.
- Creative solutions: Embedded a bitmap font to render Chinese text.
My role was limited to defining goals, accepting results, and giving feedback in natural language.
Cost and Retrospective
Time: The entire experiment took one working day, including compile wait times and round trips for testing on real hardware.
Money: I used a subscription plan, which cost far less than pay-as-you-go flagship model pricing. It was affordable for an individual developer.
Output: The final deliverable is a fully functional firmware graphics application with Chinese text support that runs on multiple machine models. It contains several thousand lines of code.
Conclusion
The experiment gave a clear answer: low-level development is not off-limits for AI. Three shifts in thinking matter most:
- A change in paradigm matters more than code generation. When AI leads exploration and implementation while humans define goals and verify results, the efficiency gain is an order of magnitude.
- Short iteration cycles are essential to low-level development. The feedback loop with real hardware must be as short as possible so the AI can correct course based on error messages.
- Choose the model based on the task. Flagship models suit the hardest problems, and cost-effective models are good enough for everyday iteration. Choosing by scenario is the sensible strategy.
The claim that “AI cannot write low-level code” is probably due for a revision.
