Move XTLDR initialization code out of EFI utils
This commit is contained in:
parent
fc3d236405
commit
167c09be0a
@ -118,58 +118,3 @@ BlWaitForEfiEvent(IN UINT_PTR NumberOfEvents,
|
|||||||
{
|
{
|
||||||
return EfiSystemTable->BootServices->WaitForEvent(NumberOfEvents, Event, Index);
|
return EfiSystemTable->BootServices->WaitForEvent(NumberOfEvents, Event, Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes EFI Boot Loader (XTLDR).
|
|
||||||
*
|
|
||||||
* @return This routine does not return any value.
|
|
||||||
*
|
|
||||||
* @since XT 1.0
|
|
||||||
*/
|
|
||||||
XTCDECL
|
|
||||||
VOID
|
|
||||||
BlpInitializeEfiBootLoader()
|
|
||||||
{
|
|
||||||
EFI_GUID LipGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
|
||||||
PEFI_LOADED_IMAGE_PROTOCOL LoadedImage;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
/* Set current XTLDR's EFI BootServices status */
|
|
||||||
BlpStatus.BootServices = TRUE;
|
|
||||||
|
|
||||||
/* Initialize console */
|
|
||||||
BlpInitializeConsole();
|
|
||||||
|
|
||||||
/* Print XTLDR version */
|
|
||||||
BlConsolePrint(L"XTLDR boot loader v%s\n", XTOS_VERSION);
|
|
||||||
|
|
||||||
/* Initialize XTLDR configuration linked lists */
|
|
||||||
RtlInitializeListHead(&BlpBootProtocols);
|
|
||||||
RtlInitializeListHead(&BlpConfig);
|
|
||||||
RtlInitializeListHead(&BlpLoadedModules);
|
|
||||||
|
|
||||||
/* Store SecureBoot status */
|
|
||||||
BlpStatus.SecureBoot = BlGetSecureBootStatus();
|
|
||||||
|
|
||||||
/* Check if debug is enabled */
|
|
||||||
if(DEBUG)
|
|
||||||
{
|
|
||||||
/* Attempt to open EFI LoadedImage protocol */
|
|
||||||
Status = BlOpenXtProtocol((PVOID *)&LoadedImage, &LipGuid);
|
|
||||||
if(Status == STATUS_EFI_SUCCESS)
|
|
||||||
{
|
|
||||||
/* Protocol opened successfully, print useful debug information */
|
|
||||||
BlConsolePrint(L"\n---------- BOOTLOADER DEBUG ----------\n"
|
|
||||||
L"Pointer Size : %d\n"
|
|
||||||
L"Image Base Address: 0x%lx\n"
|
|
||||||
L"Image Base Size : 0x%lx\n"
|
|
||||||
L"Image Revision : 0x%lx\n"
|
|
||||||
L"--------------------------------------\n",
|
|
||||||
sizeof(PVOID),
|
|
||||||
LoadedImage->ImageBase,
|
|
||||||
LoadedImage->ImageSize,
|
|
||||||
LoadedImage->Revision);
|
|
||||||
BlSleepExecution(3000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -104,6 +104,10 @@ BlGetVolumeDevicePath(IN PWCHAR SystemPath,
|
|||||||
OUT PWCHAR *ArcName,
|
OUT PWCHAR *ArcName,
|
||||||
OUT PWCHAR *Path);
|
OUT PWCHAR *Path);
|
||||||
|
|
||||||
|
XTCDECL
|
||||||
|
VOID
|
||||||
|
BlInitializeBootLoader();
|
||||||
|
|
||||||
XTCDECL
|
XTCDECL
|
||||||
VOID
|
VOID
|
||||||
BlInitializeBootMenuList(OUT PXTBL_BOOTMENU_ITEM MenuEntries,
|
BlInitializeBootMenuList(OUT PXTBL_BOOTMENU_ITEM MenuEntries,
|
||||||
@ -309,10 +313,6 @@ XTCDECL
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
BlpInitializeDebugConsole();
|
BlpInitializeDebugConsole();
|
||||||
|
|
||||||
XTCDECL
|
|
||||||
VOID
|
|
||||||
BlpInitializeEfiBootLoader();
|
|
||||||
|
|
||||||
XTCDECL
|
XTCDECL
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
BlpInitializeSerialPort(IN ULONG PortNumber,
|
BlpInitializeSerialPort(IN ULONG PortNumber,
|
||||||
|
@ -9,6 +9,61 @@
|
|||||||
#include <xtldr.h>
|
#include <xtldr.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes EFI Boot Loader (XTLDR).
|
||||||
|
*
|
||||||
|
* @return This routine does not return any value.
|
||||||
|
*
|
||||||
|
* @since XT 1.0
|
||||||
|
*/
|
||||||
|
XTCDECL
|
||||||
|
VOID
|
||||||
|
BlInitializeBootLoader()
|
||||||
|
{
|
||||||
|
EFI_GUID LipGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
||||||
|
PEFI_LOADED_IMAGE_PROTOCOL LoadedImage;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
/* Set current XTLDR's EFI BootServices status */
|
||||||
|
BlpStatus.BootServices = TRUE;
|
||||||
|
|
||||||
|
/* Initialize console */
|
||||||
|
BlpInitializeConsole();
|
||||||
|
|
||||||
|
/* Print XTLDR version */
|
||||||
|
BlConsolePrint(L"XTLDR boot loader v%s\n", XTOS_VERSION);
|
||||||
|
|
||||||
|
/* Initialize XTLDR configuration linked lists */
|
||||||
|
RtlInitializeListHead(&BlpBootProtocols);
|
||||||
|
RtlInitializeListHead(&BlpConfig);
|
||||||
|
RtlInitializeListHead(&BlpLoadedModules);
|
||||||
|
|
||||||
|
/* Store SecureBoot status */
|
||||||
|
BlpStatus.SecureBoot = BlGetSecureBootStatus();
|
||||||
|
|
||||||
|
/* Check if debug is enabled */
|
||||||
|
if(DEBUG)
|
||||||
|
{
|
||||||
|
/* Attempt to open EFI LoadedImage protocol */
|
||||||
|
Status = BlOpenXtProtocol((PVOID *)&LoadedImage, &LipGuid);
|
||||||
|
if(Status == STATUS_EFI_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Protocol opened successfully, print useful debug information */
|
||||||
|
BlConsolePrint(L"\n---------- BOOTLOADER DEBUG ----------\n"
|
||||||
|
L"Pointer Size : %d\n"
|
||||||
|
L"Image Base Address: 0x%lx\n"
|
||||||
|
L"Image Base Size : 0x%lx\n"
|
||||||
|
L"Image Revision : 0x%lx\n"
|
||||||
|
L"--------------------------------------\n",
|
||||||
|
sizeof(PVOID),
|
||||||
|
LoadedImage->ImageBase,
|
||||||
|
LoadedImage->ImageSize,
|
||||||
|
LoadedImage->Revision);
|
||||||
|
BlSleepExecution(3000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes a list of operating systems for XTLDR boot menu.
|
* Initializes a list of operating systems for XTLDR boot menu.
|
||||||
*
|
*
|
||||||
@ -243,7 +298,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
|||||||
EfiSystemTable = SystemTable;
|
EfiSystemTable = SystemTable;
|
||||||
|
|
||||||
/* Initialize XTLDR and */
|
/* Initialize XTLDR and */
|
||||||
BlpInitializeEfiBootLoader();
|
BlInitializeBootLoader();
|
||||||
|
|
||||||
/* Parse configuration options passed from UEFI shell */
|
/* Parse configuration options passed from UEFI shell */
|
||||||
Status = BlpParseCommandLine();
|
Status = BlpParseCommandLine();
|
||||||
|
Loading…
Reference in New Issue
Block a user