From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: How to add a DXE driver to an OVMF image? To: devel@edk2.groups.io From: d.meneses@softi9.pt X-Originating-Location: RO (146.70.128.235) X-Originating-Platform: Linux Chrome 106 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 02 Nov 2022 04:11:24 -0700 Message-ID: Content-Type: multipart/alternative; boundary="Z2H5ZTbU7sML0ZcXgaBd" --Z2H5ZTbU7sML0ZcXgaBd Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable As detailed on this post on Super User ( https://superuser.com/q/1749795/17= 42482 ) ,=C2=A0I am trying to *add a DXE driver to an OVMF image* I'm build= ing with edk2. Nobody was able to help me there so I turn here for your hel= p. I haven't found any proper documentation on exactly what I'm trying to achi= eve 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 =3D 0x00010005 BASE_NAME =3D Hello FILE_GUID =3D... MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 ENTRY_POINT =3D 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 too= lchain * Add *MdeModulePkg/Application/Hello/Hello.inf* to the end of the componen= t section (I have tried to add it after other certain drivers) in the *.dsc= * file. *=20 Add *Mde* *ModulePkg/Application/Hello/Hello.inf* to the end of the *[ FV.D= XEFV* *]* section in *OvmfPkgX64.fdf* (I have also tried to add it after ot= her certain drivers) *=20 Run *build* *=20 Run *QEMU* with the resulting *OVMF* image: *qemu-system-x86_64* *-d int -D= log.txt -bios OVMF.fd -net none -drive file=3Dfat:rw:bootdrv, format=3Draw= * *=20 *QEMU* hangs with message *"Guest has not initialized display (yet)"* *=20 *log.txt* has one log: *check_exception old: 0xffffffff new 0x6* --Z2H5ZTbU7sML0ZcXgaBd Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
this post = on Super User, 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.
create the simplest DXE driver I = managed
In folder MdeModulePkg/Applica= tion/Hello, I have:
include
 
...
 
while (1)
      &n= bsp; SystemTable->ConOut->OutputString(SystemTable->ConOut,
            &= nbsp;                    =         L"It works!\n");
return EFI_SUCCESS;

=  
= Hello.inf
[Defines]
  INF_VERSION          =           =3D 0x00010005
  BASE_NAME          &n= bsp;           =3D Hello
  FILE_GUID = ;                     =3D=  ...
  MODULE_TYPE          =           =3D DXE_DRIVER
  VERSION_STRING        &nbs= p;        =3D 1.0
  ENTRY_POINT          =           =3D UefiMain


[Sources]
  Hello.c

[Packages]
  MdePkg/MdePkg.dec
  MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
  UefiDriverEntryPoint
  UefiLib

[Depex]
    TRUE
  • Set OvmfPkg/Ovmf= PkgX64.dsc as my target platform with GCC5 as the toolchain
  • Add MdeModulePkg/Application/Hello/Hel= lo.inf to the end of the component section (I have tried to a= dd it after other certain drivers) in the .dsc file.<= /span>
  • Add MdeModulePkg/Application/Hello/Hello.inf to the end of the <= /span>[FV.DXEFV] section in OvmfPk= gX64.fdf (I have also tried to add it after other certain dri= vers)
  • 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=3Dfat:rw:bootdrv,format=3Draw
  • QEMU hangs with message "Guest has= not initialized display (yet)"
  • log.txt has = one log: check_exception old: 0xffffffff new 0x6
 
--Z2H5ZTbU7sML0ZcXgaBd--