Hi,
I am Taha Mirza, 2nd year CS student, I have already introduced my self. I was working on unit testing for the support kit and figure out inconsistent coding structures some using fixtures, some with callers/suties. After some directions though mentor, I decided to transit to something really matters to haiku the most, the thing is, there is no testing framework available for Haiku EFI bootloader.
Context
After power on, the uefi motherboards firmware look for the haiku_loader.efi in ESP partition. Now it loades into memory start executing, it finds the partiion information from UEFI through Protocols like EFI_BLOCK_IO_PROTOCOL to read raw disk, then builds the bootable menu from the BFS(haiku file system). now comes finding kernel here in BFS, and then finally kernal takes control. But before the kernal working officially starts, HEISENBUG (not reproducible) booting errors may occur.
Briefly what i see though code:
1.UEFI executes → efi_main(efi_handle image, efi_system_table *systemTable) that uses Protocols to look for raw disk for kernel loading. After that,
2.main(&args) starts the kernal and uefi finally handles the control.
Problem:
1.failed to find kernel due to inconsistent report of firmware/motherboard/hardware
2. no way to reproduce the booting errors due to no testing available
3. lack of testing infrastructure here.
Do we Really need a testing framework for EFI bootoader ?
No real simulation of EFI firmware or hardware edge cases.
No infrastructure to inject or test problematic partition tables, firmware bugs, or random failures.
No automated test suite for the EFI loader path.
No way to reliably reproduce or debug random boot failures (like the EFI loader not finding a boot partition).
No coverage for real-world, user-facing bugs in the boot process.
Framework:
- Figure out the shadow header problem (“efi_platform.h”, EFI_BLOCK_IO, EFI_STATUS, UINTN does not exist in our os)
- Write mock EFI structs
- Figure out how to compile bootloader code on a host
- Write their own fake disk images, kBootServices, HandleProtocol
- Connect everything to CppUnit
Questions/Feedback:
I understand the shadow header idea — replacing efi_platform.h with a host-compatible version. But I am not sure where exactly the type conflicts happen.
Any suggestion to make the tesitng framework possible would be appreciated.

