linux-kernel – 如何在解压缩失败时找到ARM Linux入口点?
我试图通过U-boot在i.MX6的自定义板上启动
Linux(CPU内核是ARM Cortex A9)
我们似乎成功移植了Das U-Boot(2009.08).但是在最后的U-Boot消息中启动Linux失败:“启动内核……” 这是我的相关环境: bootargs=console=ttymxc1,115200 vmalloc=400M root=/dev/mmcblk0p1 rootwait consoleblank=0 earlyprintk video=mxcfb0:dev=lcd,LCD-ORTUS,if=RGB24 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24 calibration tsdev=tsc2004 fbmem=10M,28M bootcmd=ext2load mmc 0:1 10800000 /boot/uImage ; bootm 10800000 启动输出是 Loading file "/boot/uImage" from mmc device 0:1 (xxa1) 4043552 bytes read ## Booting kernel from Legacy Image at 10800000 ... Image Name: Linux-3.0.35 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4043488 Bytes = 3.9 MB Load Address: 10008000 Entry Point: 10008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... 当我objdump内核时,在地址80008000处,我看到了arch / arm / kernel / head.S的入口点,而不是arch / arm / boot / compressed / head.S. 我看到的是,内核甚至没有解压缩.我尝试添加一些寄存器操作代码来发送压缩/ head.S中的GPIO信号,但没有响应. 我的问题是,我怎样才能确保U-Boot正在调用正确的入口点? 完全相同的内核二进制文件使用相同的U-Boot命令在飞思卡尔的参考板上成功启动. 编辑:我在U-Boot中添加了一些痕迹.在调用内核之前,指针theKernel是10008000而不是10800000.这是否意味着U-boot在错误的位置跳转? 解决方法
有证据表明这是一个错误的假设.
您使用的是哪个版本的U-Boot? u-boot-2012.10$find . -print | xargs grep theKernel ./arch/avr32/lib/bootm.c: void (*theKernel)(int magic,void *tagtable); ./arch/avr32/lib/bootm.c: theKernel = (void *)images->ep; ./arch/avr32/lib/bootm.c: theKernel,params_start); ./arch/avr32/lib/bootm.c: theKernel(ATAG_MAGIC,params_start); ./arch/microblaze/lib/bootm.c: void (*theKernel) (char *,ulong,ulong); ./arch/microblaze/lib/bootm.c: theKernel = (void (*)(char *,ulong))images->ep; ./arch/microblaze/lib/bootm.c: (ulong) theKernel,rd_data_start,(ulong) of_flat_tree); ./arch/microblaze/lib/bootm.c: theKernel (commandline,(ulong) of_flat_tree); ./arch/mips/lib/bootm.c: void (*theKernel) (int,char **,int *); ./arch/mips/lib/bootm.c: theKernel = (void (*)(int,int *))images->ep; ./arch/mips/lib/bootm.c: (ulong) theKernel); ./arch/mips/lib/bootm.c: theKernel(linux_argc,linux_argv,linux_env,0); ./arch/mips/lib/bootm_qemu_mips.c: void (*theKernel) (int,int *); ./arch/mips/lib/bootm_qemu_mips.c: theKernel = (void (*)(int,int *))images->ep; ./arch/mips/lib/bootm_qemu_mips.c: (ulong) theKernel); ./arch/mips/lib/bootm_qemu_mips.c: theKernel(0,NULL,0); ./arch/nds32/lib/bootm.c: void (*theKernel)(int zero,int arch,uint params); ./arch/nds32/lib/bootm.c: theKernel = (void (*)(int,int,uint))images->ep; ./arch/nds32/lib/bootm.c: (ulong)theKernel); ./arch/nds32/lib/bootm.c: theKernel(0,machid,bd->bi_boot_params); u-boot-2012.10$ 请解释如何跟踪不应在ARM处理器上定义或分配的变量. U-Boot打印“Starting kernel …”后的下一个输出应该是“Uncompressing Linux …”. U-Boot的配置文件是什么样的?
您是否理智检查此代码以确保其按预期工作?
对于ARM arch,它是跳转到bootm命令中指定的地址.
00地址,因此应该是好的(假设U-Boot已正确配置并为ARM构建).
是. 更正: 正如OP指出的那样,旧版本的U-Boot确实使用了变量theKernel,甚至用于ARM拱门. U-Boot输出行: Loading Kernel Image ... OK 表示U-Boot已经(成功)将内核映像(没有映像信息头)从0x1
00的bootm地址(加上报头长度的偏移量0x40)复制到加载地址0x100
.此内存移动操作由common / cmd_bootm.c中的过程bootm_load_os()执行. 因此,您报告的0x100
的值对于内核是正确的. 如前所述,您应该验证是否正确定义了机器类型.该值将在arch/arm/plat-mxc/include/mach/uncompress.h中的__arch_decomp_setup()中使用,以便在内核引导之前的解压缩期间输出文本. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |