4

I'm trying to run orange-pi emulation with self-build linux kernel by this commands:

ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make mrproper
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make sunxi_defconfig

ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make

and system generated with buildroot using default orangepi_zero_defconfig. Trying to run emulation by this command:

qemu-system-arm -M orangepi-pc -nic user -nographic \
-kernel linux/arch/arm/boot/zImage \
-append 'root=/dev/mmcblk0 panic=1 rootfstype=ext4 rw' \
-dtb linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb \
-drive file=sdcard.img,format=raw,if=sd \
-no-reboot

In boot logs i see this:

[    5.337453] List of all partitions: 
[    5.338217] b300         2097152 mmcblk0  
[    5.347713]  driver: mmcblk 
[    5.347884]   b301           61440 mmcblk0p1 4d1f495b-d662-4b1d-818a-591ebed99bac 
[    5.348161]  
[    5.348330] No filesystem could mount root, tried:  
[    5.349117]  ext4 
[    5.349219]   
[    5.349738] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,0) 

Full log on Google Drive.

zImage

dtb file

Emulation stops with reboot message.

Hid-K
  • 71
  • 6

1 Answers1

3

I've fixed this problem.

  • Fix the system image
    fdisk sdcard.img
    >w

  • Fix kernel arguments in qemu command:

qemu-system-arm -M orangepi-pc -nic user -nographic \
-kernel linux/arch/arm/boot/zImage \
-append 'bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait' \
-dtb linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb \
-drive file=sdcard.img,format=raw,if=sd \
-no-reboot
Hid-K
  • 71
  • 6
  • Just so you know - it's perfectly allowable to accept your own answer by clicking on the check underneath the up-and-down voting arrows. Doing so gains you 15 reputation points. And it's a good answer, so I recommend that you accept it. :-) – Bob Jarvis - Слава Україні Jun 12 '22 at 22:07