starfive-tech / VisionFive2

438 stars 78 forks source link

QEMU fails to boot #86

Open nylon7 opened 7 months ago

nylon7 commented 7 months ago

I use this branch(JH7110_VisionFive2_6.1.y_devel) for experiments, and there will be problems when using QEMU to boot.

# make qemu
...
/home/nylon.chen/WorkSpace/VisionFive2/work/riscv-qemu/prefix/bin/qemu-system-riscv64 -nographic -machine virt -bios /home/nylon.chen/WorkSpace/VisionFive2/work/opensbi/platform/generic/firmware/fw_payload.bin -kernel /home/nylon.chen/WorkSpace/VisionFive2/work/linux/vmlinux -initrd /home/nylon.chen/WorkSpace/VisionFive2/work/initramfs.cpio \
        -netdev user,id=net0 -device virtio-net-device,netdev=net0
qemu-system-riscv64: could not load ramdisk '/home/nylon.chen/WorkSpace/VisionFive2/work/initramfs.cpio'
make: *** [Makefile:388: qemu] Error 1

Through GDB inspection, it was found that it was a ram space problem.

I used -m to increase memory to solve this problem, but still encountered other problems.

/home/nylon.chen/WorkSpace/VisionFive2/work/riscv-qemu/prefix/bin/qemu-system-riscv64 -nographic -machine virt -m 1G -bios /home/nylon.chen/WorkSpace/VisionFive2/work/opensbi/platform/generic/firmware/fw_payload.bin -kernel /home/nylon.chen/WorkSpace/VisionFive2/work/linux/vmlinux -initrd /home/nylon.chen/WorkSpace/VisionFive2/work/initramfs.cpio \
        -netdev user,id=net0 -device virtio-net-device,netdev=net0
qemu-system-riscv64: Some ROM regions are overlapping
These ROM regions might have been loaded by direct user request or by default.
They could be BIOS/firmware images, a guest kernel, initrd or some other file loaded into guest memory.
Check whether you intended to load all this guest code, and whether it has been built to load to the correct addresses.

The following two regions overlap (in the memory address space):
  /home/nylon.chen/WorkSpace/VisionFive2/work/linux/vmlinux ELF program header segment 0 (addresses 0x0000000000000000 - 0x0000000000acc29a)
  mrom.reset (addresses 0x0000000000001000 - 0x0000000000001028)
make: *** [Makefile:388: qemu] Error 1

There is an issue of region overlap. Is it a steps problem? If not I can continue tracking or have other suggestions?