设为首页 加入收藏

TOP

U-Boot启动方式源码分析
2014-11-24 13:07:18 来源: 作者: 【 】 浏览:0
Tags:U-Boot 启动 方式 源码 分析

1、


s = getenv ("bootdelay"); //得到环境变量指定的delay值
bootdelay = s (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;



s = getenv ("bootcmd"); //得到自启动命令



if (bootdelay >= 0 && s && !abortboot (bootdelay)) {


# ifdef CONFIG_AUTOBOOT_KEYED
int prev = disable_ctrlc(1);/* disable Control C checking */
# endif



# ifndef CFG_HUSH_PARSER
run_command (s, 0);
# else
parse_string_outer(s, FLAG_PARSE_SEMICOLON |
FLAG_EXIT_FROM_LOOP);
# endif



# ifdef CONFIG_AUTOBOOT_KEYED
disable_ctrlc(prev);/* restore Control C checking */
# endif


}


/*如果bootdelay的值是大于或等于0,并且abortboot(bootdelay)返回0,那么就执行自动启动。abortboot()函数输出提示用户在指定时间内按下任意按键将停止自动运行,然后等待用户输入,如果bootdelay已经减到0,并且用户还没有输入,函数将返回0,否则返回1.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇U-Boot启动Linux内核 下一篇Android中ImageSwitcher结合Galle..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: