上一篇已经分析到main_loop(),基本上board.c结束了,现在我们要进入fastapp_entry()以及main_loop(),去看看uboot到底是如何引导内核启动的。
下面一张图,是一张很简单的流程图,只列出了基本的方法调用关系,大家先有个印象,接下来细讲。
//product/main.c
int fastapp_entry(int argc, char *argv[])
{
#ifdef HI_ANDROID_BOOT_SUPPORT
<strong> Android_Main(); </strong> //环境参数设置
#endif
#ifndef HI_ADVCA_SUPPORT
#ifdef HI_LOADER_SUPPORT
<strong> Loader_Main();</strong>
#else
HI_INFO_PRINT(HI_ID_SYS, "not support hisi loader!\n");
#endif
#endif
#ifdef HI_ADVCA_SUPPORT
c51_loadCode();
#endif
return 0;
}
int Android_Main(void)
{
load_recovery(); //进入recovery模式
#ifdef HI_ADVCA_SUPPORT
if (-1 == CA_auth())
{
run_command("reset", 0); //重启
}
#endif
return 0;
}
//设置recovery参数
void load_recovery(void)
{
int ret = 0;
int keycode = 0;
if (!strcmp<strong>(boot_select()</strong>, "kernel"))