\r
Boot option manipulation\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINT16 *TempStr;\r
UINTN OptionNumber;\r
VOID *Buffer;\r
- EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;\r
- UINT16 DeviceType;\r
- BBS_BBS_DEVICE_PATH BbsDevicePathNode;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
BOOLEAN RemovableMedia;\r
\r
-\r
NoSimpleFsHandles = 0;\r
NoLoadFileHandles = 0;\r
OptionNumber = 0;\r
FreePool (LoadFileHandle);\r
}\r
\r
- //\r
- // Add Legacy Boot Option Support Here\r
- //\r
- Status = gBS->LocateProtocol (\r
- &gEfiLegacyBiosProtocolGuid,\r
- NULL,\r
- (VOID **) &LegacyBios\r
- );\r
- if (!EFI_ERROR (Status)) {\r
-\r
- for (Index = BBS_TYPE_FLOPPY; Index <= BBS_TYPE_EMBEDDED_NETWORK; Index++) {\r
- MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);\r
- if (NULL == MenuEntry) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
-\r
- FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;\r
-\r
- FileContext->IsRemovableMedia = FALSE;\r
- FileContext->IsLoadFile = TRUE;\r
- FileContext->IsBootLegacy = TRUE;\r
- DeviceType = (UINT16) Index;\r
- BbsDevicePathNode.Header.Type = BBS_DEVICE_PATH;\r
- BbsDevicePathNode.Header.SubType = BBS_BBS_DP;\r
- SetDevicePathNodeLength (\r
- &BbsDevicePathNode.Header,\r
- sizeof (BBS_BBS_DEVICE_PATH)\r
- );\r
- BbsDevicePathNode.DeviceType = DeviceType;\r
- BbsDevicePathNode.StatusFlag = 0;\r
- BbsDevicePathNode.String[0] = 0;\r
- DevicePath = AppendDevicePathNode (\r
- EndDevicePath,\r
- (EFI_DEVICE_PATH_PROTOCOL *) &BbsDevicePathNode\r
- );\r
-\r
- FileContext->DevicePath = DevicePath;\r
- MenuEntry->HelpString = UiDevicePathToStr (FileContext->DevicePath);\r
-\r
- TempStr = MenuEntry->HelpString;\r
- MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);\r
- ASSERT (MenuEntry->DisplayString != NULL);\r
- UnicodeSPrint (\r
- MenuEntry->DisplayString,\r
- MAX_CHAR,\r
- L"Boot Legacy [%s]",\r
- TempStr\r
- );\r
- MenuEntry->OptionNumber = OptionNumber;\r
- OptionNumber++;\r
- InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link);\r
- }\r
- }\r
//\r
// Remember how many file system options are here\r
//\r