Score
0
1 Unstar Star 1 Fork 1

Gitee 极速下载 / OpenSBIC

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/riscv/opensbi
RISC-V Supervisor二进制接口(SBI)是以下之间的推荐接口: 在M模式下运行的特定于平台的固件,以S模式或HS模式执行的引导加载程序,管理程序或通用OS spread retract

https://www.oschina.net/p/opensbi

Clone or download
qemu_virt.md 3.61 KB
Copy Edit Web IDE Raw Blame History

QEMU RISC-V Virt Machine Platform

The QEMU RISC-V Virt Machine is a virtual platform created for RISC-V software development and testing. It is also referred to as QEMU RISC-V VirtIO machine because it uses VirtIO devices for network, storage, and other types of IO.

To build the platform-specific library and firmware images, provide the PLATFORM=generic parameter to the top level make command.

Platform Options

The QEMU RISC-V Virt Machine platform does not have any platform-specific options.

Execution on QEMU RISC-V 64-bit

No Payload Case

Build:

make PLATFORM=generic

Run:

qemu-system-riscv64 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_payload.bin

U-Boot Payload

Note: the command line examples here assume that U-Boot was compiled using the qemu-riscv64_smode_defconfig configuration.

Build:

make PLATFORM=generic FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin

Run:

qemu-system-riscv64 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_payload.elf

or

qemu-system-riscv64 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_jump.bin \
	-kernel <uboot_build_directory>/u-boot.bin

Linux Kernel Payload

Note: We assume that the Linux kernel is compiled using arch/riscv/configs/defconfig.

Build:

make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image

Run:

qemu-system-riscv64 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_payload.elf \
	-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
	-device virtio-blk-device,drive=hd0 \
	-append "root=/dev/vda rw console=ttyS0"

or

qemu-system-riscv64 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_jump.bin \
	-kernel <linux_build_directory>/arch/riscv/boot/Image \
	-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
	-device virtio-blk-device,drive=hd0 \
	-append "root=/dev/vda rw console=ttyS0"

Execution on QEMU RISC-V 32-bit

No Payload Case

Build:

make PLATFORM=generic PLATFORM_RISCV_XLEN=32

Run:

qemu-system-riscv32 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_payload.bin

U-Boot Payload

Note: the command line examples here assume that U-Boot was compiled using the qemu-riscv32_smode_defconfig configuration.

Build:

make PLATFORM=generic PLATFORM_RISCV_XLEN=32 FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin

Run:

qemu-system-riscv32 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_payload.elf

or

qemu-system-riscv32 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_jump.bin \
	-kernel <uboot_build_directory>/u-boot.bin

Linux Kernel Payload

Note: We assume that the Linux kernel is compiled using arch/riscv/configs/rv32_defconfig.

Build:

make PLATFORM=generic PLATFORM_RISCV_XLEN=32 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image

Run:

qemu-system-riscv32 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_payload.elf \
	-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
	-device virtio-blk-device,drive=hd0 \
	-append "root=/dev/vda rw console=ttyS0"

or

qemu-system-riscv32 -M virt -m 256M -nographic \
	-bios build/platform/generic/firmware/fw_jump.bin \
	-kernel <linux_build_directory>/arch/riscv/boot/Image \
	-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
	-device virtio-blk-device,drive=hd0 \
	-append "root=/dev/vda rw console=ttyS0"

Comment ( 0 )

Sign in for post a comment

C
1
https://gitee.com/mirrors/OpenSBI.git
git@gitee.com:mirrors/OpenSBI.git
mirrors
OpenSBI
OpenSBI
master

Search

132457 8cb2edc1 1899542 131848 70c8d3a4 1899542