Ubuntu 20.04/21.04 64-bit RISC-V released for QEMU, HiFive boards

Let’s a lot of excitement around RISC-V open architecture, but a lot of work still needs to be done to bring the ecosystem to level with Arm or x86 architecture from the silicon to the software. Progress is made step-by-step and one of these steps is Canonical released Ubuntu 64-bit RISC-V (RISCV64) images for some of SiFive HiFive boards, as well as QEMU open-source emulator.

Specifically, Canonical released an Ubuntu 20.04.2 LTS image for HiFive Unleashed & QEMU, and an Ubuntu 21.04 image for HiFive Unleashed, HiFive Unmatched, and QEMU. Note those are only server images, and there’s no desktop image yet like for Ubuntu 21.04 on Raspberry Pi 2/3/4.

Ubuntu RISC-V HiFive QEMUIt’s been possible to run RISC-V Linux in QEMU for at least three years, but when I tried it was a minimal system based on Busybox, so let’s try again with Ubuntu 21.04 following the instructions provided on Discourse.

I have an AMD Ryzen laptop running Ubuntu 20.04, and I opened a terminal window to first install the dependencies.

then downloaded and extracted Ubuntu 21.04 image for HiFive Unmatched:

We can now Ubuntu 21.04 RISCV64 in your machine:

But it abruptly stops:

That’s because the Ubuntu 21.04 Hirsute cannot boot with the version of u-boot-qemu provided in Ubuntu 20.04 at this time, only the version in Ubuntu 21.04 is supported. So let’s try the Ubuntu 20.04 RISC-V image instead:

Good! After a few minutes, we can access the command line using “ubuntu” username and password:

We are indeed in a dual-core 64-bit RISC-V system as I used “smp 2” option in the command line:

We have Ethernet up and running properly:

So I could SSH to my host computer, but I could not SSH to the QEMU session. So I shut down the Ubuntu RISC-V instance, added a tcp redirect to enable SSH on port 2222, and restarted QEMU.

I could login to QEMU over SSH as follows:

So it’s possible to easily transfer files between QEMU and the host in either direction.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

13 Replies to “Ubuntu 20.04/21.04 64-bit RISC-V released for QEMU, HiFive boards”

  1. HiFive Unleashed $999
    HiFive Unmatched $679

    … my hope is on affordable RISC-V mobo’s … around 150 USD … as for that money you can get a quite nice Celeron board ^H^^H^H^H barebone system.

    1. Sadly still way too experimental to get good discounts on large orders. Allwinner D1 might reach that, but it’s still quite expensive for price/perf, and will take a while to mature.

      1. There is the Beagleboard too par around 100€, but this is developer/integrators oriented, no GPU for now. The next version should have a GPU. Everything progress very fast in RISC-V world, on embedded world most (if not all) OS are ported several major linux distribution are ported, I’m pretty sure we will see basic and affordable complete RISC-V boards at the end of this year or beginning of next year. Don’t expect the same perfs with the same price, it will still be for people that want to help this architecture to progress faster. More I know it, more I love it :). This is like a R²ISC instruction set.I mean number of instruction are really more reduced than on other RISC ISA and a very smart way. This allow to shrink again transistors/size/power needed and will allow to have for the same price/size/energy more power. The modularity of instruction set will allow to be really customised, for each tasks and is another step this way.

      1. If the Intel/SiFive collaboration comes to fruition, we might see motherboards that support either a Celeron or a Risc-V using a common socket.

  2. Mad idea :

    Retro Console system emulation and gaming has come along way on Arm SBC and Arm TV boxes. Can you emulate a powerful RISC-V system on a Arm SBC, Arm TV box?

    1. It might be feasible as long the QEMU programs needed are available on Arm, and the host system has enough memory. Arm SBC’s and TV box are rather low-end. Ubuntu RISC-V takes about 5 minutes to boot in my AMD RYzen 7 2700U laptop with 16GB RAM. So provided it indeed can work on Arm SBC or TV box, I’d expect boot times to be much longer.

      Also note that I had to type slower in QEMU, or some key presses will be missed…

      1. ISO is generally slow to boot, try to install it on a raw format disk image, I used about the same settings with Debian Bullseye on a 2012 Core i7, with 8GB of ram, and giving 512M~1.5G to VM and 1 or 2 core and boot in less that 1 minute (on ArchLinux with qemu-6.0.0). The debian image is in qcow2 (10× slower) format but can be converted easily with qemu-img. I will try ubuntu, as packages are generally more recent, thanks for the information. i’ve only a very slow ARM board, with very old/slow SD card (I will try to change it to a recent one) to test it (already very slow at compiling in native mode), but I can try it too. (perhaps making image on x86, and copy it on ARM board).

        I still didn’t managed to boot in graphic mode with RISC-V with Qemu, should be easier with TinyEMU (RISC-V emulator by the same author than Qemu/ffmpeg, Fabrice Bellard), but need to strip some part of kernel/boot file. I already booted a barebox (OS) with a modified version of tinyEMU supporting framebuffer via SDL. I was able to compile everything I want on the Debian/Qemu, there is a 95%+coverage of packages. Some 5% could be only binary ones or packages needed test/implementation for RISC-V specific optimisations.

      2. > Also note that I had to type slower in QEMU, or some key presses will be missed…

        This is probably not related to emulation speed then, but to support for the virtualized hardware. E.g. some drivers might possibly not implement interrupts correctly and might miss some events, or rely on polling. The number of CPU cycles needed to echo keystrokes is ridiculously low. Just remember that an ESP8266 can easily emulate a PDP11 running BSD 🙂

    1. I went to check again on discourse and the username and password are ubuntu.

      1. Got it working via SSH. Strangely, after the mandatory password change, logging in via the serial tty started functioning.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC