一般情况bootm命令对应do_bootm函数。如果在do前加下划线_do_xxx表示为内部调用函数 (1)命令名前加do_即可构成这个命令对应的函数,因此当我们bootm命令执行时,uboot实际执行的函数叫do_bootm函数,在cmd_bootm.c。 (2)do_bootm刚开始定义了一些变量,然后用宏来条件编译执行了secureboot的一些代码(主要进行签名认证...
1#ifdefined(CONFIG_ZIMAGE_BOOT)2after_header_check:3os = hdr->ih_os;4#endif56switch(os) {7default:/*handled by (original) Linux case*/8caseIH_OS_LINUX:9#ifdef CONFIG_SILENT_CONSOLE10fixup_silent_linux();11#endif12do_bootm_linux (cmdtp, flag, argc, argv, &images);13break;1415ca...
在uboot引导Linux启动时,使用的是bootm的命令。这个命令执行的函数就是do_bootm, 这个函数的地址在cmd/bootm.c中。 代码如下:int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifdef CONFIG_NEEDS_MANUAL_RELOC static int relocated = 0; if (!relocated) { int i; ...
U-boot (Unified Bootloader)是一种流行的开源引导加载程序,主要用于嵌入式系统的引导启动。在开发嵌入式系统时,通常需要将Linux内核加载到内存中,并启动Linux操作系统。在U-boot中,有一个非常重要的命令是“do_bootm_linux”,它用于加载并启动Linux内核。 在U-boot中,执行“do_bootm_linux”命令会先从存储器中加...
一:do_bootm函数 (1)内核启动的时候通过bootm 30008000来启动内核,bootm这个命令对应的函数就是do_bootm。 (2) #defineLINUX_ZIMAGE_MAGIC0x016f2818 1. LINUX_ZIMAGE_MAGIC是一个魔数,其值等于0x016f2818。在zImage的头信息中,有特定的位存放了一个魔数,这个魔数就是用来表示该镜像是zImage,在启动过程中...
一:do_bootm函数 (1)内核启动的时候通过bootm 30008000来启动内核,bootm这个命令对应的函数就是do_bootm。 (2) 1 #define LINUX_ZIMAGE_MAGIC 0x016f2818 LINUX_ZIMAGE_MAGIC是一个魔数,其值等于0x016f2818。在zImage的头信息中,有特定的位存放了一个魔数,这个魔数就是用来表示该镜像是zImage,在启动过程中...
Do_bootm_linux首先驱动内核的入口地址,代码如下所示。 theKernel=(void (*)(int, int, uint))images->ep; Images.ep为内核可执行映像文件的入口地址及zImage的起始地址,它是从内核映像文件头获取的,在前面的bootm_start函数中已经为它赋值,代码如下所示。
传参在do_bootm_linux函数中。 1.tag方式传参 struct tag,tag是一个数据结构,在uboot和linux kernel中都有定义tag数据结构,而且定义一致。 struct tag定义在include/asm-arm/setup.h中 里面有两个参数。一个是tag_header结构体(include/asm-arm/setup.h中),一个是tag多种类型属性的联合体。
do_bootm_states函数首先调用bootm_start,如下,因为函数调用比较多,所以将函数说明写在注释中: common/bootm.c¶ 1 2 3 4 5 6 7 8 9 10 11 12 static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { memset((void *)&images, 0, si...
代码执行。 do_bootm_linux中: void (*theKernel)(int zero, int arch, uintparams); …… theKernel = (void (*)(int, int, uint))images->ep; …… theKernel (0, machid, bd->bi_boot_params); int do_bootm_linux(intflag, int argc, char * const argv[], bootm_headers_t *...