EFI/UEFI Shell 的常用命令列表 Command list
早期Legacy BIOS會在DOS環境下, 透過指令方式, 或集結成批次檔 *.bat 以完成特定的自動化需求; 現在推動UEFI環境, 這是Built-in的 EFI shell, 要自動化也是需要批次檔 *nsh
當系統開機到 EFI shell時, 此時嵌入式作業系統會透過搜尋已定義好的path 找尋此檔 startup.nsh, 所以基本上來說Startup.nsh相當於DOS/Windows環境下的autoexec.bat,當跑完這個startup script之後, 會顯示如下的指令提示介面: (翻譯引用自Intel文件:Basic Instructions for Using the Extensible Firmware Interface (EFI))
Shell>
下表引用自UEFI和Legacy BIOS的差異
Legacy BIOS | UEFI | |
發明年代 | 1975 by IBM | 2002 by Intel |
程式語言 | 組合語言 | C語言 |
CPU mode | 16-bit mode(Real mode) | 32/64-bit mode(Flat mode) |
記憶體定址空間 | ~1 MB | >4 GB |
支援硬碟分割格式 | MBR | GPT |
支援硬碟最大容量 | ~2 TB | ~9 ZetaBytes |
支援硬碟主分割區數量 | 4 | 128 |
Boot Speed | 慢 | 快 |
Boot Manager | Boot loader in MBR | Boot loaders in ESP |
硬體擴充方式 | Option ROM | EFI driver |
硬體資源控制 | Interrupt | Protocol/Driver |
安全機制 | TPM | Secure Boot |
VGA BIOS | VBIOS | GOP |
Bootable USB Flash drive | DOS | EFI Shell |
統一可延伸韌體介面(Unified Extensible Firmware Interface, UEFI)是一種個人電腦系統規格,用來定義作業系統與系統韌體之間的軟體介面,作為BIOS的替代方案。可延伸韌體介面負責加電自檢(POST)、連繫作業系統以及提供連接作業系統與硬體的介面。(參考自wiki)
可擴展韌體介面在軟體堆疊裡的位置
EFI開機管理員與 EFI drivers的溝通方式
EFI/UEFI Shell Command
列出EFI/UEFI 裡面 EFI Shell界面支持的命令。
對這些命令無法執行或出錯,在EFI shell提示符下輸入help命令。
可以使用的一些命令如下:
“Boot Commands — EFI Shell”.
“Configuration Commands — EFI Shell”.
“Device, Driver, and Handle Commands — EFI Shell”.
“Filesystem Commands — EFI Shell”.
“Memory Commands — EFI Shell”.
“Shell Navigation and Other Commands — EFI Shell”.
“Shell Script Commands / Programming Constructs — EFI Shell”.
Command | Description |
---|---|
Boot Commands — EFI Shell. Commands related to nPartition booting. n分區啟動的相關命令 | |
autoboot | Set/view autoboot timeout variable. |
bcfg | Display/modify the driver/boot configuration. |
boottest | Set/view BootTest bits. |
dbprofile | Display/modify direct boot profiles for use by lanboot. |
lanboot | Boot over the LAN. |
reconfigreset | Reset the system (nPartition) for reconfiguration; the nPartition remains inactive, in the shutdown for reconfig state. |
reset | Reset the system (nPartition). |
search | Connect drivers for bootables devices. |
Configuration Commands — EFI Shell. Commands for changing and retrieving system (nPartition) information. | |
acpiconfig | Set/view ACPI configuration mode. |
cellconfig | Deconfigure/reconfigure cells. (Set cell use-on-next-boot values.) |
cpuconfig | Deconfigure/reconfigure processors and processor cores.. |
date | Display the current date or set the date of the system (nPartition). |
dimmconfig | Deconfigure/reconfigure memory (DIMMs). |
err | Display/change the error level. |
errdump | View/clear logs. |
fru | View FRU data. |
info | Display hardware information. |
monarch | Set/view a monarch processor. |
palproc | Make a PAL call. |
romdrivers | Enable/disable PCI expansion ROM drivers. |
rootcell | Set/view preferred root cells. (Set nPartition core cell choices.) |
salproc | Make a SAL call. |
tftp | Performs TFTP operation to a bootp/DHCP enabled Unix boot server. |
time | Display the current time or set the time of the system (nPartition). EFI time is set and presented in GMT (Greenwich mean time). |
variable | Save/restore specific EFI variables. |
ver | Display the version information. |
Device, Driver, and Handle Commands — EFI Shell. Commands for managing devices, drivers, and handles. | |
baud | View serial port com settings. |
connect | Bind a driver to a device. |
dblk | Hex dump of BlkIo devices. |
devices | Display devices managed by EFI drivers. |
devtree | Display tree of devices. |
dh | Dump handle info. |
disconnect | Disconnect driver(s) from device(s). |
drivers | Display list of drivers. |
drvcfg | Invoke the Driver Config Protocol. |
drvdiag | Invoke the Driver Diagnostics Protocol. |
guid | Dump known GUID IDs. |
lanaddress | Display MAC address. |
load | Load EFI drivers. |
map | Map shortname to device path. |
openinfo | Display the open protocols for given handle. |
pci | Display PCI devices or PCI function configuration space. |
reconnect | Reconnect driver(s) from a device. |
unload | Unload a protocol image. |
Filesystem Commands — EFI Shell. Commands for managing files, directories, and attributes. | |
attrib | Display/change the attributes of files/directories. |
cd | Update/view the current directory. |
comp | Compare the contents of two files. |
cp | Copy one or more files/directories to another location. |
edit | Edit an ASCII or UNICODE file in full screen. |
eficompress | Compress infile and write to outfile. |
efidecompress | Decompress infile and write to outfile. |
hexedit | Edit a file, block device, or memory region using hex. |
ls | Display a list of files and subdirectories in a directory. |
mkdir | Create one or more directories. |
mount | Mount a filesystem on a block device. |
rm | Delete one or more files/directories. |
setsize | Set the size of a file. |
touch | Update time of file/directory with current time. |
type | Display the contents of a file. |
vol | Display volume information of the file system. |
Memory Commands — EFI Shell. Commands for listing and managing memory, EFI variables, and NVRAM details. | |
default | Set the default NVRAM values. |
dmem | Dump memory or memory mapped IO. |
dmpstore | Display all EFI variables. |
memmap | Display the memory map. |
mm | Display/modify MEM/IO/PCI. |
pdt | View/clear nPartition or cell memory page deallocation table (PDT). |
Shell Navigation and Other Commands — EFI Shell. Commands for basic EFI Shell navigation and customization. | |
alias | Set/get alias settings. |
cls | Clear the standard output with an optional background color. |
exit | Exit EFI Shell environment. |
getmtc | Display current monotonic counter value. |
help or ? | Display help. |
mode | Display the mode of the console output device. |
set | Set/Get environment variable. |
xchar | Turn on/off extended character features. |
Shell Script Commands / Programming Constructs — EFI Shell. EFI shell-script commands. | |
echo | Echo message to stdout or toggle script echo. |
else | Script-only: Use with IF THEN. |
endfor | Script-only: Delimiter for FOR loop construct. |
endif | Script-only: Delimiter for IF THEN construct. |
for | Script-only: Loop construct. |
goto | Script-only: Jump to label location in script. |
if | Script-only: IF THEN construct. |
input | Take user input and place in EFI variable. |
pause | Script-only: Prompt to quit or continue. |
stall | Stall the processor for some microseconds. |
其他指令
STALL (以微秒為單位的延遲)
Note:
1. STALL in emulation NT environment will sleep for ‘microseconds’.
2. STALL in some other platforms will wait for ‘microseconds’.
3. Microseconds is in decimal units.
Examples:
Shell> stall 1000000 //表示Stall for 1000000 uS
留言
張貼留言