I have built linux on qemu-system-riscv and for some reason I can't use uboot as bootloader, I have to use openSBI DYNAMIC but when I run it I get SBI and kernel overlaps. Here's how it works
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)
Here's the command
# 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 \
"
I want to be able to move the kernel to the address 0x80200000, but all the methods I've checked are with uboot or SBI's JUMP firmware (which specifies the address at compile time), but I'd rather know if there is a way to specify the starting address of kenerl with the DYANMIC firmware, or some other easier way?
You can add "CONFIG_RISCV_SMODE=y" in u-boot config and build uboot again. Or you can use qemu-riscv64_smode_defconfig in u-boot tree.