3

I've used buildroot to build a qemu compatible Linux kernel and root filesystem. I am emulating for the MPC8544DS machine and used the qemu_ppc_mpc8544ds_defconfig to generate these components. I was able to successfully build the kernel and the root filesystem. And was able to run it under qemu.

However when I tried to run uboot instead of the Linux Kernel (and the associated rootfs) it fails. Here is the way I invoke qemu to boot u-boot:

qemu-system-ppc -nographic -M mpc8544ds -m 512 -kernel ~/CrossCompilation/u-boot.bin and it fails like so:

Wrong image type 52, expected 2 qemu: could not load kernel '~/CrossCompilation/u-boot.bin'

I do not understand what else could be wrong. I've checked various blog posts over the internet and almost all of them use uboot.bin as the kernel (as opposed to srec and other formats)

could someone shed some light on the various image type numbers and which ones fit where?

UPDATE: This is how I compiled my u-boot

cd to u-boot dir

make distclean
make mrproper

make ARCH=powerpc CROSS_COMPILE=~/CrossCompilation/buildroot-2014.08/output/host/usr/bin/powerpc-buildroot-linux-gnuspe- MPC8544DS_defconfig

make ARCH=powerpc CROSS_COMPILE=~/CrossCompilation/buildroot-2014.08/output/host/usr/bin/powerpc-buildroot-linux-gnuspe-
AjB
  • 890
  • 13
  • 34
  • Upon doing a little research and some help, I was able to hex dump the binary. The image has the following as it's header `00000000 27 05 19 56 55 2d 42 6f 6f 74 20 32 30 31 34 2e |’..VU-Boot 2014.` Apparently, it should NOT have `0x27051956` as it's header. I am not sure why it got that as it's header. Do I need to explicitly repackage it before booting it with QEMU? – AjB Nov 06 '14 at 06:44
  • I've looked into the portion of code in qemu which is throwing that error. Upon investigating realised the valid image types are from 0 through to 8. I fail to get why is my binary being packaged here has 52 as its header type. Has it got something to do with the cross compiler used? – AjB Nov 06 '14 at 09:45
  • How you compiled u-boot ..? mention the steps what you tried? – vinay hunachyal Nov 07 '14 at 10:19
  • added compilation steps as an update as requested – AjB Nov 09 '14 at 04:49
  • From http://wiki.qemu.org/download/qemu-doc.html. The "kernel" option requires a bzImage (binary compressed) or a multiboot binary file. The nomenclature used is quite confusing. u-boot.bin is not a bzImage. This bin file is a just a binary image of u-boot, as it will be copied to non-volatile/flash memory. It has no headers that other tools can understand. mkimage is a tool that wraps this raw binary to a uImage binary, but I do not know if qemu understands that. – sessyargc.jp Nov 10 '14 at 22:54
  • I do not get it. I have never seen a guide anywhere on the internet where in it was required to manually run mkimage on uboot.bin. But I am all ears in case you think that could help me. – AjB Nov 13 '14 at 04:12

1 Answers1

0

Try removing the -kernel option. Make sure everything stay as is:

qemu-system-ppc -nographic -M mpc8544ds -m 512  ~/CrossCompilation/u-boot.bin
Itzik Chaimov
  • 89
  • 1
  • 10