Build UEFI application


Peter Wiehe <info@...>
 

Hi, all!
I have built EDK II and then OVMF. Now I want to develop an UEFI application with EDK II. Is there any documentation about that?

Greetings
Peter


Tomas Pilar (tpilar)
 

Hi Peter,

I don’t recall a specific application-writer's-guide but the Driver Writer's Guide and the UEFI Specification are quite comprehensive.

That said, you want to have a look at existing applications, particularly at MdePkg/Application/HelloWorld to see how they are built. In particular, you will need these non-obvious things:

Your application will need to use UefiApplicationEntryPointLib to specify which function is the entry point.
Your application will need its own .inf module file and you will need to specify the .inf file in the platform .dsc file in the [Components] section. You then build your application by building that platform.

Hope that gets you started.

Cheers,
Tom

-----Original Message-----
From: discuss@edk2.groups.io <discuss@edk2.groups.io> On Behalf Of Peter Wiehe via groups.io
Sent: 20 June 2020 07:35
To: discuss@edk2.groups.io
Subject: [edk2-discuss] Build UEFI application

Hi, all!
I have built EDK II and then OVMF. Now I want to develop an UEFI application with EDK II. Is there any documentation about that?

Greetings
Peter


Laszlo Ersek
 

On 06/20/20 08:35, Peter Wiehe wrote:
Hi, all!
I have built EDK II and then OVMF. Now I want to develop an UEFI application with EDK II. Is there any documentation about that?
I can give you three links:

http://mid.mail-archive.com/E92EE9817A31E24EB0585FDF735412F5B8B381E8@ORSMSX113.amr.corp.intel.com

https://bugzilla.tianocore.org/show_bug.cgi?id=1734

https://github.com/tianocore/edk2-libc/tree/master/AppPkg

Basically I think you'd first have to decide the kind of entry point you
want (UefiApplicationEntryPoint for a "standalone" UEFI application,
ShellCEntryLib for a shell application (ShellAppMain()), or LibC for a
standard C application (main())). Then you'd use whatever functionality
is available (services and protocols from UEFI, libraries from edk2,
standard C stuff from edk2-libc).

The following document also contains hints on applications:

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Driver-Writer%27s-Guide

Thanks
Laszlo