如何修复"qemu-system-riscv64:一些ROM区域重叠.这些ROM区域可能是通过直接用户请求或默



我想在qemu-system-riscv64上为RISC-V运行一个Linux根文件系统。这里的要求是在main·oscomp/testsuits for oskernel·GitHub 上的oskernel/riscv-linux-rootfs的测试套件

然而,在我根据需要构建根文件系统后,我在运行时遇到了一个错误

sudo qemu-system-riscv64 -nographic -machine virt 
-kernel bbl -append "root=/dev/vda ro console=ttyS0" 
-drive file=riscv64-rootfs.bin,format=raw,id=hd0 
-device virtio-blk-device,drive=hd0 
-netdev type=tap,script=scripts/ifup.sh,downscript=scripts/ifdown.sh,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):
/usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.bin (addresses 0x0000000080000000 - 0x0000000080012630)
build/riscv-pk/bbl ELF program header segment 1 (addresses 0x0000000080000000 - 0x000000008000690d)
make: *** [Makefile:13: run] Error 1

我在Ubuntu 22.04的虚拟机上运行了这个项目,这个问题可能与在虚拟机上执行虚拟机有关吗?或者与Ubuntu版本有关?有什么建议吗?

问题是,您正试图在QEMU自动加载opensbi固件的同一地址加载文件"bbl"。要么你需要告诉QEMU不要加载固件,要么你需要链接你的"bbl"文件去其他地方。

最新更新