Linux 系统启动需要一个 bootloader 引导加载程序,也就是说芯片上电以后先运行一段bootloader程序。这段bootloader程序会先初始化DDR等外设,然后将Linux内核从flash拷贝到 DDR 中,最后启动 Linux 内核。主要的工作就是启动 Linux 内核, bootloader 和 Linux 内核的关系就跟 PC 上的 BIOS 和 Windows 的关系一样, bootloader 就相当于 BIOS。uboot 的全称是 Universal Boot Loader, uboot 是一个遵循 GPL 协议的开源软件, uboot 是一个裸机代码。
在UBoot命令行中依次测试使用CMD,记录调用过程,整理自己的理解。
命令 | 含义 | 理解 | 图示 |
---|---|---|---|
? | - alias for ‘help’ | help命令的别名,和help功能一致 | ![]() |
base | - print or set address offset | ![]() | ![]() |
bdinfo | - print Board Info structure | ![]() | ![]() |
boot | - boot default, i.e., run ‘bootcmd’ | ![]() | ![]() |
boot_test | - boot siflower test image | 用于启动各种不同类型的测试镜像 | ![]() |
bootd | - boot default, i.e., run ‘bootcmd’ | ![]() | ![]() |
bootelf | - Boot from an ELF image in memory | ![]() | ![]() |
bootm | - boot application image from memory | ![]() | ![]() |
bootp | - boot image via network using BOOTP/TFTP protocol | ![]() | ![]() |
bootvx | - Boot vxWorks from an ELF image | ![]() | |
btn_httpd_detect | - check pmu buttom to run httpd | ||
cmp | - memory compare | ![]() | ![]() |
coninfo | - print console devices and information | ![]() | ![]() |
cp | - memory copy | ![]() | ![]() |
crc32 | - checksum calculation | ![]() | ![]() |
dhcp | - boot image via network using DHCP/TFTP protocol | ![]() | |
dm | - Driver model low level access | ![]() | ![]() |
echo | - echo args to console | ![]() | ![]() |
editenv | - edit environment variable | ![]() | ![]() |
env | - environment handling commands | ![]() | ![]() |
exit | - exit script | ![]() | |
false | - do nothing, unsuccessfully | 输入后没有什么反馈 | ![]() |
fdt | - flattened device tree utility commands | ![]() | |
go | - start application at address ‘addr’ | ![]() | |
help | - print command description/usage | 和?的作用一样 | |
httpd | - start www server for firmware recovery with [localAddress] | ![]() | 最熟悉不过的httpd 192.168.4.5 |
iminfo | - print header information for application image | ![]() | |
imxtract | - extract a part of a multi-image | ![]() | |
itest | - return true/false on integer compare | ![]() | ![]() |
loop | - infinite loop on address range | ![]() | ![]() |
lzmadec | - lzma uncompress a memory region | ![]() | |
md | - memory display | ![]() | ![]() |
mm | - memory modify (auto-incrementing address) | ![]() | ![]() |
mw | - memory write (fill) | ![]() | ![]() |
nm | - memory modify (constant address) | ![]() | |
ping | - send ICMP ECHO_REQUEST to network host | U-Boot 中的 ping 命令主要用于基本的网络测试 | ![]() |
printenv | - print environment variables | ![]() | ![]() |
reset | - Perform RESET of the CPU | ![]() | ![]() |
rhreset | - Rehold all module resets to save power | ![]() | ![]() |
run | - run commands in an environment variable | ![]() | |
saveenv | - save environment variables to persistent storage | ![]() | ![]() |
setenv | - set environment variables | ![]() | 用setenv命令在Linux环境中设置环境变量![]() |
sf | - SPI flash sub-system | ![]() | ![]() |
showvar | - print local hushshell variables | ![]() | ![]() |
sleep | - delay execution for some time | ![]() | ![]() |
source | - run script from memory | ![]() | |
spld | - update spl from device | 更新二级启动加载程序 | ![]() |
test | - minimal test like /bin/sh | ![]() | ![]() |
tftpboot | - boot image via network using TFTP protocol | ![]() | |
true | - do nothing, successfully | 没有什么反馈 | ![]() |
version | - print monitor, compiler and linker | ![]() | ![]() |