报错:
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/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf ELF program header segment 1 (addresses 0x0000λλλλλλλλλλλο - 0x0000000000031bc8)
mrom.reset (addresses 0x0000000000001000 - 0x0000000000001028)
解决办法:
在启动qemu的时候删去bios参数
示例:
sudo qemu-system-riscv64 \
-machine 'virt' \
-cpu 'rv64' \
-m 1G \
-device virtio-blk-device,drive=hd \
-drive file=2024-exercises-virtual-machines/stage-1.qcow2,if=none,id=hd \
-virtfs local,id=lee,path=2025-exercises-stage-1,mount_tag=lee,security_model=passthrough \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
-object rng-random,filename=/dev/urandom,id=rng \
-device virtio-rng-device,rng=rng \
-nographic \
-append "root=LABEL=rootfs console=ttyS0"