UEFI Shell Specification September 25, 2008 Revision 2.0
90 Version 2.0 fs0:\> comp bios.inf bios2.inf Compare fs0:\bios.inf to fs0:\bios2.inf Difference #1: File1: fs0:\bios.inf
Version 2.0 91 connect Summary Binds a driver to a specific device and starts the driver. Usage connect [[DeviceHandle] [DriverHandle] | [-c] | [
92 Version 2.0 Status Codes Returned SHELL_SUCCESS The action was completed as requested. SHELL_SECURITY_VIOLATION This function was not per
Version 2.0 93 cp Summary Copies one or more source files or directories to a destination. Usage cp [-r] [-q] src [src...] [dst] Options src Sour
94 Version 2.0 When copying to another directory, the directory must already exist. Status Codes Returned SHELL_SUCCESS The action was comple
Version 2.0 95 fs0:\> cp -r test1 test2 boot \test copying fs0:\test1 -> fs0:\test\test1 copying fs0:\test1\test1.txt -> fs0
96 Version 2.0 date Summary Displays and sets the current date for the system. Usage date [mm/dd/[yy]yy][-sfo] Options mm Month of the date t
Version 2.0 97 Shell > date 8/4/97 Shell > date 08/04/2097 Shell > Shell > date 8/4/98 Shell > date 08/04/1998 Shell > The ra
98 Version 2.0 dblk Summary Displays the contents of one or more blocks from a block device. Usage dblk device [lba] [blocks] [-b] Options dev
Version 2.0 99 Shell>dblk fs0 12 20 • To display one block of blk2, beginning from the first block (blk0):
1 Version 2.0 1 Introduction 1.1 Overview The UEFI Shell environment provides an API, a command prompt and a rich set of commands that extend and
100 Version 2.0 fs1:\tmps1> dblk blk2 0 1 LBA 0000000000000000 Size 00000200 bytes BlkIo 3F0CEE78 00000000: EB 3C 90 4D 53 44 4F 53
Version 2.0 101 Fat 16 BPB FatLabel: 'NO NAME ' SystemId: 'FAT16 ' OemId: 'MSDOS5.0' SectorSize 200 Secto
102 Version 2.0 del Summary Internal alias for the rm command.
Version 2.0 103 devices Summary Displays the list of devices managed by UEFI drivers. Usage devices [-b] [-l XXX] Options -b - Displa
104 Version 2.0 3 The device type: R – Root Controller B – Bus Controller D – Device Controller 4 A managing driver supports the Driver Confi
Version 2.0 105 devtree Summary Displays the tree of devices compliant with the UEFI Driver Model. Usage devtree [-b] [-d] [-l XXX] [DeviceHandl
106 Version 2.0 dh Summary Displays the device handles in the UEFI environment. Usage dh [-l <lang>] [handle | -p <prot_id>] [-d]
Version 2.0 107 Examples To display all handles and display one screen at a time: Shell> dh -b Handle dump 1: Image(DXE Core)
108 Version 2.0 Shell> dh -p Image -b Handle dump by protocol 'image' 1: Image(DXE Core) 5: Image(WinNtThunk)
Version 2.0 109 dir Summary An internal alias for the ls command.
2 Version 2.0 UEFI Application An application following the UEFI specification. The only difference between a UEFI application and a UEFI driv
110 Version 2.0 disconnect Summary Disconnects one or more drivers from the specified devices. Usage disconnect DeviceHandle [DriverHandle [Ch
Version 2.0 111 fs0:\> disconnect 28 17 • To disconnect driver 0x17 from controlling the child 0x32 of device 0x28 fs0:\> disconn
112 Version 2.0 dmem Summary Displays the contents of system or device memory. Usage dmem [-b] [address] [size] [-MMIO] Options address Start
Version 2.0 113 Examples * To display the EFI system table pointer entries: fs0:\> dmem Memory Address 000000003FF7D808 200 Bytes 3FF7
114 Version 2.0 3FF7D9E8: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *...* 3FF7D9F8: 00 00 00 00 00 00 00 00-70 68 06 3
Version 2.0 115 dmpstore Summary Manages all UEFI NVRAM variables. Usage dmpstore [-b] [-d] [-all | ([variable] [–guid guid])] dmpstore [-all | (
116 Version 2.0 --- X --- All variables with the specified GUID will be operated on. X --- --- The variable with the GUID EFI_GLOBAL_VAR
Version 2.0 117 drivers Summary Displays a list of information for drivers that follow the UEFI Driver Model in the UEFI environment. Usage drive
118 Version 2.0 Examples • To display the list: Shell> drivers T D D Y C I R P F A V VERSION E G G
Version 2.0 119 7 Devices Managed. The number of devices that this driver is managing. 8 Child Devices. The number of child devices that this d
3 Version 2.0 2 Code Definitions 2.1 Introduction 2.2 EFI_SHELL_PROTOCOL EFI_SHELL_PROTOCOL Summary Provides shell services to UEFI applications.
120 Version 2.0 drvcfg Summary Configures the driver using the platform’s underlying configuration infrastructure. Usage drvcfg [-l XXX] [-c]
Version 2.0 121 -o Export the settings of the specified driver instance to a file Description This command invokes the platform’s Configuration
122 Version 2.0 Shell> drvcfg –f 0 17 To force defaults on device 0x28 that is managed by driver 0x17: Shell> drvcfg –f 0 17 28
Version 2.0 123 To force defaults on child device 0x30 of device 0x28 that is managed by driver 0x17: Shell> drvcfg –f 0 17 28 30 To val
124 Version 2.0 drvdiag Summary Invokes the Driver Diagnostics Protocol. Usage drvdiag [-c] [-l XXX] [-s|-e|-m] [DriverHandle [DeviceHandle [C
Version 2.0 125 Examples To display the list of devices that are available for diagnostics: Shell> drvdiag To display the list of devices
126 Version 2.0 echo Summary Controls whether or not script commands are displayed as they are read from the script file and prints the given
Version 2.0 127 fs0:\> HelloWorld.nsh +HelloWorld.nsh> echo Hello World Hello World • To turn command echoing off: fs0:\&
128 Version 2.0 edit Summary Full screen editor for ASCII or UCS-2 files. Usage edit [file] Options file Name of file to be edited. If non
Version 2.0 129 eficompress Summary Compress a file using EFI Compression Algorithm. Usage eficompress infile outfile Options infile - Fil
4 Version 2.0 GUID #define EFI_SHELL_PROTOCOL_GUID \ { 0x6302d008, 0x7f9b, 0x4f30, \ { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } }
130 Version 2.0 efidecompress Summary Decompress a file using EFI Decompression Algorithm. Usage efidecompress infile outfile Options infile
Version 2.0 131 exit Summary Exits the UEFI Shell or the current script. Usage exit [/b] [exit-code] Options /b Indicates that only the current U
132 Version 2.0 for Usage for %indexvar in set command [arguments] [command [arguments]] … endfor for %indexvar run (start end [step])
Version 2.0 133 Examples # # Sample for loop – listing all .txt files # echo -off for %a in *.txt echo %a exists endfor If in current dir
134 Version 2.0 getmtc Usage getmtc Description This command displays the current monotonic counter value. The lower 32 bits increment every t
Version 2.0 135 goto Usage goto label Description The goto command directs script file execution to the line in the script file after the given l
136 Version 2.0 guid Summary Displays all registered EFI GUIDs. Usage guid [-b] Options -b Display one screen at a time Description This comm
Version 2.0 137 help Summary Displays the list of commands that are built into the UEFI Shell. Usage help [cmd | pattern | special] [-usage] [-ve
138 Version 2.0 Examples To display the list of commands in the UEFI Shell and break after one screen: Shell> help –b ?
Version 2.0 139 hexedit Summary Full screen hex editor for files, block devices, or memory. Usage hexedit [[-f] filename| [-d diskname offset siz
Version 2.0 5 Causes the shell to parse and execute the command line. See the Execute() function description below. GetEnv Gets the environment v
140 Version 2.0 if Controls which script commands will be executed based on provided conditional expressions. Usage if [not] exist filename th
Version 2.0 141 In the second usage, the string1 == string2 condition is true if the two strings are identical. Here the comparison can be case
142 Version 2.0 appear at the start of the line (just after the if itself). The two may appear in either order. When performing comparisons,
Version 2.0 143 Table 21 Boolean Functions Function Definition IsInt Evaluates to true if the parameter string that follows is a number (as defi
144 Version 2.0 Examples # # Example script for “if” command usages 1 and 2 # if exist fs0:\myscript.nsh then myscript myarg1 myarg2 endif
Version 2.0 145 ifconfig Summary Modify the default IP address of the UEFI IP4 Network Stack. Usage ifConfig [-?] [-c [Name]] [-l [Name]] [-s <
146 Version 2.0 Examples To list the configuration for the interface eth0: Shell:\> IfConfig -l eth0 To use DHCP4 to request the IP4 ad
Version 2.0 147 ipconfig Summary Displays or modifies the current IP configuration. Usage ipconfig [-r]|[-b] [-c Instance] [IpAddress [-m NetMask
148 Version 2.0 load Summary Loads a UEFI driver into memory. Usage load [-nc] file [file...] Options -nc Load the driver, but do not connect
Version 2.0 149 Examples fs0:\> load Isabus.efi load: Image 'fs0:\Isabus.efi' loaded at 18FE000 - Success fs0:\&g
6 Version 2.0 IsRootShell Judges whether the active Shell is the root shell. See the IsRootShell() function description below. EnablePageBreak
150 Version 2.0 loadpcirom Summary Loads a UEFI driver from a file in the format of a PCI Option ROM. Usage loadpcirom [-nc] romfile [romfile.
Version 2.0 151 ls Summary Lists a directory's contents or file information. Usage ls [-r] [-a[attrib]][-sfo][file] Options -r Displays rec
152 Version 2.0 specified, only the files that have all those attributes will be listed. If -a is followed by nothing, then all files/director
Version 2.0 153 fs0:\> ls -ar Directory of: fs0:\ 06/18/01 11:14p r 29 readme.txt 1 File(s
154 Version 2.0 5 Attributes. List of file attributes. The string can contain zero or more of the following (but no repeats): a – Archive d –
Version 2.0 155 map Summary Defines a mapping between a user-defined name and a device handle. Usage map [-d <sname>] map [[-r][-v][-c][-f]
156 Version 2.0 Description This command creates a mapping between a user-defined name and a device. The most common use of this c
Version 2.0 157 Table 24 Standard Formatted Output (Mappings) Column Number Description 2 Mapped Name. The mapped device name. 3 Device Path. T
158 Version 2.0 md Summary An internal alias for the mkdir command. '
Version 2.0 159 mem Summary This is a built-in alias for dmem.
Version 2.0 7 GetFilePosition Return the current read/write position within a file. See the GetFilePosition() function description. FlushFile Wri
160 Version 2.0 memmap Summary Displays the memory map maintained by the EFI environment. Usage memmap [-b] Options -b Display one screen at
Version 2.0 161 fs0:\> memmap Type Start End # Pages Attributes available 0000000000750000-0000000001841FFF 00000
162 Version 2.0 5 Number Of 4KB Pages 6 Attributes Table 26 Standard-Format Output for memmap (Summary) Column Number Description 2 Total M
Version 2.0 163 mkdir Summary Creates one or more new directories. Usage mkdir dir [dir...] Options dir Name of directory or directories to be
164 Version 2.0 fs0:\> mkdir temp1 temp2 fs0:\> ls Directory of: fs0:\ 06/18/01 08:05p <DIR>
Version 2.0 165 mm Summary Displays or modifies MEM/MMIO/IO/PCI/PCIE address space. Usage mm address [value] [-w 1|2|4|8] [-MEM | -MMIO | -IO | -
166 Version 2.0 If Value is specified which should be typed in hex value, this command will write this value to specified address. Otherwise w
Version 2.0 167 Shell> mm 0000000000 -PCI PCI 0x0000000000000000 : 0x86 > PCI 0x0000000000000001 : 0x80 > PCI 0x00000
168 Version 2.0 mode Summary Displays or changes the console output device mode. Usage mode [col row] Options row Number of rows col Number o
Version 2.0 169 Shell> mode 80 50 Available modes on standard output col 80 row 25 col 80 row 50 * col 80 row
8 Version 2.0 EFI_SHELL_PROTOCOL.BatchIsActive() Summary Returns whether any script files are currently being processed. Prototype typedef BOO
170 Version 2.0 mv Summary Moves one or more files to a destination within a file system. Usage mv src [src...] [dst] Options src Source file
Version 2.0 171 Examples To rename a file: fs0:\> mv IsaBus.efi Bus.efi moving fs0:\IsaBus.efi -> \Bus.efi - [ok]
172 Version 2.0 openinfo Summary Displays the protocols and agents associated with a handle. Usage openinfo Handle [-b] Options Handle Displa
Version 2.0 173 parse Summary Command used to retrieve a value from a particular record which was output in a standard formatted output. Usage pa
174 Version 2.0 fs0:\> parse temp.txt VolumeInfo 2 MikesVolume Below is an example using the Index parameter: fs0:\> parse
Version 2.0 175 pause Usage pause [-q] Description The pause command prints a message to the display and then suspends script file execution and
176 Version 2.0 pci Summary Displays PCI device list or PCI function configuration space. Usage pci [Bus Dev [Func] [-s Seg] [-i]] Options Bu
Version 2.0 177 Shell> PCI Seg Bus Dev Func --- --- --- ---- 00 00 00 00 ==> Bridge Device - Host/PCI bridge
178 Version 2.0 Shell> PCI 00 00 00 -i PCI Segment 00 Bus 00 Device 00 Func 00 00000000: 86 80 30 11 06 00 90 20-02 00 00 06 00 00 00
Version 2.0 179 Start Type Space Prefetchable? Size Limit -------------------------------------------------------------
Version 2.0 9 EFI_SHELL_PROTOCOL.CloseFile() Summary Closes the file handle. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_CLOSE_FILE)( IN EF
180 Version 2.0 ping Summary Ping the target host with IPv4 stack. Usage Ping [-n count] [-l size] TargetIp Options -n Number of echo request
Version 2.0 181 reconnect Summary Reconnects drivers to the specific device. Usage reconnect DeviceHandle [DriverHandle [ChildHandle]] reconnect
182 Version 2.0 Shell> reconnect -r To reconnect all drivers to device 0x28: fs0:\> reconnect 28 To disconnect 0x17 from 0x28
Version 2.0 183 reset Summary Resets the system. Usage reset [-w [string]] reset [-s [string]] reset [-c [string]] Options -s - Performs
184 Version 2.0 rm Summary Deletes one or more files or directories. Usage rm [-q] file/directory [file/directory ...] Options -q Quiet mode;
Version 2.0 185 fs0:\> ls test Directory of: fs0:\test 06/18/01 01:01p <DIR> 512 . 06/18/01 01:01
186 Version 2.0 sermode Summary Sets serial port attributes. Usage sermode [handle [baudrate parity databits stopbits]] Options handle Device
Version 2.0 187 Description This command displays or sets baud rate, parity attribute, data bits and stop bits of serial ports. If no attributes
188 Version 2.0 set Summary Displays, changes or deletes a UEFI Shell environment variables. Usage set [-v] [sname [value]] set [-d <sname&
Version 2.0 189 SHELL_OUT_OF_RESOURCES A request to set a variable in a non-volatile fashion could not be completed. The resulting non-volatile
ii Version 2.0 The material contained herein is not a license, either expressly or impliedly, to any intellectual property owned
10 Version 2.0 EFI_SHELL_PROTOCOL.CreateFile() Summary Creates a file or directory by name. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_CR
190 Version 2.0 setsize Summary Adjusts the size of a file. Usage setsize size file [file...] Options file The file or files which will have
Version 2.0 191 setvar Summary Changes the value of a UEFI variable. Usage setvar variable-name [–guid guid][-bs][-rs][-nv] [=data] Options varia
192 Version 2.0 Description This command changes the UEFI variable specified by name and guid. If = is specified, but data is not, the variabl
Version 2.0 193 shift Usage shift Description The shift command shifts the contents of a UEFI Shell script’s positional parameters so that %1 is
194 Version 2.0 smbiosview Summary Displays SMBIOS information. Usage smbiosview [-t SmbiosType]|[-h SmbiosHandle]|[-s]|[-a] Options -t Disp
Version 2.0 195
196 Version 2.0 stall Summary Stalls the operation for a specified number of microseconds. Usage stall time Options time The number of micros
Version 2.0 197 time Summary Displays or sets the current time for the system. Usage time [hh:mm[:ss]] [-tz tz] [-d dl] Options hh New hour (0-2
198 Version 2.0 Shell > time 00000017:000004:0000 Shell > time 17:04:00 (GMT+08:00) Shell > The seconds parameter is optional. If the
Version 2.0 199 timezone Summary Displays or sets time zone information. Usage timezone [-s hh:mm | -l] [-b] [-f] Options -s Set time zone assoc
Version 2.0 11 EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no longer supported. EFI_DEVICE_ERROR The device rep
200 Version 2.0 Shell> timezone -l GMT-12:00, International Date Line West GMT-11:00, Midway Island, Samoa GMT-10:00, Hawai
Version 2.0 201 touch Summary Updates the time and date on a file to the current time and date. Usage touch [-r] file [file …] Options file The
202 Version 2.0 type Summary Sends the contents of a file to the standard output device. Usage type [-a|-u] file [file...] Options file Name
Version 2.0 203 fs0:\> type -u pause.nsh # # Example script for 'pause' command # echo pause.nsh begin.. date time pause echo pause.
204 Version 2.0 unload Summary Unloads a driver image that was already loaded. Usage unload [-n] [-v|-verbose] Handle Options -n Skips al
Version 2.0 205 ver Summary Displays the version information for the UEFI Shell and the underlying UEFI firmware. Usage ver [-s|-terse] Options -
206 Version 2.0 <firmware vendor version> From the EFI System Table's FIrmwareRevision field Status Codes Returned SHELL_SUCCESS
Version 2.0 207 vol Summary Displays the volume information for the file system that is specified by fs. Usage vol [fs] [-n <VolumeLabel>]
208 Version 2.0 shell> vol fs0 –n help_test Volume HELP_TEST (rw) 1,457,664 bytes total disk space 1,149,440 bytes available on disk 512 by
Version 2.0 209 Appendix A UEFI Shell Consistent Mapping Design This appendix describes how device assignments are created. A.1 Requirement:
12 Version 2.0 EFI_SHELL_PROTOCOL.DeleteFile() Summary Deletes the file specified by the file handle. Prototype typedef EFI_STATUS (EFIAPI *EF
210 Version 2.0 The change of the number or physical connection of hardware which can have child hardware devices will be considered as hardwa
Version 2.0 211 2. Use certain algorithm to sort all the condensed device paths 3. Adding/Removing controller(s) would change the index (hardwa
212 Version 2.0 The 4 USB devices are the hard disks, so their MTDs are “hd”. A.2.5.2 Step 2: Determine HI HI is determined by ACPI device pa
Version 2.0 213 UHC1 acpi(pnp0a03,0)/pci(1d|0) - 5 UHC2 acpi(pnp0a03,0)/pci(1d|1) - 8 UHC3 acpi(pnp0a03,0)/pci(1d|2) - 12 UHC4 acpi(pnp0a
214 Version 2.0 acpi(pnp0a03,0)/pci(1d,0)/usb(0,1)/usb(1,1)/HD(Part4, sigxxx) Æ hd5a1b1e acpi(pnp0a03,0)/pci(1d,3)/usb(0,1)/usb(5,1)/HD(Part2,
Version 2.0 215 MESSAGING_DEVICE MSG_ATAPI CSD Node IDE channel index (0 for primary, master, 3 for secondary slave) MESSAGING_DEVICE MSG_SCSI
216 Version 2.0 BBS_DEVICE BBS_BBS NONE Don’t process. A.3.1 Get the MTD The MTD is a string that carries device’s media info. Such as flop
Version 2.0 217 A.3.3.1.1 Example usb(0,1) Æ a1 usb(1,0) Æ b0 A.3.3.2 Floppy Devices General consistent mapping rule Use _UID for CSD A.3.3.2.1
218 Version 2.0 A.3.3.7.1 Examples Ata(Primary,Master) Æ a Ata(Primary, Slave) Æ b Ata(Secondary,Master) Æ c Ata(Secondary, Slave) Æ d HD(p2,
Version 2.0 219 A.3.3.14 UART Device Path Use Baud Rate, Data Bits, Parity, Stop Bits as CSD A.3.3.15 Vendor-Defined Device Path Use guid as CS
Version 2.0 13 EFI_SHELL_PROTOCOL.DeleteFileByName() Summary Deletes the file specified by the file handle. Prototype typedef EFI_STATUS (EFIAPI
220 Version 2.0 Pseudo Code foreach handle in System { Get DevicePath form handle; If DevicePath is null { Continue; } HIDevicePat
Version 2.0 221 Sort the HI device path table. Consist mapping device path compare: Compare(Node1, Node2) { If (DeviceType(Node1) != DeviceTy
222 Version 2.0
Version 2.0 223 Appendix B UEFI Help Manual Page Syntax The manual page files are standard text files with title and section heading information
224 Version 2.0
Version 2.0 225 Appendix C UEFI Shell Status Codes Most UEFI Shell commands return SHELL_STATUS code values. These UEFI Shell status codes are
226 Version 2.0 SHELL_SECURITY_VIOLATION 26 The function was not performed due to a security violation. SHELL_NOT_EQUAL 27 The function wa
Version 2.0 227 Appendix D UEFI Shell Command Standard Formatted Output This section describes the general, table-based standard output format f
228 Version 2.0 sfo-columns, | sfo-column sfo-column := quoted-string | <empty> Example VolumeInfo, "TimsVolume&quo
14 Version 2.0 EFI_SHELL_PROTOCOL.DisablePageBreak() Summary Disables the page break output mode. Prototype typedef VOID (EFIAPI *EFI_SHELL_DI
Version 2.0 15 EFI_SHELL_PROTOCOL.EnablePageBreak() Summary Enables the page break output mode. Prototype typedef VOID (EFIAPI *EFI_SHELL_ENABLE
16 Version 2.0 EFI_SHELL_PROTOCOL.Execute() Summary Execute the command line. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_EXECUTE) ( IN
Version 2.0 17 pointed to by StatusCode. EFI_INVALID_PARAMETER The parameters are invalid. EFI_OUT_OF_RESOURCES Out of resources. EFI_UNSUPPORT
18 Version 2.0 EFI_SHELL_PROTOCOL.FindFiles() Summary Find files that match a specified pattern. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHE
Version 2.0 19 EFI_SHELL_PROTOCOL.FindFilesInDir() Summary Find all files in a specified directory. Prototype typedef EFI_STATUS (EFIAPI *EFI_SH
Version 2.0 iii Contents 1 Introduction...1
20 Version 2.0 EFI_SHELL_PROTOCOL.FlushFile() Summary Flushes data back to a device Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_FLUSH_FILE
Version 2.0 21 EFI_SHELL_PROTOCOL.FreeFileList() Summary Frees the file list. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
22 Version 2.0 EFI_SHELL_PROTOCOL.GetCurDir() Summary Returns the current directory on the specified device. Prototype typedef CONST CHAR16 *
Version 2.0 23 EFI_SHELL_PROTOCOL.GetDeviceName() Summary Gets the name of the device specified by the device handle. Prototype typedef EFI_STATU
24 Version 2.0 If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the device’s name using the EFI_DEVICE_PATH_PROTOCOL,
Version 2.0 25 EFI_SHELL_PROTOCOL.GetDevicePathFromMap() Summary Gets the device path from the mapping. Prototype typedef CONST EFI_DEVICE_PATH_
26 Version 2.0 EFI_SHELL_PROTOCOL.GetDevicePathFromFilePath() Summary Converts a file system style name to a device path. Prototype typedef E
Version 2.0 27 EFI_SHELL_PROTOCOL.GetEnv() Summary Gets the environment variable. Prototype typedef CONST CHAR16 * (EFIAPI *EFI_SHELL_GET_ENV)
28 Version 2.0 EFI_SHELL_PROTOCOL.GetFileInfo() Summary Gets the file information from an open file handle. Prototype typedef EFI_FILE_INFO *
Version 2.0 29 EFI_SHELL_PROTOCOL.GetFilePathFromDevicePath() Summary Converts a device path to a file system-style path. Prototype typedef CHAR
iv Version 2.0 2.3 EFI_SHELL_PARAMETERS_PROTOCOL ...52 EFI_SHELL_PARAMETERS_PROTOCOL...
30 Version 2.0 EFI_SHELL_PROTOCOL.GetFilePosition() Summary Gets a file’s current position Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_GET
Version 2.0 31 EFI_SHELL_PROTOCOL.GetFileSize() Summary Gets the size of a file. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
32 Version 2.0 EFI_SHELL_PROTOCOL.GetHelpText() Summary Return help information about a specific command. Prototype typedef EFI_STATUS (EFI
34 Version 2.0 EFI_SHELL_PROTOCOL.GetMapFromDevicePath() Summary Gets the mapping that most closely matches the device path. Prototype typedef CONST
Version 2.0 35 EFI_SHELL_PROTOCOL.GetPageBreak() Summary Gets the enable status of the page break output mode. Prototype typedef BOOLEAN (EFIAPI
36 Version 2.0 EFI_SHELL_PROTOCOL.IsRootShell() Summary Judges whether the active shell is the root shell. Prototype typedef BOOLEAN (EFIAPI *
Version 2.0 37 EFI_SHELL_PROTOCOL.OpenFileByName() Summary Opens a file or a directory by file name. Prototype typdef EFI_STATUS (EFIAPI *EFI_SHE
38 Version 2.0 If the file name is NUL, then the file handle that is returned refers to the standard NUL file. If the OpenMode indicates EFI_
Version 2.0 39 EFI_SHELL_PROTOCOL.OpenFileList() Summary Opens the files that match the path specified. Prototype typedef EFI_STATUS (EFIAPI *EFI
Version 2.0 v cls ...88 comp ...
40 Version 2.0 FullName Specifies the full name of the file, including the path. Handle The file handle of the file after it was opened. Info
Version 2.0 41 EFI_SHELL_PROTOCOL.OpenRoot() Summary Opens the root directory of a device. Prototype typedef EFI_STATUS (EFIAPI EFI_SHELL_OPEN_R
42 Version 2.0 EFI_SHELL_PROTOCOL.OpenRootByHandle() Summary Opens the root directory of a device on a handle Prototype typedef EFI_STATUS (EF
Version 2.0 43 EFI_SHELL_PROTOCOL.ReadFile() Summary Reads data from the file. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_READ_FILE) ( IN
44 Version 2.0 EFI_SHELL_PROTOCOL.RemoveDupInFileList() Summary Deletes the duplicate file names files in the given file list. Prototype typed
Version 2.0 45 EFI_SHELL_PROTOCOL.SetAlias() Summary Changes a shell command alias. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_SET_ALIAS)(
46 Version 2.0 EFI_SHELL_PROTOCOL.SetCurDir() Summary Changes the current directory on the specified device. Prototype typedef EFI_STATUS (E
Version 2.0 47 EFI_SHELL_PROTOCOL.SetEnv() Summary Sets the environment variable. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_SET_ENV) (
48 Version 2.0 EFI_SHELL_PROTOCOL.SetFileInfo() Summary Sets the file information to an opened file handle. Prototype typedef EFI_STATUS (EF
Version 2.0 49 EFI_SHELL_PROTOCOL.SetFilePosition() Summary Sets a file’s current position Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_SET_FI
vi Version 2.0 smbiosview... 194 stall ...
50 Version 2.0 EFI_SHELL_PROTOCOL.SetMap() Summary Changes a shell command alias. Prototype typedef EFI_STATUS (EFIAPI *EFI_SHELL_SET_MAP)(
Version 2.0 51 EFI_SHELL_PROTOCOL.WriteFile() Summary Writes data to the file. Prototype typedef EFI_STATUS (EFIAPI EFI_SHELL_WRITE_FILE)( IN
52 Version 2.0 2.3 EFI_SHELL_PARAMETERS_PROTOCOL EFI_SHELL_PARAMETERS_PROTOCOL Summary Shell application’s arguments. GUID #define EFI_SHELL_
54 Version 2.0
Version 2.0 55 3 UEFI Shell Features The UEFI Shell supports an interactive command-line interface, scripting, and a standard set of commands. A
56 Version 2.0 PATH support determines whether the PATH environment variable will be used to determine the location of executables. ALIAS supp
Version 2.0 57 -noconsolein Console input will not be accepted from the user. This has no effect for UEFI Shells that do not support an interact
58 Version 2.0 11. If startup.nsh is supported and enabled (see –startup and –nostartup), the script will be launched. 12. If a file name w
Version 2.0 59 3.4.1 Special Characters When the shell scans its input, it always treats certain characters (#, >, <, |, %, *, ?, ^, “, spa
Version 2.0 vii A.3.3.2.1 Examples: ... 217 A.3.
60 Version 2.0 For information about how the quotes are treated in each of the options, see “Shell Commands”, chapter 5). 3.4.4 Redirection 3
Version 2.0 61 2>>v Append standard error to an environment variable, encoded as UCS2. The UEFI Shell will redirect standard output to a s
62 Version 2.0 UEFI_Shell_Command [options] | UEFI_Shell_Command When piping from an environment variable, the environment variable must alre
Version 2.0 63 Figure 1 Variable substitution flow chart 3.6.1 Environment Variables Environment variables are variables that can hold the user
64 Version 2.0 Table 7 Environment Variables with Special Meaning to the UEFI Shell Variable V/NV RO/RW Description cwd V/RO The current wor
Version 2.0 65 uefiversion V/RO Reflects the revision of the UEFI specification that the underlying firmware supports. The contents will look l
66 Version 2.0 the variable substitution. So if %myvariable% is set to dir and dir is aliased to ls, entering %myvariable% in command line wil
Version 2.0 67 [] can be either wildcard characters or literal file name characters, the UEFI Shell will try to take them as wildcard characters
68 Version 2.0 3.9 Nesting the Shell The UEFI Shell supports nested shell execution. The UEFI Shell can run the shell from within itself. The
Version 2.0 69 3.10.3 Output Streaming Control The UEFI Shell supports the ability to pause and resume the streaming of characters to the output
viii Version 2.0 Tables Table 1 Support Levels ...55 Table
70 Version 2.0 implementation of the shell. Some of these command profiles are standard (see “Shell Command Profiles”, section 5.2) and others
Version 2.0 71 4 Scripts UEFI Shell scripts allow user to simplify routine or repetitive tasks. A shell script program is a UCS-2 or ASCII text
72 Version 2.0 else, endif, and goto, the script will exit. If the error arousing script is a called by another script, the caller script will
Version 2.0 73 5 Shell Commands 5.1 Overview This section describes the standard UEFI Shell commands. The table below lists all standard UEFI
74 Version 2.0 Table 10 Commands from Default Build Shell Command Description Required at Shell Level or Profile alias Displays, creates, or d
Version 2.0 75 Command Description Required at Shell Level or Profile alias Displays, creates, or deletes aliases in the UEFI Shell environment 3
76 Version 2.0 Command Description Required at Shell Level or Profile alias Displays, creates, or deletes aliases in the UEFI Shell environmen
Version 2.0 77 Command Description Required at Shell Level or Profile alias Displays, creates, or deletes aliases in the UEFI Shell environment 3
78 Version 2.0 5.2 Shell Command Profiles Shell command profiles are groups of shell commands that are identified by a profile name. Profile
Version 2.0 79 Description This command displays, creates, or deletes aliases in the UEFI Shell environment. An alias provides a new name for an
Version 2.0 ix Revision History Revision Number Description Revision Date 2.0 Initial UEFI release 9/25/08 §
80 Version 2.0 Shell> alias -v fs0 floppy Shell> alias md : mkdir rd : rm * fs0 : floppy
Version 2.0 81 attrib Summary Displays or changes the attributes of files or directories. Usage attrib [+a|-a] [+s|-s] [+h|-h] [+r|-r] [file...]
82 Version 2.0 Status Codes Returned SHELL_SUCCESS The action was completed as requested. SHELL_NOT_FOUND The requested file was not found.
Version 2.0 83 bcfg Summary Manages the boot and driver options that are stored in NVRAM. Usage bcfg driver|boot [dump [-v]] [add # file "de
84 Version 2.0 associated with the driver or boot option optional data or else the quote-delimited data which will be associated with the driv
Version 2.0 85 Shell> bcfg boot –opt 3 0x40000200 0 0x42 Status Codes Returned SHELL_SUCCESS The action was completed as requested. SHELL_NOT
86 Version 2.0 cd Summary Displays or changes the current directory. Usage cd [path] Options path The relative or absolute directory path. De
Version 2.0 87 Examples To change the current filesystem to the mapped fs0 filesystem: Shell> fs0: To change the current directory to sub
88 Version 2.0 cls Summary Clears the standard output and optionally changes the background color. Usage cls [color] Options color - N
Version 2.0 89 comp Summary Compares the contents of two files on a byte for byte basis. Usage comp [-b] file1 file2 Options -b - Display
Komentarze do niniejszej Instrukcji