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
This commit is contained in:
klu2 2009-08-31 07:13:33 +00:00
parent 0495739faa
commit ab8cc80b8a
1 changed files with 62 additions and 1 deletions

View File

@ -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,