UEFI Shell命令详解,自写一个UEFI Shell命令

本文提供了一览UEFIShell下的各种命令,包括设备管理、驱动交互、文件操作、系统设置等功能,如acpiview、bcd、ifconfig、load、unload等,适用于系统管理员和IT技术人员进行系统维护和调试。
摘要由CSDN通过智能技术生成

首先,我们从BIOS进入Shell,输入help命令查看帮助信息

Shell:help

acpiview      - Display ACPI Table information.
alias         - Displays, creates, or deletes UEFI Shell aliases.
attrib        - Displays or modifies the attributes of files or directories.
bcfg          - Manages the boot and driver options that are stored in NVRAM.
cd            - Displays or changes the current directory.
cls           - Clears the console output and optionally changes the background and foreground color.
comp          - Compares the contents of two files on a byte-for-byte basis.
connect       - Binds a driver to a specific device and starts the driver.
cp            - Copies one or more files or directories to another location.
date          - Displays and sets the current date for the system.
dblk          - Displays one or more blocks from a block device.
devices       - Displays the list of devices managed by UEFI drivers.
devtree       - Displays the UEFI Driver Model compliant device tree.
dh            - Displays the device handles in the UEFI environment.
disconnect    - Disconnects one or more drivers from the specified devices.
dmem          - Displays the contents of system or device memory.
dmpstore      - Manages all UEFI variables.
drivers       - Displays the UEFI driver list.
drvcfg        - Invokes the driver configuration.
drvdiag       - Invokes the Driver Diagnostics Protocol.
dumpfdt       - Dump current Flat Device Tree (FDT)
echo          - Controls script file command echoing or displays a message.
edit          - Provides a full screen text editor for ASCII or UCS-2 files.
eficompress   - Compresses a file using UEFI Compression Algorithm.
efidecompress - Decompresses a file using UEFI Decompression Algorithm.
else          - Identifies the code executed when 'if' is FALSE.
endfor        - Ends a 'for' loop.
endif         - Ends the block of a script controlled by an 'if' statement.
exit          - Exits the UEFI Shell or the current script.
for           - Starts a loop based on 'for' syntax.
getmtc        - Gets the MTC from BootServices and displays it.
goto          - Moves around the point of execution in a script.
help          - Displays the UEFI Shell command list or verbose command help.
hexedit       - Provides a full screen hex editor for files, block devices, or memory.
if            - Executes commands in specified conditions.
ifconfig      - Modifies the default IP address of the UEFI IPv4 Network Stack.
load          - Loads a UEFI driver into memory.
loadpcirom    - Loads a PCI Option ROM.
ls            - Lists the contents of a directory or file information.
map           - Displays or defines file system mappings.
memmap        - Displays the memory map maintained by the UEFI environment.
mkdir         - Creates one or more new directories.
mm            - Displays or modifies MEM/MMIO/IO/PCI/PCIE address space.
mode          - Displays or changes the console output device mode.
mv            - Moves one or more files to a destination within or between file systems.
openinfo      - Displays the protocols and agents associated with a handle.
parse         - Retrieves a value from a standard format output file.
pause         - Pauses a script and waits for an operator to press a key.
pci           - Displays PCI device list or PCI function configuration space and PCIe extended
configuration space.
ping          - Ping the target host with an IPv4 stack.
reconnect     - Reconnects drivers to the specific device.
reset         - Resets the system.
rm            - Deletes one or more files or directories.
sermode       - Sets serial port attributes.
set           - Displays or modifies UEFI Shell environment variables.
setfdt        - Define and/or re-install a Flat Device Tree (FDT)
setsize       - Adjusts the size of a file.
setvar        - Displays or modifies a UEFI variable.
shift         - Shifts in-script parameter positions.
smbiosview    - Displays SMBIOS information.
stall         - Stalls the operation for a specified number of microseconds.
tftp          - Download a file from TFTP server.
time          - Displays or sets the current time for the system.
timezone      - Displays or sets time zone information.
touch         - Updates the filename timestamp with the current system date and time.
type          - Sends the contents of a file to the standard output device.
unload        - Unloads a driver image that was already loaded.
ver           - Displays UEFI Firmware version information.
vol           - Displays or modifies information about a disk volume.

Help usage:help [cmd|pattern|special] [-usage] [-verbose] [-section name][-b]

中文释义

命令功能命令功能
acpiview显示ACPI表相关信息ifconfig配置IP地址
alias显示,创建,删除别名load加载UEFI驱动
attrib显示,更改文件或目录属性loadpcirom加载PCI ROM
bcfg管理启动项ls列出目录内容或文件信息
cd更改当前目录map显示Mapping
cls清空标准输出memmap显示目录映射
comp比较两个文件mkdir创建目录
connect将driver绑定到指定的设备并启动drivermm列出或修改MEM/MMIO/IO/PCI/PCIE地址空间
cp将文件或文件夹复制到另一个位置mode列出或修改输出设备的模式
date显示或设置日期mv移动文件或目录
dblk显示块设备里的块openinfo显示Protocols打开信息
devices列出所有设备parse从标准格式输出文件检索值
devtree显示设备树pause暂停执行脚本,等待用户输入
dh显示设备句柄pci显示PCI设备
disconnect从指定设备卸载驱动pingping
dmem显示系统或设备内存的内容reconnect重新连接驱动与设备
dmpstore管理UEFI NVRAM变量reset重启系统
drivers显示设备驱动rm删除文件或目录
drvcfg配置驱动sermode设置串口属性
drvdiag调动Driver Disgnostis Protocolset显示或修改Shell中的环境变量
dumpfdt调用驱动程序配置setfdt定义和/或重新安装平面设备树(FDT)
echo回显setsize调整文件大小
edit编辑ASCII或UCS-2文件setvar设置UEFI变量
eficompress压缩文件shift移动脚本内参数的位置
efidecompress解压文件smbiosview显示SMBIOS信息
else标识当’if’为FALSE时执行的代码stall在指定的时间内暂停执行
endfor结束“for”循环tftp从TFTP服务器下载文件
endif结束由’if’语句控制的脚本块time显示/设置时区
exit退出Shell或脚本timezone显示/设置时区
for开始一个“for”循环touch更新文件时间设置
getmtc从BootServices获取MTC并显示它type显示文件类型
goto在脚本的执行点周围移动unload卸载驱动
help显示帮助信息ver显示UEFI固件版本信息
hexedit二进制编辑器,可编辑文件,块设备或内存vol显示/设置卷标
if开始一个“if”语句

Shell命令通用选项

命令行参数作用
-b,-break输出信息分屏显示
-q,-quit不输出任何信息
-sfo用标准格式输出
-t,-terse用简洁格式输出信息
-v,-verbose输出辅助信息
-?输出帮助信息

自己写一个UEFI Shell 命令(基于开源EDK2代码)

…待补充

  • 3
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值