kamanphoebe
kamanphoebe

Reputation: 56

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

I'm trying to set up xv6 on Ubuntu 18.04.5 but there is an error during 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

I found that there is no qemu-system-riscv64 under /usr/bin after installing qemu-system-misc(version 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

I've tried to install an older version of qemu-system-misc which is mentioned in Tools Used in 6.S081

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

yet this version was not found.

Any solution for installing either qemu-system-riscv64 or an older version of qemu-system-misc?

Upvotes: 2

Views: 4484

Answers (4)

jfq
jfq

Reputation: 1

Make qemu get stucked: https://github.com/mit-pdos/xv6-riscv/issues/262 please run this command qemu-system-riscv64 -version first and make sure your version >= 7.2 see here: https://github.com/mit-pdos/xv6-riscv/commit/92e60dd8335b49e426760dbcbf1ef54c601f098e 运行正常的版本: my running version: Ubuntu version: ubuntu-22.04.4-desktop-amd64 Qemu version: 7.2

Upvotes: 0

zhyantao
zhyantao

Reputation: 1

Just change the mirror source works for me:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
cat <<EOF | sudo tee /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
EOF

Upvotes: 0

rovast
rovast

Reputation: 141

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

You can compile 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 ..

Upvotes: 3

kamanphoebe
kamanphoebe

Reputation: 56

Everything went right after I upgraded Ubuntu to version 20.04.2 :)

Upvotes: 0

Related Questions