BeagleBoneBlack的U-Boot是如何引导系统的

2014-8-27 10:45:11
BeagleBoneBlack U-Boot 是如何引导系统的

连接到开发板

通过串口连接BeagleBone Black,参见Beagleboard:Terminal Shells
启动到U-Boot的时候,会看到

Hit any key to stop autoboot:0

按下任意键则放弃了自动引导,从而进入了U-Boot的命令行。
在这里你可以手动进行接下来系统的引导。但是我不会。
虽然不会,但是用于板子上的系统有自动引导,
我们可以分析自动引导,来了解U-Boot是如何引导系统的。


资料

在U-Boot的官网手册中看到了2个关键的环境变量和1个命令。
5.10. U-Boot Environment Variables

  • bootcmd: This variable defines a command string that is automatically >executed
         when the initial countdown is not interrupted.
         This command is only executed when the variable bootdelay is also defined!
  • bootargs: The contents of this variable are
         passed to the Linux kernel
         as boot arguments (aka “command line”).

5.9.6. Environment Variables Commands

5.9.6.4. run - run commands in an environment variable

bootcmd中的命令就是出现“Hit any key to stop autoboot”提示后,不按任意键,会自动运行的命令。
bootargs是传递给Linux内核的参数。
run是运行环境变量中的命令,bootcmd中包含run命令。


分析

所以分析引导过程要从bootcmd开始。

环境变量

在U-Boot的命令行中输入printenv可显示所有的环境变量,

U-Boot# printenv
arch=arm
baudrate=115200
board=am335x
board_name=A335BNLT
board_rev=t\
ue
boot_fdt=try
bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;
bootcount=2
bootdelay=1
bootdir=/boot
bootenv=uEnv.txt
bootfile=zImage
bootpart=0:2
console=ttyO0,115200n8
cpu=armv7
dfu_alt_info_emmc=rawemmc mmc 0 3751936
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 100 100;u-boot.img.raw mmc 300 400;spl-os-args.raw mmc 80 80;spl-os-image.raw mmc 900 2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
eth1addr=c8:a0:30:ac:87:2a
ethact=cpsw
ethaddr=c8:a0:30:ac:87:28
fdt_high=0xffffffff
fdtaddr=0x80F80000
fdtfile=undefined
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
importbootenv=echo Importing environment from mmc 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值