
4 Using the 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 Table 13
(page 68). 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.
Table 13 UEFI Application APIs
DescriptionFunction NameFunction Type
Causes the shell to parse and execute the
command line.
ExecuteEFI_SHELL_EXECUTE
Gets the environment variable.GetEnvEFI_SHELL_GET_ENV
Changes a specific environment variable.SetEnvEFI_SHELL_SET_ENV
Retrieves the alias for a specific shell
command.
GetAliasEFI_SHELL_GET_ALIAS
Adds or removes the alias for a specific shell
command.
SetAliasEFI_SHELL_SET_ALIAS
Return help information about a specific
command.
GetHelpTextEFI_SHELL_GET_HELP_TEXT
Returns the device path that corresponds to
a mapping.
GetDevicePathFromMapEFI_SHELL_GET_DEVICE_PATH_FROM_MAP
Returns the mapping that corresponds to a
particular device path.
GetMapFromDevicePathEFI_SHELL_GET_MAP_FROM_DEVICE_PATH
Converts a file path to a device path, where
all mappings have been replaced with the
corresponding device paths.
GetDevicePathFromFilePathEFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH
Converts a device path to a file path, where
the portion of the device path corresponding
GetFilePathFromDevicePathEFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH
to one of the mappings is replaced with that
mapping.
It creates/updates/deletes a mapping
between a device and a device path.
SetMapEFI_SHELL_SET_MAP
Returns the current directory on a device.GetCurDirEFI_SHELL_GET_CUR_DIR
Changes the current directory on a device.SetCurDirEFI_SHELL_SET_CUR_DIR
Opens the files that match the path pattern
specified.
OpenFileListEFI_SHELL_OPEN_FILE_LIST
Frees the file list that created by OpenFileList().FreeFileListEFI_SHELL_FREE_FILE_LIST
Deletes the duplicate files in the given file list.RemoveDupInFileListEFI_SHELL_REMOVE_DUP_IN_FILE_LIST
Returns whether any script files are currently
being processed.
BatchIsActiveEFI_SHELL_BATCH_IS_ACTIVE
Judges whether the active Shell is the root
shell.
IsRootShellEFI_SHELL_IS_ROOT_SHELL
Enables the page break output mode.EnablePageBreakEFI_SHELL_ENABLE_PAGE_BREAK
Disables the page break output mode.DisablePageBreakEFI_SHELL_DISABLE_PAGE_BREAK
68 Using the UEFI Programming Model
Comentários a estes Manuais