Best linux distro that runs on spike or qemu or riscvemu?

319 views
Skip to first unread message

Diego Nehab

unread,
Oct 9, 2018, 3:10:54 PM10/9/18
to RISC-V SW Dev
Hey all,

What are the wroking options for Linux distros currently run in spike or qemu or riscvemu? 

Kind regards,
Diego

Mark Corbin

unread,
Oct 9, 2018, 3:34:41 PM10/9/18
to Diego Nehab, RISC-V SW Dev
Hello Diego


On 09/10/18 20:10, Diego Nehab wrote:
Hey all,

What are the wroking options for Linux distros currently run in spike or qemu or riscvemu?

You can use Buildroot to build a Linux system for RISC-V 64-bit on qemu. See https://www.embecosm.com/2018/09/19/adding-risc-v-64-bit-support-to-buildroot/

The changes have been merged upstream, so you can clone the official Buildroot repository now (https://git.buildroot.net/buildroot) instead of the riscv-buildroot repo mentioned in the blog post.

Regards

Mark


Kind regards,
Diego
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAH2ULtH92UEfTAQdAbsSqGcStsq7mKsDF%2B6v%3DioFy9GUnTwDfQ%40mail.gmail.com.

--
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com

Jim Wilson

unread,
Oct 9, 2018, 4:09:07 PM10/9/18
to Diego Nehab, RISC-V SW Dev
On Tue, Oct 9, 2018 at 12:10 PM Diego Nehab <diego...@gmail.com> wrote:
> What are the wroking options for Linux distros currently run in spike or qemu or riscvemu?

I don't know anything about riscvemu. spike currently doesn't support
devices, so only simple things like a minimal buildroot will work
there. qemu should support any working distro. Fedora, Debian,
OpenSuse, FreeBSD, OpenEmbedded, Zephyr, etc are all working with
qemu.

I've only tried Fedora and Debian so far. Fedora is a little easier
to get started with as they provide a disk image. Debian requires a
little more work, but isn't too bad if you have worked with
debootstrap before.
https://fedoraproject.org/wiki/Architectures/RISC-V
https://wiki.debian.org/RISC-V

There is also on github.com the sifive/freedom-u-sdk repo that will
let you cross build a toolchain and a linux kernel with buildroot and
boot it on qemu, or on spike with a minor change to use the old serial
driver. This is an old non-upstream copy of buildroot. Long term the
official upstream copy from Embecosm is probably the better choice.
Since freedom-u-sdk contains some old software, it won't build on some
bleeding edge distros like arch. It is known to work on Ubuntu 16.04.
Otherwise, it is a fairly easy way to get started.

Jim

Michael Clark

unread,
Oct 9, 2018, 6:22:56 PM10/9/18
to Jim Wilson, Diego Nehab, RISC-V SW Dev
Hi,

You missed busybear-linux: https://github.com/michaeljclark/busybear-linux :-D

It has some recent updates. It now builds linus-4.somethink-rc-somethink along with latest bbl. I would like to add a static busybox and initramfs recipe for spike. It should work in riscvemu.

busybear needs riscv64-unknown-linux-gnu-gcc, etc from riscv-gnu-toolchain and riscv-qemu. I need to work on an initramfs automation for spike. I have a riscv32 config and an initramfs config that I use locally, just I haven’t yet tidied up the automation and pushed them.

busybear is a bit simpler for isolating bugs due to it having many less dependencies and shorter build, test cycles than buildroot. In fact, it was problems trying to get buildroot working that led to me creating it. It’s useful for placing test binaries in an image. I use it to run libc-tests against musl libc (oh, we don’t have Alpine Linux yet), or random test binaries like ‘stat’ on riscv32 Linux. The build/test cycle is a little shorter as there are fewer dependencies. We should also have a toybox/musl config using a musl GCC... that would be toybear-linux...

Michael
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.

Luke Kenneth Casson Leighton

unread,
Oct 9, 2018, 10:35:52 PM10/9/18
to Jim Wilson, diego...@gmail.com, RISC-V SW Dev
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

On Tue, Oct 9, 2018 at 9:09 PM Jim Wilson <ji...@sifive.com> wrote:

> There is also on github.com the sifive/freedom-u-sdk repo that will
> let you cross build a toolchain and a linux kernel with buildroot and
> boot it on qemu, or on spike with a minor change to use the old serial
> driver.

https://github.com/sifive/freedom-u-sdk/issues/68

Luke Kenneth Casson Leighton

unread,
Oct 9, 2018, 11:39:46 PM10/9/18
to Michael Clark, Jim Wilson, diego...@gmail.com, RISC-V SW Dev
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

On Tue, Oct 9, 2018 at 11:22 PM 'Michael Clark' via RISC-V SW Dev
<sw-...@groups.riscv.org> wrote:
>
> Hi,
>
> You missed busybear-linux: https://github.com/michaeljclark/busybear-linux :-D

nice.

> It has some recent updates. It now builds linus-4.somethink-rc-somethink
> along with latest bbl. I would like to add a static busybox and initramfs
> recipe for spike.

that would be great, michael: spike serves an important
stepping-stone for bootstrapping up custom extensions and for learning
purposes and educational exercises in a manageable fashion.

l.

Luke Kenneth Casson Leighton

unread,
Oct 10, 2018, 12:54:48 AM10/10/18
to Jim Wilson, diego...@gmail.com, RISC-V SW Dev
> On Tue, Oct 9, 2018 at 9:09 PM Jim Wilson <ji...@sifive.com> wrote:

> > There is also on github.com the sifive/freedom-u-sdk repo that will
> > let you cross build a toolchain and a linux kernel with buildroot and
> > boot it on qemu, or on spike with a minor change to use the old serial
> > driver.
>
> https://github.com/sifive/freedom-u-sdk/issues/68

however you will also need this:
https://github.com/sifive/freedom-u-sdk/issues/52#issuecomment-383264614

Luke Kenneth Casson Leighton

unread,
Oct 10, 2018, 1:04:17 AM10/10/18
to diego...@gmail.com, RISC-V SW Dev
> > > There is also on github.com the sifive/freedom-u-sdk repo that will
> > > let you cross build a toolchain and a linux kernel with buildroot and
> > > boot it on qemu, or on spike with a minor change to use the old serial
> > > driver.
> >
> > https://github.com/sifive/freedom-u-sdk/issues/68
>
> however you will also need this:
> https://github.com/sifive/freedom-u-sdk/issues/52#issuecomment-383264614

and this:
https://github.com/sifive/freedom-u-sdk/issues/52
($ cd buildroot; git checkout origin/sifive)

Andreas Schwab

unread,
Oct 10, 2018, 3:38:38 AM10/10/18
to Diego Nehab, RISC-V SW Dev
You can get up-to-date rootfs tarballs for openSUSE Tumbleweed from
<https://download.opensuse.org/ports/riscv/tumbleweed/images/>. They
are set up to use the Linux-user emulation of Qemu, so you can just
chroot into it.

Andreas.

--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Luke Kenneth Casson Leighton

unread,
Oct 10, 2018, 4:06:23 AM10/10/18
to diego...@gmail.com, RISC-V SW Dev
ok whew with those changes it's good, i can confirm successful "make
sim" booting to Linux version 4.15.0-00048-gfe92d7905c6e and
buildroot.

l.

Sathya Narayanan N

unread,
Oct 11, 2018, 5:40:47 AM10/11/18
to sw-...@groups.riscv.org
Hi Experts
I have  a query on spike for 32 bit. I am trying to run rtl simulation for 32 bit zephyr on spike.

I used the command "spike --isa=rv32imac -l zephyr/zephyr.elf"

Is this the commands to run ? Occasionally I am getting below error:

exception trap_load_access_fault, epc 0xffffffff80010a84
core   0:           tval 0x0000000040000000


regards,
sathya

Reply all
Reply to author
Forward
0 new messages