diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-31 07:13:33 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-31 07:13:33 +0000 |
commit | ab8cc80b8ae9f0f4443aa06dd66de0fa8f49ec2c (patch) | |
tree | 69ade5b0f8b85ba761e42376ed0234f80b162344 /IntelFrameworkModulePkg | |
parent | 0495739faa2213714a3e413c4471af69960b1e76 (diff) | |
download | edk2-platforms-ab8cc80b8ae9f0f4443aa06dd66de0fa8f49ec2c.tar.xz |
Beatify the debug string for displaying boot device when boot EFI device path.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9209 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c index 7c47a87333..0eb59e89c8 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -253,8 +253,69 @@ BdsLibBootViaBootOption ( Status = SecurityProtocol->FileAuthenticationState (SecurityProtocol, 0, DevicePath);
}
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Booting %S\n", Option->Description));
+ DEBUG_CODE_BEGIN();
+ UINTN DevicePathTypeValue;
+ CHAR16 *HiiString;
+ CHAR16 *BootStringNumber;
+ UINTN BufferSize;
+
+ DevicePathTypeValue = BdsGetBootTypeFromDevicePath (Option->DevicePath);
+
+ //
+ // store number string of boot option temporary.
+ //
+ HiiString = NULL;
+ switch (DevicePathTypeValue) {
+ case BDS_EFI_ACPI_FLOPPY_BOOT:
+ HiiString = L"EFI Floppy";
+ break;
+ case BDS_EFI_MEDIA_CDROM_BOOT:
+ case BDS_EFI_MESSAGE_SATA_BOOT:
+ case BDS_EFI_MESSAGE_ATAPI_BOOT:
+ HiiString = L"EFI DVD/CDROM";
+ break;
+ case BDS_EFI_MESSAGE_USB_DEVICE_BOOT:
+ HiiString = L"EFI USB Device";
+ break;
+ case BDS_EFI_MESSAGE_SCSI_BOOT:
+ HiiString = L"EFI SCSI Device";
+ break;
+ case BDS_EFI_MESSAGE_MISC_BOOT:
+ HiiString = L"EFI Misc Device";
+ break;
+ case BDS_EFI_MESSAGE_MAC_BOOT:
+ HiiString = L"EFI Network";
+ break;
+ case BBS_DEVICE_PATH:
+ //
+ // Do nothing for legacy boot option.
+ //
+ break;
+ default:
+ DEBUG((EFI_D_INFO, "Can not find HiiString for given device path type 0x%x\n", DevicePathTypeValue));
+ }
+ //
+ // If found Hii description string then cat Hii string with original description.
+ //
+ if (HiiString != NULL) {
+ BootStringNumber = Option->Description;
+ BufferSize = StrSize(BootStringNumber);
+ BufferSize += StrSize(HiiString);
+ Option->Description = AllocateZeroPool(BufferSize);
+ StrCpy (Option->Description, HiiString);
+ if (StrnCmp (BootStringNumber, L"0", 1) != 0) {
+ StrCat (Option->Description, L" ");
+ StrCat (Option->Description, BootStringNumber);
+ }
+
+ FreePool (BootStringNumber);
+ }
+
+ DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Booting %S\n", Option->Description));
+
+ DEBUG_CODE_END();
+
Status = gBS->LoadImage (
TRUE,
mBdsImageHandle,
|