在包 qemu-system-misc 中找不到 qemu-system-riscv64

qemu-system-riscv64 is not found in package qemu-system-misc

我正在尝试在 Ubuntu 18.04.5 上设置 xv6,但在 make qemu 期间出现错误:

# outputs...
qemu-system-riscv64 -machine virt -bios none -kernel kernel/kernel -m 128M -smp 3 -nographic -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
make: qemu-system-riscv64: Command not found

安装qemu-system-misc后发现/usr/bin下没有qemu-system-riscv64(版本1:2.11+dfsg-1ubuntu7.36):

$ ls /usr/bin | grep qemu
qemu-img
qemu-io
qemu-nbd
qemu-system-alpha
qemu-system-cris
qemu-system-lm32
qemu-system-m68k
qemu-system-microblaze
qemu-system-microblazeel
qemu-system-moxie
qemu-system-nios2
qemu-system-or1k
qemu-system-sh4
qemu-system-sh4eb
qemu-system-tricore
qemu-system-unicore32
qemu-system-xtensa
qemu-system-xtensaeb

我尝试安装 Tools Used in 6.S081

中提到的旧版本 qemu-system-misc

At this moment in time, it seems that the package qemu-system-misc has received an update that breaks its compatibility with our kernel. If you run make qemu and the script appears to hang after

qemu-system-riscv64 -machine virt -bios none -kernel kernel/kernel -m 128M -smp 3 nographic -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk device,drive=x0,bus=virtio-mmio-bus.0

you'll need to uninstall that package and install an older version:

$ sudo apt-get remove qemu-system-misc
$ sudo apt-get install qemu-system-misc=1:4.2-3ubuntu6

还没有找到这个版本。

安装 qemu-system-riscv64 或旧版本 qemu-system-misc 的任何解决方案?

在我 upgraded Ubuntu 到版本 20.04.2 之后一切顺利:)

参考https://pdos.csail.mit.edu/6.828/2020/tools.html

可以编译qemu

$ wget https://download.qemu.org/qemu-5.1.0.tar.xz
$ tar xf qemu-5.1.0.tar.xz


$ cd qemu-5.1.0
$ ./configure --disable-kvm --disable-werror --prefix=/usr/local --target-list="riscv64-softmmu"
$ make
$ sudo make install
$ cd ..