您的位置:首页 > 其它

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: