TianoCore EDK2 master
|
#include <Uefi.h>
#include <Guid/ShellVariableGuid.h>
#include <Guid/ShellAliasGuid.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleTextOut.h>
#include <Protocol/Shell.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
#include <Protocol/ShellParameters.h>
#include <Protocol/BlockIo.h>
#include <Protocol/HiiPackageList.h>
#include <Library/BaseLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/ShellCommandLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DevicePathLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PcdLib.h>
#include <Library/ShellLib.h>
#include <Library/SortLib.h>
#include <Library/HiiLib.h>
#include <Library/PrintLib.h>
#include <Library/HandleParsingLib.h>
#include <Library/FileHandleLib.h>
#include <Library/UefiHiiServicesLib.h>
#include "ShellParametersProtocol.h"
#include "ShellProtocol.h"
#include "ShellEnvVar.h"
#include "ConsoleLogger.h"
#include "ShellManParser.h"
#include "ConsoleWrappers.h"
#include "FileHandleWrappers.h"
Go to the source code of this file.
Data Structures | |
struct | SPLIT_LIST |
struct | SHELL_BITS |
union | SHELL_BIT_UNION |
struct | SHELL_INIT_SETTINGS |
struct | SHELL_VIEWING_SETTINGS |
struct | SHELL_INFO |
struct | SHELL_MAN_HII_VENDOR_DEVICE_PATH |
Variables | |
CONST CHAR16 | mNoNestingEnvVarName [] |
CONST CHAR16 | mNoNestingTrue [] |
CONST CHAR16 | mNoNestingFalse [] |
SHELL_INFO | ShellInfoObject |
function definitions for internal to shell functions.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Shell.h.
VOID * AddBufferToFreeList | ( | VOID * | Buffer | ) |
EFI_STATUS DoShellPrompt | ( | VOID | ) |
EFI_STATUS DoStartupScript | ( | IN EFI_DEVICE_PATH_PROTOCOL * | ImagePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ||
) |
Handles all interaction with the default startup script.
this will check that the correct command line parameters were passed, handle the delay, and then start running the script.
[in] | ImagePath | The path to the image for shell. The first place to look for the startup script. |
[in] | FilePath | The path to the file for shell. The second place to look for the startup script. |
EFI_SUCCESS | The variable is initialized. |
Handles all interaction with the default startup script.
this will check that the correct command line parameters were passed, handle the delay, and then start running the script.
ImagePath | the path to the image for shell. first place to look for the startup script |
FilePath | the path to the file for shell. second place to look for the startup script. |
EFI_SUCCESS | the variable is initialized. |
CONST CHAR16 * FindFirstCharacter | ( | IN CONST CHAR16 * | String, |
IN CONST CHAR16 * | CharacterList, | ||
IN CONST CHAR16 | EscapeCharacter | ||
) |
Return the pointer to the first occurrence of any character from a list of characters.
[in] | String | the string to parse |
[in] | CharacterList | the list of character to look for |
[in] | EscapeCharacter | An escape character to skip |
CHAR_NULL | no instance of any character in CharacterList was found in String |
EFI_STATUS GetDevicePathsForImageAndFile | ( | IN OUT EFI_DEVICE_PATH_PROTOCOL ** | DevPath, |
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | FilePath | ||
) |
This function will populate the 2 device path protocol parameters based on the global gImageHandle. the DevPath will point to the device path for the handle that has loaded image protocol installed on it. the FilePath will point to the device path for the file that was loaded.
[in,out] | DevPath | on a successful return the device path to the loaded image |
[in,out] | FilePath | on a successful return the device path to the file |
EFI_SUCCESS | the 2 device paths were successfully returned. |
This function will populate the 2 device path protocol parameters based on the global gImageHandle. The DevPath will point to the device path for the handle that has loaded image protocol installed on it. The FilePath will point to the device path for the file that was loaded.
[in,out] | DevPath | On a successful return the device path to the loaded image. |
[in,out] | FilePath | On a successful return the device path to the file. |
EFI_SUCCESS | The 2 device paths were successfully returned. |
other | A error from gBS->HandleProtocol. |
EFI_STATUS ProcessCommandLine | ( | VOID | ) |
Process all Uefi Shell 2.0 command line options.
see Uefi Shell 2.0 section 3.2 for full details.
the command line should resemble the following:
shell.efi [ShellOpt-options] [options] [file-name [file-name-options]]
ShellOpt options Options which control the initialization behavior of the shell. These options are read from the EFI global variable "ShellOpt" and are processed before options or file-name.
options Options which control the initialization behavior of the shell.
file-name The name of a UEFI shell application or script to be executed after initialization is complete. By default, if file-name is specified, then -nostartup is implied. Scripts are not supported by level 0.
file-nameoptions The command-line options that are passed to file-name when it is invoked.
This will initialize the ShellInitSettings global variable.
EFI_SUCCESS | the variable is initialized. |
Process all Uefi Shell 2.0 command line options.
see Uefi Shell 2.0 section 3.2 for full details.
the command line must resemble the following:
shell.efi [ShellOpt-options] [options] [file-name [file-name-options]]
ShellOpt-options Options which control the initialization behavior of the shell. These options are read from the EFI global variable "ShellOpt" and are processed before options or file-name.
options Options which control the initialization behavior of the shell.
file-name The name of a UEFI shell application or script to be executed after initialization is complete. By default, if file-name is specified, then -nostartup is implied. Scripts are not supported by level 0.
file-name-options The command-line options that are passed to file-name when it is invoked.
This will initialize the ShellInfoObject.ShellInitSettings global variable.
EFI_SUCCESS | The variable is initialized. |
EFI_STATUS ProcessCommandLineToFinal | ( | IN OUT CHAR16 ** | CmdLine | ) |
Converts the command line to its post-processed form. this replaces variables and alias' per UEFI Shell spec.
[in,out] | CmdLine | pointer to the command line to update |
EFI_SUCCESS | The operation was successful |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
VOID RestoreBufferList | ( | IN OUT LIST_ENTRY * | OldBufferList | ) |
EFI_STATUS RunCommand | ( | IN CONST CHAR16 * | CmdLine | ) |
Function will process and run a command line.
This will determine if the command line represents an internal shell command or dispatch an external application.
[in] | CmdLine | the command line to parse |
EFI_SUCCESS | the command was completed |
EFI_ABORTED | the command's operation was aborted |
Function will process and run a command line.
This will determine if the command line represents an internal shell command or dispatch an external application.
[in] | CmdLine | The command line to parse. |
EFI_SUCCESS | The command was completed. |
EFI_ABORTED | The command's operation was aborted. |
EFI_STATUS RunScriptFile | ( | IN CONST CHAR16 * | ScriptPath, |
IN SHELL_FILE_HANDLE Handle | OPTIONAL, | ||
IN CONST CHAR16 * | CmdLine, | ||
IN EFI_SHELL_PARAMETERS_PROTOCOL * | ParamProtocol | ||
) |
Function to process a NSH script file.
[in] | ScriptPath | Pointer to the script file name (including file system path). |
[in] | Handle | the handle of the script file already opened. |
[in] | CmdLine | the command line to run. |
[in] | ParamProtocol | the shell parameters protocol pointer |
EFI_SUCCESS | the script completed successfully |
EFI_STATUS RunScriptFileHandle | ( | IN SHELL_FILE_HANDLE | Handle, |
IN CONST CHAR16 * | Name | ||
) |
EFI_STATUS RunShellCommand | ( | IN CONST CHAR16 * | CmdLine, |
OUT EFI_STATUS * | CommandStatus | ||
) |
Function will process and run a command line.
This will determine if the command line represents an internal shell command or dispatch an external application.
[in] | CmdLine | The command line to parse. |
[out] | CommandStatus | The status from the command line. |
EFI_SUCCESS | The command was completed. |
EFI_ABORTED | The command's operation was aborted. |
VOID SaveBufferList | ( | OUT LIST_ENTRY * | OldBufferList | ) |
EFI_STATUS SetBuiltInAlias | ( | VOID | ) |
EFI_STATUS SetLastError | ( | IN CONST SHELL_STATUS | ErrorCode | ) |
EFI_STATUS TrimSpaces | ( | IN CHAR16 ** | String | ) |
|
extern |