0

I am trying to build a linux image for raspberrypi3 with buildroot and run it on qemu. Once the make process is done i can copy the sdcard.img file into a SD card and correctly run the OS on a real raspberry pi device without any issue.

but when i try to use the same image file and try to run it on qemu the bootup fails.

1) qemu-system-aarch64 -M raspi3 -kernel zImage -dtb <generated dtb> -sd <generated .img> => qemu window opens but blank. nothing on the terminal as well.
2) qemu-system-arm -M raspi2 -kernel zImage -dtb <generated dtb> -sd <generated .img> => qemu window opens. raspberry image appears on top left corner. but in the teminal window there is a kernel panic. VFS mount failed
3) same as 1st step but with a freshly compiled qemu from source => same as 1st step. nothing on the qemu window or in the terminal.

am i doing something wrong?

2
  • Doesn't -dtb require the file name of your device tree blob?
    – Philippos
    Mar 29, 2022 at 8:51
  • @Philippos sorry I have forgotten to type that. I have edited the question with that added. So yeah when I ran the command I have attached the dtb file in the command. Mar 29, 2022 at 10:20

1 Answer 1

1

After few days of googling around a lot i found the answer to my issue. The Kernel image zImage I use in the terminal command which is built by the buildroot make process is not compatible with the QEMU. To solve that I had to compile my own QEMU compatible raspberry pi kernel.

I followed this link to compile my own kernel. raspberry pi cross-compile kernel then when I used QEMU to run a OS there was another kernel panic saying VFS mount failed. When I read the terminal outputs before that, it says not enough space on the media. So expanded the scared.img file to 1G and ran the same terminal command.

Now the QEMU is running perfectly

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .