summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-07-05 07:55:45 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-07-05 07:55:45 +0000
commit889a4bc2a95a743d4e2ee5eed44875fa11702aae (patch)
tree259a86b7921d14eb77d39d1fefb4da20e6bad4a5 /IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
parent5d0066d87258e75055c0ab4a0950caba4851d2cd (diff)
downloadedk2-platforms-889a4bc2a95a743d4e2ee5eed44875fa11702aae.tar.xz
Fix the BDS to show UEFI hard drive boot option as "EFI Hard Drive" instead of "EFI DVD/CDROM"
Signed-off-by: niruiyu Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11974 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c')
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
index 774f092944..1ac2946360 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -1435,6 +1435,7 @@ BdsLibEnumerateAllBootOption (
{
EFI_STATUS Status;
UINT16 FloppyNumber;
+ UINT16 HarddriveNumber;
UINT16 CdromNumber;
UINT16 UsbNumber;
UINT16 MiscNumber;
@@ -1467,13 +1468,14 @@ BdsLibEnumerateAllBootOption (
EFI_IMAGE_OPTIONAL_HEADER_UNION HdrData;
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- FloppyNumber = 0;
- CdromNumber = 0;
- UsbNumber = 0;
- MiscNumber = 0;
- ScsiNumber = 0;
- PlatLang = NULL;
- LastLang = NULL;
+ FloppyNumber = 0;
+ HarddriveNumber = 0;
+ CdromNumber = 0;
+ UsbNumber = 0;
+ MiscNumber = 0;
+ ScsiNumber = 0;
+ PlatLang = NULL;
+ LastLang = NULL;
ZeroMem (Buffer, sizeof (Buffer));
//
@@ -1562,18 +1564,27 @@ BdsLibEnumerateAllBootOption (
break;
//
- // Assume a removable SATA device should be the DVD/CD device
+ // Assume a removable SATA device should be the DVD/CD device, a fixed SATA device should be the Hard Drive device.
//
case BDS_EFI_MESSAGE_ATAPI_BOOT:
case BDS_EFI_MESSAGE_SATA_BOOT:
- if (CdromNumber != 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), L"%s %d", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_CD_DVD)), CdromNumber);
+ if (BlkIo->Media->RemovableMedia) {
+ if (CdromNumber != 0) {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s %d", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_CD_DVD)), CdromNumber);
+ } else {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_CD_DVD)));
+ }
+ CdromNumber++;
} else {
- UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_CD_DVD)));
+ if (HarddriveNumber != 0) {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s %d", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_HARDDRIVE)), HarddriveNumber);
+ } else {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_HARDDRIVE)));
+ }
+ HarddriveNumber++;
}
DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Buffer: %S\n", Buffer));
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
- CdromNumber++;
break;
case BDS_EFI_MESSAGE_USB_DEVICE_BOOT: