|
|
|
@ -308,7 +308,7 @@ BlLoadModules(IN PWCHAR ModulesList)
|
|
|
|
|
if(Status != STATUS_EFI_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
/* Failed to load module, print error message and set new return value */
|
|
|
|
|
BlDebugPrint(L"Failed to load module '%S', (Status Code: 0x%lx)\n", Module, Status);
|
|
|
|
|
BlDebugPrint(L"ERROR: Failed to load module '%S', (Status Code: 0x%lx)\n", Module, Status);
|
|
|
|
|
ReturnStatus = STATUS_EFI_LOAD_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -322,7 +322,7 @@ BlLoadModules(IN PWCHAR ModulesList)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This routine locates and opens the requested XT boot loader protocol.
|
|
|
|
|
* This routine locates and opens the requested XT Boot Loader or EFI protocol.
|
|
|
|
|
*
|
|
|
|
|
* @param ProtocolHandler
|
|
|
|
|
* Supplies the address where a pointer to the opened protocol is returned.
|
|
|
|
@ -336,8 +336,8 @@ BlLoadModules(IN PWCHAR ModulesList)
|
|
|
|
|
*/
|
|
|
|
|
XTCDECL
|
|
|
|
|
EFI_STATUS
|
|
|
|
|
BlOpenXtProtocol(OUT PVOID *ProtocolHandler,
|
|
|
|
|
IN PEFI_GUID ProtocolGuid)
|
|
|
|
|
BlOpenProtocol(OUT PVOID *ProtocolHandler,
|
|
|
|
|
IN PEFI_GUID ProtocolGuid)
|
|
|
|
|
{
|
|
|
|
|
PEFI_HANDLE Handles = NULL;
|
|
|
|
|
EFI_STATUS Status;
|
|
|
|
@ -472,45 +472,44 @@ EFI_STATUS
|
|
|
|
|
BlpRegisterXtLoaderProtocol()
|
|
|
|
|
{
|
|
|
|
|
EFI_GUID Guid = XT_BOOT_LOADER_PROTOCOL_GUID;
|
|
|
|
|
XTBL_LOADER_PROTOCOL LdrProtocol;
|
|
|
|
|
EFI_HANDLE Handle = NULL;
|
|
|
|
|
|
|
|
|
|
/* Set all routines available via loader protocol */
|
|
|
|
|
LdrProtocol.Boot.FindProtocol = BlFindBootProtocol;
|
|
|
|
|
LdrProtocol.Boot.InitializeMenuList = BlInitializeBootMenuList;
|
|
|
|
|
LdrProtocol.Boot.InvokeProtocol = BlInvokeBootProtocol;
|
|
|
|
|
LdrProtocol.Boot.RegisterMenu = BlRegisterBootMenu;
|
|
|
|
|
LdrProtocol.Boot.RegisterProtocol = BlRegisterBootProtocol;
|
|
|
|
|
LdrProtocol.Console.ClearLine = BlClearConsoleLine;
|
|
|
|
|
LdrProtocol.Console.ClearScreen = BlClearConsoleScreen;
|
|
|
|
|
LdrProtocol.Console.DisableCursor = BlDisableConsoleCursor;
|
|
|
|
|
LdrProtocol.Console.EnableCursor = BlEnableConsoleCursor;
|
|
|
|
|
LdrProtocol.Console.Print = BlConsolePrint;
|
|
|
|
|
LdrProtocol.Console.QueryMode = BlQueryConsoleMode;
|
|
|
|
|
LdrProtocol.Console.ReadKeyStroke = BlReadKeyStroke;
|
|
|
|
|
LdrProtocol.Console.ResetInputBuffer = BlResetConsoleInputBuffer;
|
|
|
|
|
LdrProtocol.Console.SetAttributes = BlSetConsoleAttributes;
|
|
|
|
|
LdrProtocol.Console.SetCursorPosition = BlSetCursorPosition;
|
|
|
|
|
LdrProtocol.Console.Write = BlConsoleWrite;
|
|
|
|
|
LdrProtocol.Debug.Print = BlDebugPrint;
|
|
|
|
|
LdrProtocol.Disk.CloseVolume = BlCloseVolume;
|
|
|
|
|
LdrProtocol.Disk.OpenVolume = BlOpenVolume;
|
|
|
|
|
LdrProtocol.Disk.ReadFile = BlReadFile;
|
|
|
|
|
LdrProtocol.Memory.AllocatePages = BlMemoryAllocatePages;
|
|
|
|
|
LdrProtocol.Memory.AllocatePool = BlMemoryAllocatePool;
|
|
|
|
|
LdrProtocol.Memory.FreePages = BlMemoryFreePages;
|
|
|
|
|
LdrProtocol.Memory.FreePool = BlMemoryFreePool;
|
|
|
|
|
LdrProtocol.Protocol.Open = BlOpenXtProtocol;
|
|
|
|
|
LdrProtocol.Tui.DisplayErrorDialog = BlDisplayErrorDialog;
|
|
|
|
|
LdrProtocol.Tui.DisplayInfoDialog = BlDisplayInfoDialog;
|
|
|
|
|
LdrProtocol.Tui.DisplayProgressDialog = BlDisplayProgressDialog;
|
|
|
|
|
LdrProtocol.Tui.UpdateProgressBar = BlUpdateProgressBar;
|
|
|
|
|
LdrProtocol.Util.ExitBootServices = BlExitBootServices;
|
|
|
|
|
LdrProtocol.Util.GetSecureBootStatus = BlGetSecureBootStatus;
|
|
|
|
|
LdrProtocol.Util.SleepExecution = BlSleepExecution;
|
|
|
|
|
LdrProtocol.Util.WaitForEfiEvent = BlWaitForEfiEvent;
|
|
|
|
|
BlpLdrProtocol.Boot.FindProtocol = BlFindBootProtocol;
|
|
|
|
|
BlpLdrProtocol.Boot.InitializeMenuList = BlInitializeBootMenuList;
|
|
|
|
|
BlpLdrProtocol.Boot.InvokeProtocol = BlInvokeBootProtocol;
|
|
|
|
|
BlpLdrProtocol.Boot.RegisterMenu = BlRegisterBootMenu;
|
|
|
|
|
BlpLdrProtocol.Boot.RegisterProtocol = BlRegisterBootProtocol;
|
|
|
|
|
BlpLdrProtocol.Console.ClearLine = BlClearConsoleLine;
|
|
|
|
|
BlpLdrProtocol.Console.ClearScreen = BlClearConsoleScreen;
|
|
|
|
|
BlpLdrProtocol.Console.DisableCursor = BlDisableConsoleCursor;
|
|
|
|
|
BlpLdrProtocol.Console.EnableCursor = BlEnableConsoleCursor;
|
|
|
|
|
BlpLdrProtocol.Console.Print = BlConsolePrint;
|
|
|
|
|
BlpLdrProtocol.Console.QueryMode = BlQueryConsoleMode;
|
|
|
|
|
BlpLdrProtocol.Console.ReadKeyStroke = BlReadKeyStroke;
|
|
|
|
|
BlpLdrProtocol.Console.ResetInputBuffer = BlResetConsoleInputBuffer;
|
|
|
|
|
BlpLdrProtocol.Console.SetAttributes = BlSetConsoleAttributes;
|
|
|
|
|
BlpLdrProtocol.Console.SetCursorPosition = BlSetCursorPosition;
|
|
|
|
|
BlpLdrProtocol.Console.Write = BlConsoleWrite;
|
|
|
|
|
BlpLdrProtocol.Debug.Print = BlDebugPrint;
|
|
|
|
|
BlpLdrProtocol.Disk.CloseVolume = BlCloseVolume;
|
|
|
|
|
BlpLdrProtocol.Disk.OpenVolume = BlOpenVolume;
|
|
|
|
|
BlpLdrProtocol.Disk.ReadFile = BlReadFile;
|
|
|
|
|
BlpLdrProtocol.Memory.AllocatePages = BlMemoryAllocatePages;
|
|
|
|
|
BlpLdrProtocol.Memory.AllocatePool = BlMemoryAllocatePool;
|
|
|
|
|
BlpLdrProtocol.Memory.FreePages = BlMemoryFreePages;
|
|
|
|
|
BlpLdrProtocol.Memory.FreePool = BlMemoryFreePool;
|
|
|
|
|
BlpLdrProtocol.Protocol.Open = BlOpenProtocol;
|
|
|
|
|
BlpLdrProtocol.Tui.DisplayErrorDialog = BlDisplayErrorDialog;
|
|
|
|
|
BlpLdrProtocol.Tui.DisplayInfoDialog = BlDisplayInfoDialog;
|
|
|
|
|
BlpLdrProtocol.Tui.DisplayProgressDialog = BlDisplayProgressDialog;
|
|
|
|
|
BlpLdrProtocol.Tui.UpdateProgressBar = BlUpdateProgressBar;
|
|
|
|
|
BlpLdrProtocol.Util.ExitBootServices = BlExitBootServices;
|
|
|
|
|
BlpLdrProtocol.Util.GetSecureBootStatus = BlGetSecureBootStatus;
|
|
|
|
|
BlpLdrProtocol.Util.SleepExecution = BlSleepExecution;
|
|
|
|
|
BlpLdrProtocol.Util.WaitForEfiEvent = BlWaitForEfiEvent;
|
|
|
|
|
|
|
|
|
|
/* Register XTLDR loader protocol */
|
|
|
|
|
BlDebugPrint(L"Registering XT loader protocol\n");
|
|
|
|
|
return EfiSystemTable->BootServices->InstallProtocolInterface(&Handle, &Guid, EFI_NATIVE_INTERFACE, &LdrProtocol);
|
|
|
|
|
return EfiSystemTable->BootServices->InstallProtocolInterface(&Handle, &Guid, EFI_NATIVE_INTERFACE, &BlpLdrProtocol);
|
|
|
|
|
}
|
|
|
|
|