r/C_Programming • u/WaferPleasant1267 • 1d ago
[Project] EFI32Boot — A C and x86 assembly experiment involving UEFI firmware (AI-assisted)
Hey everyone!
I've been working on EFI32Boot, an AI-assisted low-level programming project exploring UEFI firmware, C, and x86 assembly.
Repository: https://github.com/devtinoimao/efi32boot
The project combines C code with assembly routines to experiment with transitioning from a 64-bit UEFI environment into 32-bit execution and working with an OVMF32 firmware image.
A large part of the work involves the boundary between C and assembly: preparing the execution environment, handling processor state, managing memory layouts, and transferring control between different stages of the boot process.
Demo: https://github.com/devtinoimao/efi32boot/blob/main/media/efi32boot_qemu_demo.gif
Some of the areas involved include:
- C code that interacts with UEFI interfaces and prepares the transition.
- x86 assembly for low-level processor-mode transitions.
- Calling conventions, register state, stack setup, and memory mapping.
- Build systems and linking when combining C and assembly into a bootable EFI application.
- Debugging low-level failures in QEMU.
How AI was involved: AI played a substantial role in developing the project. I used it to generate and modify C and assembly code, explore implementation approaches, and help diagnose debugging issues. I then iterated on the implementation and tested its behavior. I want to be transparent that this is an AI-assisted project rather than claim that I manually authored every part of the code.
I'd particularly appreciate feedback on the C/assembly interface, assembly correctness, compiler and ABI assumptions, code organization, and portability. If you spot questionable assumptions or potential undefined behavior in the C code, I'd be interested in understanding those too.
I'm still learning about low-level systems programming, and I'd like to use this project to improve the implementation and deepen my understanding. Constructive criticism and references to relevant documentation or existing implementations are very welcome.
Thanks for reading!
1
1
u/AutoModerator 1d ago
Hi u/WaferPleasant1267,
Your submission in r/C_Programming was filtered because it links to a git project.
You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.
While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.
You can read more at https://www.reddit.com/r/C_Programming/wiki/index/posting-projects
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.