我已经在qemu-system-riscv上构建了linux,由于某种原因我不能使用uboot作为引导加载程序,我必须使用openSBI DYNAMIC,但当我运行它时,我得到SBI和内核重叠。下面是它的工作原理
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/bin/../share/qemu/opensbi-riscv64-generic-fw_dynamic.bin (addresses 0x0000000080000000 - 0x000000008001c290)
build/riscv-pk/bbl ELF program header segment 1 (addresses 0x0000000080000000 - 0x0000000080006a6d)
下面是命令
# construct command
cmd="${QEMU_SYSTEM_BIN} -nographic -machine virt -m 128M
-kernel build/riscv-pk/bbl
-append "root=/dev/vda1 ro console=ttyS0"
-drive file=riscv64-rootfs.bin,format=raw,id=hd0
-device virtio-blk-device,drive=hd0
-netdev ${QEMU_NETDEV},id=net0
-device virtio-net-device,netdev=net0
"
我希望能够将内核移动到地址0x80200000,但是我检查过的所有方法都是使用uboot或SBI的JUMP固件(在编译时指定地址),但我宁愿知道是否有一种方法可以使用动态固件指定内核的起始地址,或者其他一些更简单的方法?
可以添加"CONFIG_RISCV_SMODE=y"在u-boot配置中重新构建uboot。或者您可以在u-boot树中使用qemu-riscv64_smode_defconfig。