mini2440_init: Boot mode: NAND
mini2440_init: NAND size/id 138412032 (128MB) defaulting to old 64MB
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded default u-boot from NAND
qemu: fatal: Trying to execute code outside RAM or ROM at 0x34000000R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00000000 R15=34000000
PSR=400001d3 -Z-- A svc32
Aborted (core dumped)
为什么将编译好的 u-boot.bin 拷贝到 qemu/mini2440 的文件夹中去?
将编译好的 u-boot.bin 拷贝到 qemu/mini2440 的文件夹中去, 否则以后执行mini2440/mini2440_start.sh就会遇到一下错误
linux@linux:~/Buildroot/mini2440-HEAD-18b91f2/mini2440$ cp ../../flashtools/flashimg/u-boot.bin ./
原因:阅读这该死的源码,你就知道了!!!源码加载的是这里的 mini2440/u-boot.bin,没有这个,不crash你,crash 谁!
{ image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000)); if (image_size < 0) image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000)); if (image_size > 0) { if (image_size & (512 -1)) /* round size to a NAND block size */ image_size = (image_size + 512) & ~(512-1); mini2440_printf("loaded override u-boot (size %x)\n", image_size); s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated */ } }
static void mini2440_reset(void *opaque) { struct mini2440_board_s *s = (struct mini2440_board_s *) opaque; int32_t image_size; s->cpu->env->regs[15] = 0; if (s->boot_mode == BOOT_NAND) { /* * Normally we would load 4 KB of nand to SRAM and jump there, but * it is not working perfectly as expected, so we cheat and load * it from nand directly relocated to 0x33f80000 and jump there */ if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) { mini2440_printf("loaded default u-boot from NAND\n"); s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated */ } #if 0 && defined(LATER) if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0) { s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address, u-boot relocating code */ mini2440_printf("4KB SteppingStone loaded from NAND\n"); } #endif /* * if a u--boot is available as a file, we always use it */ { image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000)); if (image_size < 0) image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000)); if (image_size > 0) { if (image_size & (512 -1)) /* round size to a NAND block size */ image_size = (image_size + 512) & ~(512-1); mini2440_printf("loaded override u-boot (size %x)\n", image_size); s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated */ } } } /* * if a kernel was explicitly specified, we load it too */ if (s->kernel) { image_size = load_image(s->kernel, qemu_get_ram_ptr(0x02000000)); if (image_size > 0) { if (image_size & (512 -1)) /* round size to a NAND block size */ image_size = (image_size + 512) & ~(512-1); mini2440_printf("lee loaded %s (size %x)\n", s->kernel, image_size); } } mini2440_printf("\n\n**welcome to uboot's world,start your Fuck codes**\n\n"); }