riscvarchive / risc-v-getting-started-guide

The official RISC-V getting started guide
https://risc-v-getting-started-guide.readthedocs.io/en/latest/
Creative Commons Attribution 4.0 International
198 stars 56 forks source link

Update qemu version to latest 3.x #11

Closed Julian-Wollersberger closed 4 years ago

Julian-Wollersberger commented 4 years ago

I had big issues getting networking to work with qemu. In the end it worked after recompiling qemu with git checkout -f v3.1.1. I also tested the versions v4.1.0 and v4.0.0, but those didn't compile with the riscv64-softmmu target.

Furthermore, I found that Fedora distributes pre-built disk images, which are way easier to use than compiling Linux yourself. Should this tutorial be updated?

#QEMU still needs to be built from source though.

wget https://fedorapeople.org/groups/risc-v/disk-images/stage4-disk.img.xz
wget https://fedorapeople.org/groups/risc-v/disk-images/bbl
wget https://fedorapeople.org/groups/risc-v/disk-images/vmlinux
xz -d -k stage4-disk.img.xz 

qemu-system-riscv64 -nographic -machine virt \
    -m 2G -smp 4 \
    -kernel bbl \
    -object rng-random,filename=/dev/urandom,id=rng0 \
    -device virtio-rng-device,rng=rng0 \
    -append "console=ttyS0 ro root=/dev/vda" \
    -device virtio-blk-device,drive=hd0 \
    -drive file=stage4-disk.img,format=raw,id=hd0 \
    -device virtio-net-device,netdev=usernet \
    -netdev user,id=usernet,hostfwd=tcp::10000-:22
Julian-Wollersberger commented 4 years ago

After some digging I found newer versions and a longer installation instruction: https://fedoraproject.org/wiki/Architectures/RISC-V/Installing https://dl.fedoraproject.org/pub/alt/risc-v/disk-images/fedora/

(I'm posting this for completenes)

mgielda commented 4 years ago

Thanks! Sorry for missing this. I ultimately included Alistair's PR which renders this obsolete. Appreciate your feedback though, hopefully the new instructions work for your use case.

Julian-Wollersberger commented 4 years ago

Well, I've stoped playing around with RISC-V, so I won't test it, sorry. Thanks for responding though.