I took a look at UEFI:Simple. (https://github.com/pbatard/uefi-simple
) It's basically just gnu-efi with a Makefile...
I found an easier way: just use the mingw toolchain to produce a proper PE. This works for both 32 and 64 bits.
Here is my code:https://github.com/kiznit/kiznix/tree/m ... c/boot/efi
Toolchain for 32 bits:https://github.com/kiznit/kiznix/blob/m ... -efi.cmake
Toolchain for 64 bits:https://github.com/kiznit/kiznix/blob/m ... -efi.cmake
If you are unfamiliar with CMake and using toolchains, check the Makefile here:https://github.com/kiznit/kiznix/blob/master/Makefile