- //\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