public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* How to add a DXE driver to an OVMF image?
@ 2022-11-02 11:11 d.meneses
  2022-11-03  0:58 ` [edk2-devel] " Pedro Falcato
  0 siblings, 1 reply; 15+ messages in thread
From: d.meneses @ 2022-11-02 11:11 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

As detailed on this post on Super User ( https://superuser.com/q/1749795/1742482 ) , I am trying to *add a DXE driver to an OVMF image* I'm building with edk2. Nobody was able to help me there so I turn here for your help.

I haven't found any proper documentation on exactly what I'm trying to achieve so I am probably missing something.

So far what I have done is:

* create the simplest DXE driver I managed

In folder *MdeModulePkg/Application/Hello* , I have:
*Hello.c* :
include

...

while ( 1 )
SystemTable -> ConOut -> OutputString ( SystemTable ->ConOut,
L " It works! \n " );
return EFI_SUCCESS ;

*Hello.inf* :
[ Defines ]
INF_VERSION = 0x00010005
BASE_NAME = Hello
FILE_GUID =...
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = UefiMain

[ Sources ]
Hello.c

[ Packages ]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec

[ LibraryClasses ]
UefiDriverEntryPoint
UefiLib

[ Depex ]
TRUE

* Set *OvmfPkg/OvmfPkgX64.dsc* as my target platform with *GCC5* as the toolchain
* Add *MdeModulePkg/Application/Hello/Hello.inf* to the end of the component section (I have tried to add it after other certain drivers) in the *.dsc* file.
* 
Add *Mde* *ModulePkg/Application/Hello/Hello.inf* to the end of the *[ FV.DXEFV* *]* section in *OvmfPkgX64.fdf* (I have also tried to add it after other certain drivers)

* 
Run *build*

* 
Run *QEMU* with the resulting *OVMF* image: *qemu-system-x86_64* *-d int -D log.txt -bios OVMF.fd -net none -drive file=fat:rw:bootdrv, format=raw*

* 
*QEMU* hangs with message *"Guest has not initialized display (yet)"*

* 
*log.txt* has one log: *check_exception old: 0xffffffff new 0x6*

[-- Attachment #2: Type: text/html, Size: 27957 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-11-10  7:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 11:11 How to add a DXE driver to an OVMF image? d.meneses
2022-11-03  0:58 ` [edk2-devel] " Pedro Falcato
2022-11-03  1:07   ` Andrew Fish
2022-11-03 15:23     ` d.meneses
2022-11-03 16:51       ` Pedro Falcato
2022-11-03 19:11         ` d.meneses
2022-11-03 21:34           ` Andrew Fish
2022-11-03 22:02             ` d.meneses
2022-11-03 22:02               ` Pedro Falcato
2022-11-03 22:12                 ` d.meneses
2022-11-04 13:20                   ` d.meneses
2022-11-09 17:52                     ` Andrew Fish
2022-11-09 18:29                       ` d.meneses
2022-11-09 20:09                         ` Andrew Fish
2022-11-10  7:43                           ` d.meneses

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox