Can we compile EDK2 UEFI Bootloader without waiting too long

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Can we compile EDK2 UEFI Bootloader without waiting too long

Post by devc1 »

The EDK2 page in the osdev wiki tells us to build all the MdeModulePkg to make our UEFI executable image, but this takes too long even for minor changes in my bootloader (almost 5 minutes on my PC).
Shouldn't we build MdeModulePkg only one time then build our UEFI app ?
how can I compile my EFI bootloader in EDK2 without having to compile every other package ?
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Can we compile EDK2 UEFI Bootloader without waiting too

Post by nexos »

5 minutes? You must be using a very old PC.

Anyway, yes, you must build the whole MdeModulePkg. I've tried other ways, they don't work.

TBH, I would recommend avoiding EDK2 and use CL or MinGW directly.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Can we compile EDK2 UEFI Bootloader without waiting too

Post by Octocontrabass »

Another vote for avoiding EDK2. I use Clang and MinGW-w64 GCC directly (though obviously you don't need to use both - one compiler is enough). Build times are under 1 second on my machine, and that includes the overhead of WSL.

I also wrote my own UEFI headers, but you don't need to do that.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: Can we compile EDK2 UEFI Bootloader without waiting too

Post by kzinti »

+1 for clang with my own headers, makes it very simple (mingw is as easy to use as clang).

Here are some cmake toolchain files if you use cmake:
https://github.com/kiznit/rainbow-os/tr ... toolchains
Post Reply