任务一:Qemu 开发环境搭建
- Qemu GitHub 网址:https://github.com/qemu/qemu
- Qemu 使用手册:https://www.qemu.org/docs/master/system/index.html
-
安装 qemu:
git clone https://git.qemu.org/git/qemu.git --depth 1
-
安装依赖:
sudo apt install ninja-build sudo apt install build-essential sudo apt install pkg-config sudo apt-get install libglib2.0-dev sudo apt-get install libpixman-1-dev
-
将 Qemu 目录下 build 目录加入进
PATH
环境变量export PATH=(your path/qemu/build):$PATH
-
设置 Qemu 编译生成的目标为 RISC-V,AArch64,X86
./configure --target-list=aarch64-softmmu
- 如果需要配置多个目标,可在 target-list=后面添加,并以逗号分隔,例如:
./configure --target-list=aarch64-softmmu,riscv64-softmmu,x86_64-softmmu
-
其他可生成的目标:
set target list (default: build all) Available targets: aarch64-softmmu alpha-softmmu arm-softmmu avr-softmmu cris-softmmu hppa-softmmu loongarch64-softmmu m68k-softmmu microblaze-softmmu microblazeel-softmmu mips-softmmu mips64-softmmu mips64el-softmmu mipsel-softmmu nios2-softmmu or1k-softmmu ppc-softmmu ppc64-softmmu riscv32-softmmu riscv64-softmmu rx-softmmu s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu sparc64-softmmu tricore-softmmu x86_64-softmmu xtensa-softmmu xtensaeb-softmmu
-
编译
make
- Qemu for RISC-V
- Qemu for AArch64
- Qemu for X86