Re: Loading EFI module from disk and handing over execution

Laszlo Ersek

On 07/02/21 12:50, Andy Pont wrote:
I am currently working on a project using tianocore as a payload for coreboot and have having some problems booting Qubes.

When trying to boot the Qubes ISO image from a USB memory stick it gives the error "Xen must be loaded below 4Gb". Looking at the Xen sources it is making two checks using the ImageBase and ImageSize values in the EFI_LOADED_IMAGE structure. The check that is failing that generates the error is that ((ImageBase + ImageSize) >> 32) isn't 0.

I'm struggling to find the right part of the tianocore sources to see where Xen's \EFI\BOOT\BOOTX64.EFI file is read from the USB stick to be able to see where, and how, ImageBase is setup.

Can anyone point me roughly in the right direction?
I expected the UefiPayloadPkg owners to comment on this.

The inner half of your call chain is probably EfiBootManagerBoot()
[MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c]. You'll see
gBS->LoadImage() and gBS->StartImage() calls there. Those are
implemented as CoreLoadImage() [MdeModulePkg/Core/Dxe/Image/Image.c] and
CoreStartImage() [MdeModulePkg/Core/Dxe/Image/Image.c], respectively.

The outer half of your call chain is likely somewhere in
or in "MdeModulePkg/Universal/BdsDxe/BdsEntry.c".


Join to automatically receive all group messages.