一个cmd_tbl_t结构体变量包含了调用一条命令的所需要的信息。
在这个里面有一个函数:
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
{
bd_t *bd = gd- >bd;
char *s;
int machid = bd- >bi_arch_number;
void (*theKernel)(int zero, int arch, uint params);
#ifdef CONFIG_CMDLINE_TAG
#ifdef CONFIG_HI3536_A7
char *commandline = getenv("slave_bootargs");
#else
char *commandline = getenv("bootargs"); //(1)
#endif
#endif
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
theKernel = (void (*)(int, int, uint))images- >ep; //(2)
s = getenv ("machid"); //(3)
if (s) {
machid = simple_strtoul (s, NULL, 16);
printf ("Using machid 0x%x from environmentn", machid);
}
show_boot_progress (15);
debug ("## Transferring control to Linux (at address %08lx) ...n",
(ulong) theKernel);
setup_start_tag (bd); //(4)
setup_memory_tags (bd);
setup_commandline_tag (bd, commandline); //(5)
if (images- >rd_start && images- >rd_end)
setup_initrd_tag (bd, images- >rd_start, images- >rd_end);
setup_eth_use_mdio_tag(bd, getenv("use_mdio"));
setup_eth_mdiointf_tag(bd, getenv("mdio_intf"));
setup_ethaddr_tag(bd, getenv("ethaddr"));
setup_end_tag (bd); //(6)
/* we assume that the kernel is in place */
printf ("nStarting kernel ...nn");
#ifdef CONFIG_USB_DEVICE
{
extern void udc_disconnect (void);
udc_disconnect ();
}
#endif
cleanup_before_linux (); //(7)
theKernel (0, machid, bd- >bi_boot_params); //(8)
/* does not return */
return 1;
}
全部0条评论
快来发表一下你的评论吧 !