| 谢谢你的回复, 刚才我把kernel放在0x3000000的地方,但窜口也还是一点信息都没有, 我用make zImage做的内核zImage下载到nor flash, 在启动内核之前,我把mem_base+0x8000(0x30000000+0x8000)的数据打印出来如下: e1a00000 e1a00000 e1a00000 e1a00000 e1a00000 e1a00000 e1a00000 e1a00000 ea000002 016f2818 00000000 0016b184 e1a07001 e1a08002 e10f2000 e3120003 1a000001 e3a00017 ef123456 e10f2000 e38220c0 e121f002 00000000 00000000 e28f00d0 和zImage的内容相同,窜口我用的参数传入(这用的是tag 的方式"console=ttySAC0,115200n8", 用param_struct时用的是" "noinitrd console=ttySAC0"") 两者都不行,我用的是ADS 1.2 开发的,由于对汇编不熟,基本上是用vivi的汇编代码. 启动的代码如下:____________________________________________________ int boot_kernel(ulong from, size_t size, int media_type) { int ret; int i; ulong boot_mem_base; /* base address of bootable memory */ ulong to; ulong mach_type; void (*call_linux)(int zero, int arch, unsigned long params_addr) = (void (*)(int, int, unsigned long))(LINUX_KERNEL_BASE + LINUX_KERNEL_OFFSET); boot_mem_base = LINUX_KERNEL_BASE; /* copy kerne image */ to = boot_mem_base + LINUX_KERNEL_OFFSET; DBGMSG(DEBUG, ("Copy linux kernel from 0x%08lx to 0x%08lx, size = 0x%08lx ... ", from, to, size)); ret = copy_kernel_img(to, (char *)from, size, media_type); if (ret) { DBGMSG(DEBUG, ("failed\n")); return -1; } else { DBGMSG(DEBUG, ("done\n")); } if (*(ulong *)(to + 9*4) != LINUX_ZIMAGE_MAGIC) { DBGMSG(DEBUG, ("Warning: this binary is not compressed linux kernel image\n")); DBGMSG(DEBUG, ("zImage magic = 0x%08lx\n", *(ulong *)(to + 9*4))); } else { DBGMSG(DEBUG, ("zImage magic = 0x%08lx\n", *(ulong *)(to + 9*4))); } /* Setup linux parameters and linux command line */ setup_linux_param(boot_mem_base + LINUX_PARAM_OFFSET); /* Get machine type, see arch/arm/tools/mach-types */ mach_type = MACH_TYPE; DBGMSG(DEBUG, ("MACH_TYPE = %d\n", mach_type)); /* Go Go Go */ DBGMSG(DEBUG, ("NOW, Booting Linux......\n")); clean_before_call_linux(); DBGMSG(DEBUG, ("Maybe we can check some date!addr:0x%08lx \n", to)); for(i = 0; i < 100; ) { DBGMSG(DEBUG, ("%08lx ", *(ulong *)(to + i))); i = i + 4; if(i%16 == 0) { DBGMSG(DEBUG, ("\n")); } } call_linux(0, mach_type, (unsigned long)(boot_mem_base + LINUX_PARAM_OFFSET)); DBGMSG(DEBUG, ("If here, error!\n")); return 0; } ______________________________________________________ Blog作者的回复: 命令行传递参数加上mem=64M。我在使用uboot的时候发现,如果不加入mem,则2.6.22的内核引导后,串口没有任何输出。 | |
评论
发表评论