Add support for boot protocols
This commit is contained in:
@@ -111,10 +111,12 @@ EFI_STATUS
|
||||
BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList)
|
||||
{
|
||||
XTBL_BOOT_PARAMETERS BootParameters;
|
||||
PWCHAR ModulesList;
|
||||
PXTBL_BOOT_PROTOCOL BootProtocol;
|
||||
PLIST_ENTRY OptionsListEntry;
|
||||
PXTBL_CONFIG_ENTRY Option;
|
||||
EFI_GUID BootProtocolGuid;
|
||||
SIZE_T ModuleListLength;
|
||||
PWCHAR ModulesList;
|
||||
EFI_STATUS Status;
|
||||
|
||||
/* Initialize boot parameters */
|
||||
@@ -151,8 +153,14 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList)
|
||||
}
|
||||
else if(RtlCompareWideStringInsensitive(Option->Name, L"SYSTEMPATH", 0) == 0)
|
||||
{
|
||||
/* System path found, get boot volume */
|
||||
|
||||
/* System path found, get volume device path */
|
||||
Status = BlGetVolumeDevicePath((PWCHAR)Option->Value, &BootParameters.DevicePath, &BootParameters.ArcName, &BootParameters.SystemPath);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
/* Failed to find volume */
|
||||
BlDebugPrint(L"ERROR: Failed to find volume device path (Status Code: 0x%lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
else if(RtlCompareWideStringInsensitive(Option->Name, L"KERNELFILE", 0) == 0)
|
||||
{
|
||||
@@ -188,11 +196,26 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList)
|
||||
return STATUS_EFI_NOT_READY;
|
||||
}
|
||||
|
||||
// TODO: Add support for boot protocol and invoke it
|
||||
return STATUS_EFI_UNSUPPORTED;
|
||||
/* Attempt to get boot protocol GUID */
|
||||
Status = BlFindBootProtocol(BootParameters.SystemType, &BootProtocolGuid);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
/* Failed to get boot protocol GUID */
|
||||
BlDebugPrint(L"ERROR: Unable to find appropriate boot protocol (Status Code: 0x%lx)\n", Status);
|
||||
return STATUS_EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
/* This point should never be reached */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
/* Open boot protocol */
|
||||
Status = BlOpenXtProtocol((PVOID *)&BootProtocol, &BootProtocolGuid);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
/* Failed to open boot protocol */
|
||||
BlDebugPrint(L"ERROR: Failed to open boot protocol (Status Code: 0x%lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* Boot Operating System */
|
||||
return BootProtocol->BootSystem(&BootParameters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user