[edk2-devel] Help with Logo Display Problems

Andrew Fish via groups.io afish=apple.com at groups.io
Mon May 11 18:27:37 UTC 2020


Jim,

Sorry wrote this yesterday and did not hit send....

All my example are from OVMF using QEMU on a Mac. You should be able to run OVMF too as a way to learn things. 

> On May 9, 2020, at 8:00 PM, jim slaughter <jim.slaughter at sage-micro.com> wrote:
> 
> Hello,
> 
> I have followed previous directions provided and the build works ok. I built an IA32 generic binary.
> I cannot tell if the logo code is working since I cannot see the logo on my display.
> 
> I do see a file in the ~/src/edk2-stable202002/Build/MdeModule/DEBUG_GCC5/IA32/$ directory, called LogoDxe.efi and another called LogoDxe. This leads me to believe that the Logo entry point is in the image.
> 

So that means it got built. 

> After the build I did find an empty map file? How do I get a map of the build?
> 

You can generate a build log by adding '-y build.log' to the build command. Here is a OVMF example [1].

If you just want to inspect a FD or FV (Firmware Device is the ROM image composed of Firmware Volumes and other bits). Here is an OVMF example. Here is an OVMF example [2].

> How do I debug this problem? I have no debugger. Can I freely use DEBUG((...........)); .
> 

In general yes. The DEBUG_ERROR level should always print out. 

You should see this in the serial output when the driver loads:
Loading driver at 0x00007ABE000 EntryPoint=0x00007AC02BB LogoDxe.efi

It failed for me as Xcode currently does not support injecting resource sections in to PE/COFF images. I'm just mention this as I can't show you the expected output, but your toolchain should do the right thing. 
HII Image Package with logo not found in PE/COFF resource section
Error: Image at 00007ABE000 start failed: Unsupported

But that brings up the point of what LogoDxe is doing. If we look at the driver entry point, called InitializeLogo [3], it does the following:
1) Locates some Hii protocols
2) Grabes the gEfiHiiPackageListProtocolGuid from the drivers image handle.
  a) The logo.bmp file was injected into the resource section of the PE/COFF image and this data is made availible when the driver loads. 
3) Puts the Logo (Hii Package List) into the Hii database
4) Publishes a protocol (API) that has a member function that returns the logo. 

So loading the LogoDxe driver just publishes an API that lets some one else grab a logo.

OK so lets take a look [4]. 
1) When the gEdkiiPlatformLogoProtocolGuid is installed you should see something like this on the serial log (XXX is me being lazy and it will be upper case):
    InstallProtocolInterface: 53cd299f-2bc1-11D2-40c0-XXXXXXXX  721C040

2) Looks like the consumer of gEdkiiPlatformLogoProtocolGuid is BootLogoLib. It looks like BootLogoEnableLogo() does the magic. 
  a) BootLogoEnableLogo() is called from the PlatformBootManagerLib [5]
  b) So lets see who is using that lib [6].
  c) It looks like PlatformBootManagerAfterConsole() calls BootLogoEnableLogo ().
  d) And that is called from BdsEntry(). 

The BDS driver loads earlier in the boot process, but the BdsEntry is only called after all the drivers have dispatched. So look for this in the serial output to see when BdsEntry() is called :
[Bds] Entry..


The other thing to look out for is there can be more than one copy of a library [7]. You platforms *.DSC file picks the library instance your platform is using [8]. In the lingo the Library Class is the definition of the API, the public .h file, and the Library Instance is which library you chose to use. 

> Any help please. I am stuck. Thank you.


[1] build -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t XCODE5 -y build.log

[2]  VolInfo  Build/OvmfX64/DEBUG_XCODE5/FV/OVMF_CODE.fd 

[3] If look in LogoDxe.inf you will see `ENTRY_POINT                    = InitializeLogo` and this is how we find the entry point of the driver.

[4] git grep -i gEdkiiPlatformLogoProtocolGuid
MdeModulePkg/Include/Protocol/PlatformLogo.h:65:extern EFI_GUID gEdkiiPlatformLogoProtocolGuid;
MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:66:  Status  = gBS->LocateProtocol (&gEdkiiPlatformLogoProtocolGuid, NULL, (VOID **) &PlatformLogo);
MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf:49:  gEdkiiPlatformLogoProtocolGuid                ## CONSUMES
MdeModulePkg/Logo/Logo.c:148:                    &gEdkiiPlatformLogoProtocolGuid, &mPlatformLogo,
MdeModulePkg/Logo/LogoDxe.inf:49:  gEdkiiPlatformLogoProtocolGuid     ## PRODUCES
MdeModulePkg/MdeModulePkg.dec:570:  gEdkiiPlatformLogoProtocolGuid = { 0x53cd299f, 0x2bc1, 0x40c0, { 0x8c, 0x07, 0x23, 0xf6, 0x4f, 0xdb, 0x30, 0xe0 } }

[5] git grep BootLogoEnableLogo
ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c:682:  Status = BootLogoEnableLogo ();
ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c:814:  BootLogoEnableLogo ();
EmulatorPkg/Library/PlatformBmLib/PlatformBm.c:270:    BootLogoEnableLogo ();
MdeModulePkg/Include/Library/BootLogoLib.h:21:BootLogoEnableLogo (
MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:34:BootLogoEnableLogo (
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c:1504:  BootLogoEnableLogo ();

[6] git grep PlatformBootManagerLib -- *.inf | grep -v "=" | grep -v "#"
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf:53:  PlatformBootManagerLib

[7] git grep PlatformBootManagerLib | grep "LIBRARY_CLASS"
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf:19:  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER
ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf:18:  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER
EmulatorPkg/Library/PlatformBmLib/PlatformBmLib.inf:19:  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER
MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf:16:  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf:15:  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf:15:  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER

[8] git grep PlatformBootManagerLib -- *.dsc
ArmPkg/ArmPkg.dsc:141:  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
ArmVirtPkg/ArmVirtQemu.dsc:71:  PlatformBootManagerLib|ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
ArmVirtPkg/ArmVirtQemuKernel.dsc:69:  PlatformBootManagerLib|ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
ArmVirtPkg/ArmVirtXen.dsc:48:  PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
EmulatorPkg/EmulatorPkg.dsc:95:  PlatformBootManagerLib|EmulatorPkg/Library/PlatformBmLib/PlatformBmLib.inf
MdeModulePkg/MdeModulePkg.dsc:87:  PlatformBootManagerLib|MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
MdeModulePkg/MdeModulePkg.dsc:305:  MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
OvmfPkg/OvmfPkgIa32.dsc:362:  PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
OvmfPkg/OvmfPkgIa32X64.dsc:366:  PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
OvmfPkg/OvmfPkgX64.dsc:366:  PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
OvmfPkg/OvmfXen.dsc:306:  PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
SignedCapsulePkg/SignedCapsulePkg.dsc:84:  PlatformBootManagerLib|MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
UefiPayloadPkg/UefiPayloadPkgIa32.dsc:179:  PlatformBootManagerLib|UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc:180:  PlatformBootManagerLib|UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf



Thanks,

Andrew Fish

PS If we broke out BaseTools parser for edk2 build config files we could build a smart git grep. Something like:
$ edk2-git-grep -p OvmfPkg/OvmfPkgX64.dsc

Then you only see files that are used by your project. 

> -- 
> Jim Slaughter
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59168): https://edk2.groups.io/g/devel/message/59168
Mute This Topic: https://groups.io/mt/74108988/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200511/a05cffec/attachment.htm>


More information about the edk2-devel-archive mailing list