ArmPlatformPkg/Bds: Added support for booting legacy kernel from BDS

When PcdBdsLinuxSupport is enabled, users can create boot
entries for the legacy EFI Linux loader.

The ARM BDS detects if the image is a EFI image if not
then it assumes it is a legacy Linux kernel (a kernel
without EFI Stub).
If the Boot Manager did not manage to load the binary
(it could happen when the binary is on the network or
not present on the media yet).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17974 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Olivier Martin
2015-07-14 14:41:46 +00:00
committed by oliviermartin
parent a81ccae41a
commit 5d9e9d1a1c
6 changed files with 274 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
/** @file
*
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
* Copyright (c) 2011-2015, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -79,6 +79,12 @@ typedef struct _BDS_LOAD_OPTION_SUPPORT {
#define LOAD_OPTION_ENTRY_FROM_LINK(a) BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link)
#define LOAD_OPTION_FROM_LINK(a) ((BDS_LOAD_OPTION_ENTRY*)BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link))->BdsLoadOption
// GUID of the EFI Linux Loader
extern CONST EFI_GUID mLinuxLoaderAppGuid;
// Device path of the EFI Linux Loader in the Firmware Volume
extern EFI_DEVICE_PATH* mLinuxLoaderDevicePath;
EFI_STATUS
BootDeviceListSupportedInit (
IN OUT LIST_ENTRY *SupportedDeviceList
@@ -141,11 +147,6 @@ GetHIInputBoolean (
OUT BOOLEAN *Value
);
BOOLEAN
HasFilePathEfiExtension (
IN CHAR16* FilePath
);
EFI_DEVICE_PATH*
GetLastDevicePathNode (
IN EFI_DEVICE_PATH* DevicePath
@@ -260,4 +261,17 @@ EmptyCallbackFunction (
IN VOID *Context
);
/**
* This function check if the DevicePath defines an EFI binary
*
* This function is used when the BDS support Linux loader to
* detect if the binary is an EFI application or potentially a
* Linux kernel.
*/
EFI_STATUS
IsEfiBinary (
IN EFI_DEVICE_PATH* DevicePath,
OUT BOOLEAN *EfiBinary
);
#endif /* _BDSINTERNAL_H_ */