Another improvements to module loading support
This commit is contained in:
parent
aa03fc9cb2
commit
effde90ece
@ -19,6 +19,10 @@
|
|||||||
#define XTBL_MODULES_DIRECTORY_PATH L"\\EFI\\BOOT\\XTLDR\\MODULES\\"
|
#define XTBL_MODULES_DIRECTORY_PATH L"\\EFI\\BOOT\\XTLDR\\MODULES\\"
|
||||||
#define XTBL_THEMES_DIRECTORY_PATH L"\\EFI\\BOOT\\XTLDR\\THEMES\\"
|
#define XTBL_THEMES_DIRECTORY_PATH L"\\EFI\\BOOT\\XTLDR\\THEMES\\"
|
||||||
|
|
||||||
|
/* XTLDR module segment macros */
|
||||||
|
#define XTBL_MODDEPS SEGMENT(".moddeps") CONST WCHAR XtBlpDeps[][8]
|
||||||
|
#define XTBL_MODINFO SEGMENT(".modinfo") CONST WCHAR XtBlpInfo[]
|
||||||
|
|
||||||
/* EFI XT boot devices */
|
/* EFI XT boot devices */
|
||||||
#define XTBL_BOOT_DEVICE_UNKNOWN 0x00
|
#define XTBL_BOOT_DEVICE_UNKNOWN 0x00
|
||||||
#define XTBL_BOOT_DEVICE_CDROM 0x01
|
#define XTBL_BOOT_DEVICE_CDROM 0x01
|
||||||
|
@ -8,11 +8,10 @@
|
|||||||
|
|
||||||
#include <xtblapi.h>
|
#include <xtblapi.h>
|
||||||
|
|
||||||
#define XTBL_MODDEP SEGMENT(".moddeps") CONST WCHAR XtBlpDeps[][8]
|
|
||||||
#define XTBL_MODINFO SEGMENT(".modinfo") CONST WCHAR XtBlpInfo[]
|
|
||||||
|
|
||||||
XTBL_MODDEP = {L"dummy2", L"dummy2"};
|
/* Dummy module information */
|
||||||
XTBL_MODINFO = L"Dummy XTLDR module";
|
XTBL_MODINFO = L"Dummy XTLDR module";
|
||||||
|
XTBL_MODDEPS = {L"dummy2"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This routine is the entry point of the XT EFI boot loader module.
|
* This routine is the entry point of the XT EFI boot loader module.
|
||||||
|
@ -155,9 +155,11 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList)
|
|||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to load modules, print error message and return status code */
|
/* Failed to load modules, print error message and return status code */
|
||||||
BlDebugPrint(L"Failed to load XTLDR modules\n");
|
BlDebugPrint(L"ERROR: Failed to load XTLDR modules\n");
|
||||||
return Status;
|
return STATUS_EFI_NOT_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Add support for boot protocol and invoke it
|
||||||
for(;;);
|
for(;;);
|
||||||
|
|
||||||
/* This point should never be reached */
|
/* This point should never be reached */
|
||||||
@ -186,7 +188,7 @@ BlLoadModules(IN PWCHAR ModulesList)
|
|||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to load module, print error message and set new return value */
|
/* Failed to load module, print error message and set new return value */
|
||||||
BlDebugPrint(L"Failed to load module '%S', status = 0x%lx\n", Module, Status);
|
BlDebugPrint(L"Failed to load module '%S', (Status Code: 0x%lx)\n", Module, Status);
|
||||||
ReturnStatus = STATUS_EFI_LOAD_ERROR;
|
ReturnStatus = STATUS_EFI_LOAD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +213,7 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
PPECOFF_IMAGE_SECTION_HEADER SectionHeader;
|
PPECOFF_IMAGE_SECTION_HEADER SectionHeader;
|
||||||
PPECOFF_IMAGE_DOS_HEADER DosHeader;
|
PPECOFF_IMAGE_DOS_HEADER DosHeader;
|
||||||
PPECOFF_IMAGE_PE_HEADER PeHeader;
|
PPECOFF_IMAGE_PE_HEADER PeHeader;
|
||||||
|
PXTBL_MODULE_INFO ModuleInfo;
|
||||||
PLIST_ENTRY ModuleListEntry;
|
PLIST_ENTRY ModuleListEntry;
|
||||||
WCHAR ModuleFileName[1024];
|
WCHAR ModuleFileName[1024];
|
||||||
USHORT SectionIndex;
|
USHORT SectionIndex;
|
||||||
@ -218,7 +221,6 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
PVOID ModuleData;
|
PVOID ModuleData;
|
||||||
PWCHAR DepsData;
|
PWCHAR DepsData;
|
||||||
PXTBL_MODULE_INFO ModuleInfo;
|
|
||||||
|
|
||||||
ModuleListEntry = BlpLoadedModules.Flink;
|
ModuleListEntry = BlpLoadedModules.Flink;
|
||||||
while(ModuleListEntry != &BlpLoadedModules)
|
while(ModuleListEntry != &BlpLoadedModules)
|
||||||
|
Loading…
Reference in New Issue
Block a user