Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 23 Sep 2018 16:41:51 +1200
From: Michael Clark <michaeljclark@....com>
To: musl@...ts.openwall.com
Subject: Re: Porting to RISC-V


>>> Ping.
>>> 
>>> I was hoping to get this merged in 1.1.20, which didn't happen despite
>>> it getting delayed for a long time. Is there a chance of it happening
>>> soon for 1.1.21?
>> 
>> Yes. I can bump the priority for this.
>> 
>> There hopefully should not be that much more to do on the port to
>> get it in shape for upstream. Sorry there have been a lot of things
>> going on so this has fallen through the cracks.
>> 
>> There is still the ELF TLS bug, which shouldn’t be hard to fix, but
>> we could always mark the port experimental. If it’s in tree; then
>> more folk may be interested in fixing bugs. The code also needs some
>> review.
> 
> I don't want to merge something with known bugs like this, but I'm
> happy to participate in fixing it if I know what the issue is and have
> a candidate submission that supposedly works modulo the bug to be
> fixed. My understanding is that gcc and qemu stuff is upstream now so
> it should be simple to me to build and test. Is this correct?

Okay. We’ll fix the bugs. Yes, there are now several ways to get RISC-V Linux booting in QEMU.

There are riscv cross tools and riscv qemu binaries in Debian Sid.  I think it is possible to debootstrap riscv64. Indeed the Debian RISC-V builders are running QEMU.

I also have a bootstrap script for a musl riscv gcc 8.1 compiler here:

https://github.com/michaeljclark/musl-riscv-toolchain

You can build the gcc toolchain for comparison:

https://github.com/riscv/riscv-gnu-toolchain

There are links to several Linux images (Fedora, Debian) and build instructions for Linux kernel and bbl on the RISC-V QEMU wiki:

- https://github.com/riscv/riscv-qemu/wiki

Alternatively you can clone SiFive’s freedom-u-sdk and type “make qemu” to get a riscv64 buildroot image booting up in QEMU. This same root image and kernel runs on the HiFive Unleashed Board:

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

Also, Fabrice Belliard has a buildroot port that has recipes for both riscv32 and riscv64:

https://bellard.org/tinyemu/

Normally the kernel is packaged as a payload inside of “bbl”, the Berkeley Boot Loader. However, we now support separate kernel and firmware using the latest bbl, the RISC-V QEMU and “virt” machine in QEMU from the riscv-qemu repository (this feature is not upstream yet) and linux 4.19-rc5 kernel. This is mostly useful if you are recompiling the kernel. We have the -bios, -kernel, -initrd and -append options working:

https://github.com/riscv/riscv-qemu

e.g.

$ qemu-system-riscv64 -nographic -machine virt -bios bbl -kernel vmlinux -initrd initramfs.gz -append rdinit=/bin/busybox

The wiki link above and the freedom-u-sdk have docs and Makefile recipes for attaching VirtIO drives and networking devices.

>> We moved the port to riscv-musl in the RISC-V GitHub organisation
>> [1]. We need to rebase and squash the tree and write a commit
>> message containing the contributors list.
>> 
>> The RISC-V rv32 port isn’t in glibc yet and it may be subject to
>> change. I need to get a riscv32 Linux kernel running in QEMU so we
>> can do testing against glibc... I’ll have to chat to Palmer about
>> riscv32, see if there are any ABI issues we need to be aware of. We
>> can spend some time this week...
> 
> Great!

No worries. It’ll be nice to get the port upstream...

Cheers,
Michael
Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.