wget https://download.qemu.org/qemu-5.0.0.tar.xz
tar xvJf qemu-5.0.0.tar.xz
2 编译
cd qemu-5.0.0
./configure --target-list=riscv64-softmmu,riscv64-linux-user --prefix=~/riscv64-qemu
make -j $(nproc)makeinstallexportPATH="$PATH:~/riscv64-qemu/bin"
3 查看配置
root@3632224b9764:/home# 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
4参数配置项
4.1 内存大小(-m)
root@3632224b9764:/home# qemu-system-riscv64 -m help
qemu-system-riscv64: -m help: Parameter 'size' expects a non-negative number below 2^64
Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
and exabytes, respectively.
4.2 核心数(-smp)
root@3632224b9764:/home# qemu-system-riscv64 -smp help
smp-opts options:
cores=<num>cpus=<num>dies=<num>maxcpus=<num>sockets=<num>threads=<num>