Initialize shell only once
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 52s
Builds / ExectOS (amd64, release) (push) Successful in 49s
Builds / ExectOS (i686, debug) (push) Successful in 43s
Builds / ExectOS (i686, release) (push) Successful in 42s

This commit is contained in:
2026-07-31 20:06:08 +02:00
parent f456cfd21e
commit b510e88745
3 changed files with 21 additions and 7 deletions

View File

@@ -261,6 +261,7 @@ class Shell
STATIC LIST_ENTRY ShellCommands;
public:
STATIC XTCDECL VOID InitializeShell();
STATIC XTCDECL EFI_STATUS RegisterCommand(IN PCWSTR Command,
IN PCWSTR Description,
IN PBL_SHELL_COMMAND Handler);

View File

@@ -307,6 +307,24 @@ Shell::ExecuteCommand(IN ULONG Argc,
Console::Print(L"ERROR: '%S' is not recognized as a valid command.\n", Argv[0]);
}
/**
* Initializes the bootloader shell.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
Shell::InitializeShell()
{
/* Initialize the shell commands list */
RTL::LinkedList::InitializeListHead(&ShellCommands);
/* Register all built-in commands */
RegisterBuiltinCommands();
}
/**
* Splits the supplied raw command line string into an argument count and an argument vector suitable
* for command dispatch. The input string is tokenized by whitespace.
@@ -881,12 +899,6 @@ Shell::StartLoaderShell()
/* Initialize console */
Console::InitializeConsole();
/* Initialize the shell commands list */
RTL::LinkedList::InitializeListHead(&ShellCommands);
/* Register all built-in commands */
RegisterBuiltinCommands();
/* Clear the shell exit request flag */
ExitRequest = FALSE;

View File

@@ -245,8 +245,9 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
for(;;);
}
/* Initialize XTLDR and */
/* Initialize XTLDR and shell */
XtLoader::InitializeBootLoader(ImageHandle, SystemTable);
Shell::InitializeShell();
/* Parse configuration options passed from UEFI shell */
Status = Configuration::ParseCommandLine();