UEFI Programming Model
The UEFI Shell provides a programming API. You can use it to write your own UEFI applications for calling some of the Shell programmatic APIs or protocols. For more information, see the UEFI Shell Specification and EDK2. The UEFI Shell provides a programming API as listed in the following table. EFI_SHELL_PROTOCOL provides Shell services to UEFI applications. It provides UEFI Shell applications access to the low-level Shell functions, including files, pipes, environment variables, the current working directory, mappings, help text, aliases, and launching Shell applications and scripts.
Function Type |
Function Name |
Description |
---|---|---|
|
Execute |
Causes the Shell to parse and execute the command line. |
|
GetEnv |
Gets the environment variable. |
|
SetEnv |
Changes a specific environment variable. |
|
GetAlias |
Retrieves the alias for a specific Shell command. |
|
SetAlias |
Adds or removes the alias for a specific Shell command. |
|
GetHelpText |
Returns help information about a specific command. |
|
GetDevicePathFromMap |
Returns the device path that corresponds to a mapping. |
|
GetMapFromDevicePath |
Returns the mapping that corresponds to a particular device path. |
|
GetDevicePathFromFilePath |
Converts a file path to a device path, where all mappings have been replaced with the corresponding device paths. |
|
GetFilePathFromDevicePath |
Converts a device path to a file path, where the portion of the device path corresponding to one of the mappings is replaced with that mapping. |
|
SetMap |
Creates, updates, or deletes a mapping between a device and a device path. |
|
GetCurDir |
Returns the current directory on a device. |
|
SetCurDir |
Changes the current directory on a device. |
|
OpenFileList |
Opens the files that match the path pattern specified. |
|
FreeFileList |
Frees the file list created by OpenFileList(). |
|
RemoveDupInFileList |
Deletes the duplicate files in the given file list. |
|
BatchIsActive |
Displays whether any script files are being processed. |
|
IsRootShell |
Verifies whether the active Shell is the root Shell. |
|
EnablePageBreak |
Enables the page break output mode. |
|
DisablePageBreak |
Disables the page break output mode. |
|
GetPageBreak |
Gets the enable status of the page break output mode. |
|
GetDeviceName |
Gets the name of the device specified by the device handle. |
|
GetFileInfo |
Displays information about a specific file handle. |
|
SetFileInfo |
Changes information about a specific file handle. |
|
OpenFileByName |
Opens a file specified by name and returns a file handle. |
|
CloseFile |
Closes an open file. |
|
CreateFile |
Creates a file. |
|
ReadFile |
Reads data from a file. |
|
WriteFile |
Writes data to a file. |
|
DeleteFile |
Deletes a file. |
|
DeleteFileByName |
Deletes a file by name. |
|
GetFilePosition |
Displays the current read/write position within a file. |
|
SetFilePosition |
Changes the current read/write position within a file. |
|
FlushFile |
Writes all buffered data to a file. |
|
FindFiles |
Displays all files that match a pattern in a file list. |
|
FindFilesInDir |
Displays all files in a specified directory in a file list. |
|
GetFileSize |
Displays the size of a file. |
|
OpenRoot |
Displays the root directory of a file system. |
|
OpenRootByHandle |
Displays the root directory of a file system on a particular handle. |
|
ExecutionBreak |
An event signaled by the UEFI Shell when the user presses CTRL-C to indicate that the current UEFI Shell command execution should be interrupted. |
|
MajorVersion |
The major version of the Shell environment. |
|
MinorVersion |
The minor version of the Shell environment. |