qemu-system-riscv64 源码编译 及 运行参数

编译

qemu

// 配置
qemu-6.1.0$./configure --target-list=riscv32-softmmu,riscv64-softmmu --prefix=/home/pop/work/qemu/qemu-out   2>&1 | tee log_configure.txt
// 编译
make 2>&1 | tee log_build.txt
// 安装
make install 2>&1 | tee log_install.txt
// 测试

pop@ubuntu:~$ qemu-system-riscv32 -machine help
Supported machines are:
none                 empty machine
opentitan            RISC-V Board compatible with OpenTitan
sifive_e             RISC-V Board compatible with SiFive E SDK
sifive_u             RISC-V Board compatible with SiFive U SDK
spike                RISC-V Spike board (default)
virt                 RISC-V VirtIO board
pop@ubuntu:~$ qemu-system-riscv64 -machine help  
Supported machines are:
microchip-icicle-kit Microchip PolarFire SoC Icicle Kit
none                 empty machine
shakti_c             RISC-V Board compatible with Shakti SDK
sifive_e             RISC-V Board compatible with SiFive E SDK
sifive_u             RISC-V Board compatible with SiFive U SDK
spike                RISC-V Spike board (default)
virt                 RISC-V VirtIO board

使用中的问题

在mode切换时会有问题
请查看 https://blog.csdn.net/u011011827/article/details/124197544

运行参数

qemu-system-riscv64 的选项
	镜像相关 // https://qemu.readthedocs.io/en/latest/system/target-riscv.html
		-bios none
			不运行  bios(bin/../share/qemu/opensbi-riscv64-generic-fw_dynamic.bin)
			QEMU will not automatically load any firmware.
			It is up to the user to load all the images they need. // 怎么加载?应该不是通过 -kernel 加载了
		-bios xxx
		 	以 xxx 为 bios,加载 bios , 加载完bios 就完了
		 	xxx 必须为 二进制文件
		 	Tells QEMU to load the specified file as the firmware.
	 	
		没有 -bios
			-kernel xxx
		 	运行 bios (bin/../share/qemu/opensbi-riscv64-generic-fw_dynamic.bin), bios ,加载 xxx

	界面相关
		-nographic
			直接命令行显示
	虚拟开发板相关
		-machine xxx
		-M xxx
			以 xxx 为开发板
	虚拟cpu相关
		-smp 4
			4核心soc

你可能感兴趣的:(riscv,riscv,qemu)