Another improvements to module loading support
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 29s
Builds / ExectOS (i686) (push) Successful in 27s

This commit is contained in:
Rafal Kupiec 2023-12-30 11:18:51 +01:00
parent aa03fc9cb2
commit effde90ece
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 20 additions and 15 deletions

View File

@ -19,6 +19,10 @@
#define XTBL_MODULES_DIRECTORY_PATH L"\\EFI\\BOOT\\XTLDR\\MODULES\\"
#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 */
#define XTBL_BOOT_DEVICE_UNKNOWN 0x00
#define XTBL_BOOT_DEVICE_CDROM 0x01

View File

@ -8,11 +8,10 @@
#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_MODDEPS = {L"dummy2"};
/**
* This routine is the entry point of the XT EFI boot loader module.

View File

@ -155,9 +155,11 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList)
if(Status != STATUS_EFI_SUCCESS)
{
/* Failed to load modules, print error message and return status code */
BlDebugPrint(L"Failed to load XTLDR modules\n");
return Status;
BlDebugPrint(L"ERROR: Failed to load XTLDR modules\n");
return STATUS_EFI_NOT_READY;
}
// TODO: Add support for boot protocol and invoke it
for(;;);
/* This point should never be reached */
@ -186,7 +188,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 = 0x%lx\n", Module, Status);
BlDebugPrint(L"Failed to load module '%S', (Status Code: 0x%lx)\n", Module, Status);
ReturnStatus = STATUS_EFI_LOAD_ERROR;
}
@ -211,6 +213,7 @@ BlLoadModule(IN PWCHAR ModuleName)
PPECOFF_IMAGE_SECTION_HEADER SectionHeader;
PPECOFF_IMAGE_DOS_HEADER DosHeader;
PPECOFF_IMAGE_PE_HEADER PeHeader;
PXTBL_MODULE_INFO ModuleInfo;
PLIST_ENTRY ModuleListEntry;
WCHAR ModuleFileName[1024];
USHORT SectionIndex;
@ -218,7 +221,6 @@ BlLoadModule(IN PWCHAR ModuleName)
EFI_STATUS Status;
PVOID ModuleData;
PWCHAR DepsData;
PXTBL_MODULE_INFO ModuleInfo;
ModuleListEntry = BlpLoadedModules.Flink;
while(ModuleListEntry != &BlpLoadedModules)