> On Aug 10, 2015, at 1:13 PM, David Van Arnem <[email protected]> wrote:
> 
> Hello,
> 
> I am new to EFI development and I am trying to implement measured boot and 
> attestation using EDK2.  Right now, I'm just trying to understand how to run 
> non-application modules using the EDK2 Emulator.
> 
> I've built and run the Emulator successfully (Fedora 22 64-bit), and I've 
> been able to run the HelloWorld.efi application successfully from the EDK2 
> shell.  However, if I try to load a module that is not an application (for 
> example, PeiCore.efi) using "load PeiCore.efi", I get the following output 
> from gdb:
> 
> 0x48ceb240 Loading 
> <path>/edk2/Build/Emulator/DEBUG_GCC49/X64/MdeModulePkg/Core/Pei/PeiMain/DEBUG/PeiCore.dll
>  with entry point 0x48ceb240
> Loading driver at 0x00048CEB000 EntryPoint=0x00048CEB240 PeiCore.efi
> InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 48E0CD18
> 
> Program received signal SIGSEGV, Segmentation fault.
> 
> Then, the gdb output shows a bunch of symbol tables being added, and finally 
> stops with:
> 
> 0x0000000048cee984 in PeiCoreBuildHobHandoffInfoTable (BootMode=0, 
> MemoryBegin=0, MemoryLength=205)
>    at <path>/edk2/MdeModulePkg/Core/Pei/Hob/Hob.c:150
> 150       Hob->Header.HobType      = EFI_HOB_TYPE_HANDOFF;
> (gdb)
> 
> At this point, I have to quit GDB and close the emulator session.  I get 
> similar errors with other non-application modules.  Am I doing this 
> correctly?  Can I load these images from the EFI shell prompt, or do they 
> need to be loaded in a different manner?  My end goal is to be able to use 
> TcgPei.efi, which I believe is a PEIM for doing measurement and event logging.
> 

You can’t load the PEI Core, or PEIMs at UEFI time. The PEI Core has a 
different entry point than an EFI application/driver. The entry point for a 
PEIM is also different and it depends on services provided by the PEI Core. The 
PEI Core shuts down at the end of PEI and the DXE Core takes over and provides 
the EFI services. 

The emulator creates a FD (Flash Device/ROM Image), and it runs the PEI Core 
and PEIMs. So you need to add or modify code that gets placed into the FD and 
debug it when it runs. 

Thanks,

Andrew Fish

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to