4 using the uefi programming model – HP Unified Extensible Firmware Interface User Manual

Page 68

Advertising
background image

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

Description

Function Name

Function Type

Causes the shell to parse and execute the
command line.

Execute

EFI_SHELL_EXECUTE

Gets the environment variable.

GetEnv

EFI_SHELL_GET_ENV

Changes a specific environment variable.

SetEnv

EFI_SHELL_SET_ENV

Retrieves the alias for a specific shell
command.

GetAlias

EFI_SHELL_GET_ALIAS

Adds or removes the alias for a specific shell
command.

SetAlias

EFI_SHELL_SET_ALIAS

Return help information about a specific
command.

GetHelpText

EFI_SHELL_GET_HELP_TEXT

Returns the device path that corresponds to
a mapping.

GetDevicePathFromMap

EFI_SHELL_GET_DEVICE_PATH_FROM_MAP

Returns the mapping that corresponds to a
particular device path.

GetMapFromDevicePath

EFI_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.

GetDevicePathFromFilePath

EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH

Converts a device path to a file path, where
the portion of the device path corresponding

GetFilePathFromDevicePath

EFI_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.

SetMap

EFI_SHELL_SET_MAP

Returns the current directory on a device.

GetCurDir

EFI_SHELL_GET_CUR_DIR

Changes the current directory on a device.

SetCurDir

EFI_SHELL_SET_CUR_DIR

Opens the files that match the path pattern
specified.

OpenFileList

EFI_SHELL_OPEN_FILE_LIST

Frees the file list that created by OpenFileList().

FreeFileList

EFI_SHELL_FREE_FILE_LIST

Deletes the duplicate files in the given file list.

RemoveDupInFileList

EFI_SHELL_REMOVE_DUP_IN_FILE_LIST

Returns whether any script files are currently
being processed.

BatchIsActive

EFI_SHELL_BATCH_IS_ACTIVE

Judges whether the active Shell is the root
shell.

IsRootShell

EFI_SHELL_IS_ROOT_SHELL

Enables the page break output mode.

EnablePageBreak

EFI_SHELL_ENABLE_PAGE_BREAK

Disables the page break output mode.

DisablePageBreak

EFI_SHELL_DISABLE_PAGE_BREAK

68

Using the UEFI Programming Model

Advertising
This manual is related to the following products: