u-boot启动方式源码分析
2012-04-21 20:15
211 查看
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.
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源码分析 --- 启动第二阶段002
- u-boot源码分析 --- 启动第二阶段005
- u-boot源码分析 --- 启动第二阶段007
- [Java]从spring(spring boot)的启动分析注解定义方式的bean的加载
- u-boot源码分析 --- 启动第二阶段006
- Spring Boot 2.x 启动全过程源码分析(上)入口类剖析
- u-boot启动过程分析(源码)
- U-Boot 启动过程和源码分析(第二阶段)-main_loop分析
- u-boot源码分析 --- 启动第二阶段007
- 通过实例及源码分析关于SpringBoot启动类启动时自动配置问题
- U-Boot 启动过程和源码分析(第一阶段)
- u-boot源码分析 --- 启动第二阶段001
- u-boot源码分析 --- 启动第二阶段 ,基于2410 启动代码 分析
- TQ2440 学习笔记—— 31、移植U-Boot【U-Boot 的启动过程第二阶段源码分析】
- u-boot源码分析 --- 启动第二阶段002
- U-Boot启动过程源码分析(1)-第一阶段
- U-Boot启动过程源码分析(3)-启动Linux
- Thread启动方式一(Thread.start):源码分析
- u-boot源码分析 --- 启动第二阶段003