This is the UEFI counterpart to my Linux series which generalizes
mixed mode support into a feature that requires very little internal
knowledge about the architecture specifics of booting Linux on the
part of the bootloader or firmware.
Instead, we add a .compat PE/COFF header containing an array of
PE_COMPAT nodes containing <machine type, entrypoint> tuples that
describe alternate entrypoints into the image for different native
machine types, e.g., IA-32 in a 64-bit image so it can be booted
from IA-32 firmware.
This patch implements the PE/COFF emulator protocol to take this new
section into account, so that such images can simply be loaded via
LoadImage/StartImage, e.g., straight from the shell.
This feature is based on the EDK2 specific PE/COFF emulator protocol
that was introduced in commit 57df17fe26 ("MdeModulePkg/DxeCore:
invoke the emulator protocol for foreign images", 2019-04-14).
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2564
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
		
	
		
			
				
	
	
		
			38 lines
		
	
	
		
			881 B
		
	
	
	
		
			INI
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			881 B
		
	
	
	
		
			INI
		
	
	
	
	
	
| ## @file
 | |
| #  PE/COFF emulator protocol implementation to start Linux kernel
 | |
| #  images from non-native firmware
 | |
| #
 | |
| #  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
 | |
| #
 | |
| #  SPDX-License-Identifier: BSD-2-Clause-Patent
 | |
| #
 | |
| ##
 | |
| 
 | |
| [Defines]
 | |
|   INF_VERSION                    = 1.27
 | |
|   BASE_NAME                      = CompatImageLoaderDxe
 | |
|   FILE_GUID                      = 1019f54a-2560-41b2-87b0-6750b98f3eff
 | |
|   MODULE_TYPE                    = DXE_DRIVER
 | |
|   VERSION_STRING                 = 1.0
 | |
|   ENTRY_POINT                    = CompatImageLoaderDxeEntryPoint
 | |
| 
 | |
| [Sources]
 | |
|   CompatImageLoaderDxe.c
 | |
| 
 | |
| [Packages]
 | |
|   MdePkg/MdePkg.dec
 | |
|   MdeModulePkg/MdeModulePkg.dec
 | |
| 
 | |
| [LibraryClasses]
 | |
|   BaseMemoryLib
 | |
|   DebugLib
 | |
|   PeCoffLib
 | |
|   UefiBootServicesTableLib
 | |
|   UefiDriverEntryPoint
 | |
| 
 | |
| [Protocols]
 | |
|   gEdkiiPeCoffImageEmulatorProtocolGuid   ## PRODUCES
 | |
| 
 | |
| [Depex]
 | |
|   TRUE
 |