Testing Domestic LLMs for UEFI Graphical Application Development: A Comparative Hands-On Evaluation
This article presents a hands-on evaluation of domestic (Chinese) large language models in an unconventional development scenario: building a graphical Snake game that runs directly in the UEFI Shell environment. The test spans three iterative rounds with 27 prompts, covering GOP-based frame buffer rendering, double buffering, level design, obstacle systems, particle effects, and embedded Chinese bitmap fonts. Beyond the successful end-to-end delivery, the article highlights two recurring pitfalls—unauthorized directory access and flawed simulation environment setup—alongside a horizontal comparison of three domestic models across dimensions such as code generation quality, boundary discipline, and end-to-end validation awareness. Practical recommendations are provided for developers seeking to leverage AI assistants in low-level system development.
Benchmarking Domestic LLMs for UEFI Graphical Application Development: A Hands-On Comparison
1. Why UEFI Snake?
Evaluating the real capability of an intelligent programming model with ordinary web pages or scripting tasks offers little differentiation—such code is extremely common in training corpora, meaning the model is more likely “reciting” than “reasoning.” This test therefore deliberately chooses a far more niche scenario: developing a graphical Snake game in the UEFI Shell environment.
This task offers strong differentiation for several reasons:
- High cold-start threshold: UEFI application development relies on dedicated firmware development kits. The toolchain, directory structure, and module description files differ entirely from conventional application development. The model must genuinely understand the build system rather than applying templates.
- Special graphics pipeline: With no OS-provided graphics library available, all drawing must go through the UEFI Graphics Output Protocol (GOP) to directly manipulate the graphics frame buffer. This involves low-level details such as pixel format enumeration, resolution discovery, and double buffering.
- Self-bootstrapping runtime: Pure software validation requires running inside an emulator, involving a complete stack of firmware images, boot media, and the Shell environment. A failure at any point prevents the program from executing.
The final game requirements include: running entirely in a firmware environment, a fully Chinese-language interface, double-buffered rendering to eliminate tearing, multiple levels with increasing difficulty, an obstacle system, particle effects for food consumption, dual control via arrow keys and WASD, and a pause feature.
2. Test Process: Three Iterations, 27 Prompts
The entire development was carried out with one domestic model paired with a mainstream command-line coding assistant, using a progressive prompting strategy across three rounds:
- Round 1: Getting the baseline working. Establish the project skeleton, implement GOP initialization, frame buffer drawing, keyboard input polling, and the core game loop—making the snake move.
- Round 2: Feature enhancement. Add double buffering, a level system, obstacles, and particle effects. Most issues at this stage centered around rendering timing and memory management.
- Round 3: Chinese localization. This step is easily underestimated—the UEFI environment has no ready-made Chinese font rendering solution, requiring an embedded bitmap font and custom character drawing logic.
The full process consumed 27 prompts and took roughly three hours. The final result was satisfactory: the game boots and runs directly at the firmware layer within the emulator, with smooth, tear-free graphics. This efficiency itself demonstrates that domestic programming models now possess the fundamental ability to “build a runnable system from scratch” even in obscure domains. That said, the journey was far from smooth. Two representative issues are examined below.
3. Pitfall One: Unauthorized Directory Access
What Happened
The first instruction was to initialize the project in an empty directory: generate a Chinese project description document declaring the intent to build a GOP-based UEFI graphical application. The model quickly exposed the first problem—it cloned the firmware development kit into the parent directory of the working directory, rather than inside the current one.
The issue escalated during the compilation phase: a scattered collection of toolchain, build output, and configuration directories began appearing in the parent directory, leaving the project structure in complete disarray. Despite the prompt explicitly defining the working directory boundary, the model took the liberty of crossing that boundary and operating elsewhere.
Root Cause Analysis
This boundary-violating behavior is not an isolated case. In a previous test of another domestic model, nearly the identical directory escape occurred. The root causes fall into three categories:
- Training prior interference: Official documentation for UEFI development kits typically recommends organizing multiple parallel directories under a workspace root. The model recalls this typical layout but overlooks the directory constraint in the user’s current instruction—the prior overrides the directive.
- Weak path reasoning: When dealing with relative paths, symbolic links, and path concatenation inside build scripts, the model tends to lose track of “current location,” especially after executing multi-step shell commands.
- Lack of boundary self-checks: A mature intelligent coding tool should verify whether the target path lies within the authorized workspace before writing files, but the model itself typically performs no such inspection.
Practical Recommendations
- When using coding assistants with filesystem write permissions, do not grant the highest privilege level that skips confirmation. Keep manual approval for critical write operations.
- Explicitly declare in the initial prompt: “All files and directories must be created within the current directory; writing anything to the parent directory is forbidden.” Correct any boundary violations immediately as they occur to prevent further contamination.
- Where possible, use containers or separate virtual machines to isolate the development environment, minimizing the blast radius of any unauthorized access.
4. Pitfall Two: Flawed Simulation Environment Setup
What Happened
The initial prompt had already hinted at “planning to run in an emulator.” However, the model chose a shortcut: it directly downloaded a precompiled virtual machine software and firmware image, avoiding the time needed to compile the firmware from source. This introduced a new problem—the precompiled firmware image lacked the UEFI Shell boot option, and the boot media did not contain the application under test. The program compiled successfully, but there was no runnable environment, requiring an additional round of prompts to correct the issue.
Root Cause Analysis
This is a classic misjudgment of “efficiency-first” thinking in system-level tasks:
- The model tends to reuse existing binary resources found online because that is best practice in conventional development. However, in the UEFI context, precompiled firmware configurations vary widely—Shell support and boot item configuration may both be missing. Reusability is far lower than expected.
- The model underestimates the gap between “compiling a binary” and “the binary actually running.” It lacks end-to-end validation awareness—a successful build is only the first step; whether the boot chain is fully closed is the real question.
Practical Recommendations
- Define the end-to-end goal explicitly in the prompt: “The final deliverable must boot and display output in the designated emulation environment.” This forces the model to incorporate runtime validation into its plan.
- Require the model to build the firmware environment from source first, or at minimum verify the feature list of any precompiled image before adopting it (whether Shell support exists, whether custom boot media is supported, etc.).
- Codify “build—deploy—boot—screenshot verification” as a standard pipeline so that failures at each step can be traced quickly.
5. Horizontal Comparison of Three Domestic Models
Combining this test with two previous runs of the same exercise, three mainstream domestic programming models exhibit the following differences in UEFI development scenarios (referred to as A, B, and C below to avoid brand-specific naming):
| Dimension | Model A (this test) | Model B | Model C |
|---|---|---|---|
| Basic code generation | Strong; fixes most compile errors on its own | Strong | Moderate |
| Directory boundary adherence | Boundary violated | Also violated | Good |
| Environment setup judgment | Took shortcuts, caused rework | Conventional | Conservative but complete chain |
| Chinese UI handling | Completed within three rounds | Required more guidance | Bitmap font solution correct on first attempt |
| Long-task stability | Controllable within 27 prompts | Context drift in later stages | Relatively stable |
Overall, all three models possess the foundation to complete obscure system-level tasks. The differences lie mainly in engineering discipline (directory and permission boundaries) and end-to-end closure awareness (environment bootstrapping and validation), rather than pure code generation quality.
6. Conclusion
This hands-on test delivers a clear signal: domestic programming LLMs are now capable of delivering a “from zero to runnable” outcome in niche domains such as the firmware layer. Yet they still fall short of being “safe to fully delegate.” Both the unauthorized access and environment misjudgment issues stem essentially from an insufficient understanding of engineering boundaries and validation closure on the model’s part. For developers, the optimal strategy at this stage is: set explicit constraints, retain confirmation authority, and enforce end-to-end validation. Treat the model as a capable senior assistant that requires supervision, not a fully autonomous engineer. As intelligent coding tools continue to evolve in permission control and task planning, the degree of automation achievable in system-level development is well worth anticipating.
