Hello,
Im programming an Operating System and compile my Kernel binary with MSVC underVisual Studio 2019. Now i doesnt know how to call and load that C++ kernel binary.
My bootx64.efi is also compiled and works so far with simple_uefi. Im only found tutorials in c++with gcc and sysv_abi. and mingw-gcc...
Thanks so far...
[UEFI] MSVC: Bootloader - Call MS_ABI binary (c++)
Re: [UEFI] MSVC: Bootloader - Call MS_ABI binary (c++)
Visual Studio uses PE file format for executable files, from your UEFI loader, write a function which loads the executable into a buffer, copy the entire buffer to a virtual address which will be your base address for Kernel, for my case I use x64 bit so my base address is 0xffffc00000000000, then from there extract the entry point of the pe file, then setup stack memory and call the entry point (base_address+entrypoint). Look at the PE file format article.
Re: [UEFI] MSVC: Bootloader - Call MS_ABI binary (c++)
Check out EDK2 tools and examples. That uses MS_ABI by default, as well as its examples. I don't know how good it is, but there's a PE loader example too.LipkeGu wrote:Im only found tutorials in c++with gcc and sysv_abi. and mingw-gcc...
Cheers,
bzt