AI Coding Assistants in BIOS-Level Development: Building a UEFI Graphics Game from Scratch

    This article documents a strict hands-on test in which an AI coding assistant, with minimal human guidance, built a brick-breaker game for the UEFI Shell. It covers toolchain setup, framebuffer rendering, Chinese glyph support, the AI’s capabilities and limits, cost and iteration speed, and the emerging human-AI collaboration model for low-level systems work.

    AI-assisted programming has been widely validated in upper-layer application development, but low-level system development is still often regarded as a禁区—a no-go zone—for AI. Can we really expect AI to handle hardware programming, register operations, and protocol stacks? With that question in mind, this article records an unusually strict hands-on test. The AI led the entire process, while the developer acted only as a validator.

    Challenge Setup: Letting AI Work Alone in Uncharted Territory

    The experiment chose a highly representative low-level development scenario: application development in the UEFI (Unified Extensible Firmware Interface) environment. The reason was straightforward. UEFI development involves firmware interface specifications, graphics output protocols, memory management strategies, and other specialized technical stacks. It also requires a compile-and-link workflow that is fundamentally different from general-purpose operating system environments.

    The experiment rules were as follows:

    • Development environment: Only Visual Studio 2019 was installed. No additional toolchain was deployed.
    • Local code assets: Zero. No reusable code snippets were provided.
    • Professional guidance: Limited to the minimum. The AI had to make all technical decisions independently.
    • Development goal: Build a graphics brick-breaker game that could run directly under the UEFI Shell, with Chinese character rendering support as a mandatory requirement.

    The brick-breaker game was chosen as the test vehicle for a direct reason: it contains a complete set of core game elements—event loop, real-time rendering, collision detection, and input handling—while remaining compact enough to validate development efficiency within a limited time.

    Experiment Process: Humans Step Back, AI Steps Forward

    The experiment showed unexpected complexity from the very beginning of environment preparation. Because the AI could not directly operate the physical environment, every action requiring human intervention—such as saving files, creating directories, and executing commands—had to be handled through clear instructions and asynchronous interaction with the AI.

    Phase 1: Project Skeleton and Toolchain Adaptation

    The first round of dialogue started from zero. The AI first needed to understand the target environment’s characteristics: UEFI applications differ fundamentally from ordinary desktop programs in entry point, memory management, and system service invocation. The AI’s first key decision was to use the GNULegacy toolchain for cross-compilation. This approach could compile a .efi file executable under the UEFI Shell in a Windows environment.

    However, the first compilation attempt immediately hit a setback: missing low-level header files broke the build chain. Further investigation revealed that the AI had made an omission when handling header file include paths—some platform-provided headers were incorrectly classified as externally acquired dependencies. The root cause was that the AI’s understanding of the target platform’s project structure was not deep enough, so it could only narrow down the error range through repeated trial and error.

    Notably, when trying to compile the boot protocol, the AI adopted a simplified approach: copying the entire platform development package into the project. This “trade space for correctness” strategy was not elegant, but during the chaotic integration stage, it was a pragmatic choice.

    Phase 2: Core Logic and Graphics Rendering

    Once the build system was initially working, development entered the real core: business logic. The brick-breaker game’s main loop, collision system, and physics simulation—ball speed, bounce angle, and paddle inertia—were completed efficiently within a few rounds of dialogue. The AI-generated code showed a clear modular structure: main flow, entity state, rendering logic, and input handling each had their proper place, and readability was quite good.

    The graphics rendering stage revealed the unique challenges of low-level development. Unlike H5 or GUI frameworks, graphics output in the UEFI environment must directly operate on the framebuffer—meaning rectangle drawing requires managing the filling of every pixel. The AI’s original approach was pixel-by-pixel matrix filling. Runtime efficiency was acceptable, but there was obvious room for performance optimization. After dialogue-based instructions, the AI quickly switched to a block-fill method based on a hardware-accelerated protocol, achieving a clear performance improvement over the first version.

    Phase 3: The Hard Nut of Chinese Rendering

    Chinese character display was the most difficult technical challenge in the experiment. The UEFI graphics output protocol supports only a basic Latin character set and cannot directly handle Chinese. This required building a complete glyph rendering pipeline: font file parsing, glyph bitmap extraction, and bitmap buffer drawing.

    The AI’s approach here was to use a 16x16 bitmap font, convert it into a grayscale bitmap, write it into a texture buffer, and then output it to the screen through a dedicated drawing protocol. The first problem encountered was memory alignment for glyph data. If arranged directly as a byte stream, horizontal and vertical pixel misalignment would occur during display. Through debugging feedback, the AI recognized the relationship between rendering parameters and memory layout and corrected the data organization method in time.

    A bigger challenge came from encoding confusion caused by Chinese comments and strings. When the compiler’s default code page and the source file encoding were inconsistent, Chinese strings were embedded into the binary as garbled text. The AI’s solution was to preprocess Chinese strings with Unicode escapes, bypassing the encoding conversion obstacle and ensuring correct compiler output.

    Evaluation: The Power of AI and the Responsibility of Humans

    The entire experiment took about five hours. During this period, the AI completed all development work, from building from scratch to the first runnable version and multiple rounds of iterative optimization. Throughout the process, the human role was strictly defined as “instruction issuer + runtime result validator.” Any step requiring professional judgment—except for specifying correction directions—did not involve hands-on operation by the human.

    The Real Capability Boundary of AI

    Judging from the results, the AI’s performance exceeded what most low-level developers would expect. It could independently complete architecture selection, interface adaptation, and code generation based on its understanding of the UEFI specification. It also continuously self-corrected across multiple iterations, showing a certain ability to locate and fix problems.

    But the limitations were equally clear. When the root cause of a problem fell outside the model’s knowledge coverage, the AI produced repair plans that seemed reasonable but were actually ineffective, repeatedly trying and failing to converge on an optimal solution. In the Chinese rendering stage, this “pseudo-fix” behavior was particularly prominent. The AI gave multiple rounds of correction code in completely different directions, but none solved the problem.

    A Sober Look at Cost and Efficiency

    Economically, the AI API cost for this experiment was roughly tens of RMB, far below the development cost of several hours of a professional engineer’s time. But it must be noted that this was premised on the developer bearing full responsibility for testing, validation, and course correction. If validation and repair time are included, the total five-hour duration still has an advantage over traditional manual development, but the advantage is significantly compressed.

    The real leverage for efficiency improvement lies in the iteration rhythm. AI can produce a complete plan and deliver code within minutes, allowing developers to complete multiple rounds of “plan evaluation—experimental validation—requirement revision” within a shorter mental cycle. This is especially valuable for exploratory tasks.

    Conclusion: A New Collaboration Paradigm Has Already Begun

    Low-level development does have areas where AI falls short. It lacks real hardware interaction experience and is prone to “hallucinations” in details such as physical timing and encoding boundaries. But the plan-generation capability and rapid iteration capability AI provides are already enough to restructure the traditional development workflow and free humans from tedious boilerplate code and logic orchestration.

    In the current collaboration model, the developer’s core ability is shifting from “how to write” to “how to command.” How to ask the right questions, how to evaluate the AI’s proposed plans, and how to intervene and correct course at critical moments—these will become new core competencies. For low-level system developers, rather than resisting this trend, it is better to think about how to make AI a sharp tool for their own use.

    Incidentally, if an intelligent programming assistant that supports private deployment is used—providing internal enterprise standards, historical code repositories, and platform SDKs as a knowledge base for the model—its performance in vertical domains such as a specific firmware platform or chip architecture could improve substantially. This may be a viable path for AI to move from “generalist” to “specialist.”