forked from xt-sys/exectos
Initialize shell only once
This commit is contained in:
@@ -261,6 +261,7 @@ class Shell
|
|||||||
STATIC LIST_ENTRY ShellCommands;
|
STATIC LIST_ENTRY ShellCommands;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
STATIC XTCDECL VOID InitializeShell();
|
||||||
STATIC XTCDECL EFI_STATUS RegisterCommand(IN PCWSTR Command,
|
STATIC XTCDECL EFI_STATUS RegisterCommand(IN PCWSTR Command,
|
||||||
IN PCWSTR Description,
|
IN PCWSTR Description,
|
||||||
IN PBL_SHELL_COMMAND Handler);
|
IN PBL_SHELL_COMMAND Handler);
|
||||||
|
|||||||
@@ -307,6 +307,24 @@ Shell::ExecuteCommand(IN ULONG Argc,
|
|||||||
Console::Print(L"ERROR: '%S' is not recognized as a valid command.\n", Argv[0]);
|
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
|
* 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.
|
* for command dispatch. The input string is tokenized by whitespace.
|
||||||
@@ -881,12 +899,6 @@ Shell::StartLoaderShell()
|
|||||||
/* Initialize console */
|
/* Initialize console */
|
||||||
Console::InitializeConsole();
|
Console::InitializeConsole();
|
||||||
|
|
||||||
/* Initialize the shell commands list */
|
|
||||||
RTL::LinkedList::InitializeListHead(&ShellCommands);
|
|
||||||
|
|
||||||
/* Register all built-in commands */
|
|
||||||
RegisterBuiltinCommands();
|
|
||||||
|
|
||||||
/* Clear the shell exit request flag */
|
/* Clear the shell exit request flag */
|
||||||
ExitRequest = FALSE;
|
ExitRequest = FALSE;
|
||||||
|
|
||||||
|
|||||||
@@ -245,8 +245,9 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
|||||||
for(;;);
|
for(;;);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize XTLDR and */
|
/* Initialize XTLDR and shell */
|
||||||
XtLoader::InitializeBootLoader(ImageHandle, SystemTable);
|
XtLoader::InitializeBootLoader(ImageHandle, SystemTable);
|
||||||
|
Shell::InitializeShell();
|
||||||
|
|
||||||
/* Parse configuration options passed from UEFI shell */
|
/* Parse configuration options passed from UEFI shell */
|
||||||
Status = Configuration::ParseCommandLine();
|
Status = Configuration::ParseCommandLine();
|
||||||
|
|||||||
Reference in New Issue
Block a user