diff --git a/bootdata/xtldr/xtldr.ini b/bootdata/xtldr/xtldr.ini index 4537da4..8bd454f 100644 --- a/bootdata/xtldr/xtldr.ini +++ b/bootdata/xtldr/xtldr.ini @@ -6,7 +6,6 @@ # Debug - enables the debugging port and consists of two comma-separated parameters: com port and baud rate; # it is also possible to specify custom port address with: COM0:[address],[baud_rate] # Default - specifies which operating system listen in config file will be started if no choice is made -# Theme - allows to set a custom theme to personalize XTLDR's look'n'feel # Timeout - sets the countdown timer (in seconds) before the default OS get started automatically # Tune - plays a tune on the pcspeaker right before the XTLDR loads # @@ -25,7 +24,6 @@ Tune=400 880 2 988 2 783 2 392 2 587 3 Debug=COM1,115200 Timeout=30 -Theme=Fancy Default=ExectOS [ExectOS] diff --git a/sdk/xtdk/bltypes.h b/sdk/xtdk/bltypes.h index c00a15f..60d52e5 100644 --- a/sdk/xtdk/bltypes.h +++ b/sdk/xtdk/bltypes.h @@ -13,6 +13,10 @@ #include +/* XTLDR directories */ +#define XTBL_LOADER_DIRECTORY L"\\EFI\\BOOT\\XTLDR\\" +#define XTBL_THEMES_DIRECTORY L"\\EFI\\BOOT\\XTLDR\\THEMES\\" + /* XTLDR Debug Port type definitions */ #define XTBL_DEBUGPORT_SCREEN 1 #define XTBL_DEBUGPORT_SERIAL 2 @@ -38,7 +42,6 @@ typedef struct _XTBL_CONFIGURATION PWCHAR Debug; ULONG DebugPort; BOOLEAN Shell; - PWCHAR Theme; ULONG Timeout; PWCHAR Tune; } XTBL_CONFIGURATION, *PXTBL_CONFIGURATION; diff --git a/xtldr2/config.c b/xtldr2/config.c index c0b5b13..22c8de4 100644 --- a/xtldr2/config.c +++ b/xtldr2/config.c @@ -18,7 +18,7 @@ */ XTCDECL VOID -BlpConfigParseCommandLine(VOID) +BlpParseCommandLineOptions(VOID) { EFI_GUID LIPGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID; PEFI_LOADED_IMAGE_PROTOCOL LoadedImage; @@ -32,7 +32,7 @@ BlpConfigParseCommandLine(VOID) if(LoadedImage && LoadedImage->LoadOptions) { /* Update global boot loader configuration */ - BlpConfigUpdateGlobalConfiguration(LoadedImage->LoadOptions); + BlpUpdateGlobalConfiguration(LoadedImage->LoadOptions); } } } @@ -49,7 +49,7 @@ BlpConfigParseCommandLine(VOID) */ XTCDECL VOID -BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options) +BlpUpdateGlobalConfiguration(IN PWCHAR Options) { PWCHAR Argument, LastArg; SIZE_T Length; @@ -92,21 +92,6 @@ BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options) /* Force shell mode */ BlpConfiguration.Shell = TRUE; } - else if(RtlWideStringCompare(Argument, L"THEME=", 6) == 0) - { - /* Skip to the argument value */ - Argument += 6; - Length = RtlWideStringLength(Argument, 0); - - /* Store theme configuration if not set already */ - if(BlpConfiguration.Theme == NULL) - { - /* Save theme in global configuration */ - BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Theme); - RtlCopyMemory(BlpConfiguration.Theme, Argument, (Length * sizeof(WCHAR)) - 1); - BlpConfiguration.Theme[Length] = '\0'; - } - } else if(RtlWideStringCompare(Argument, L"TIMEOUT=", 8) == 0) { /* Skip to the argument value */ diff --git a/xtldr2/includes/bootman.h b/xtldr2/includes/bootman.h index 961718f..e0ad29c 100644 --- a/xtldr2/includes/bootman.h +++ b/xtldr2/includes/bootman.h @@ -61,6 +61,11 @@ XTCDECL EFI_STATUS BlMemoryFreePool(IN PVOID Memory); +XTCDECL +EFI_STATUS +BlOpenXtProtocol(OUT PVOID *ProtocolHandler, + IN PEFI_GUID ProtocolGuid); + XTCDECL VOID BlSleepExecution(IN ULONG_PTR Milliseconds); @@ -76,11 +81,11 @@ BlpActivateSerialIOController(); XTCDECL VOID -BlpConfigParseCommandLine(VOID); +BlpParseCommandLineOptions(VOID); XTCDECL VOID -BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options); +BlpUpdateGlobalConfiguration(IN PWCHAR Options); XTCDECL VOID @@ -108,6 +113,10 @@ BlpInitializeSerialPort(IN ULONG PortNumber, IN ULONG PortAddress, IN ULONG BaudRate); +XTCDECL +EFI_STATUS +BlpRegisterXtLoaderProtocol(); + XTCDECL VOID BlpStringFormat(IN BMPRINTCHAR PrintCharRoutine, diff --git a/xtldr2/xtldr.c b/xtldr2/xtldr.c index 7a850d7..513cca2 100644 --- a/xtldr2/xtldr.c +++ b/xtldr2/xtldr.c @@ -29,12 +29,16 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle, { EFI_STATUS Status; + /* Set the system table and image handle */ + EfiImageHandle = ImageHandle; + EfiSystemTable = SystemTable; + /* Initialize XTLDR and early print XTLDR version */ BlpInitializeEfiBootLoader(); BlConsolePrint(L"XTLDR boot loader v%s\n", XTOS_VERSION); /* Parse configuration options passed from UEFI shell */ - BlpConfigParseCommandLine(); + BlpParseCommandLineOptions(); /* Attempt to early initialize debug console */ if(DEBUG) @@ -56,6 +60,14 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle, BlDebugPrint(L"WARNING: Failed to disable watchdog timer\n"); } + /* Register loader protocol */ + Status = BlpRegisterXtLoaderProtocol(); + if(Status != STATUS_EFI_SUCCESS) + { + /* Failed to register loader protocol */ + BlDebugPrint(L"ERROR: Failed to register XTLDR loader protocol\n"); + } + /* Temporary infinite loop */ for(;;);