Differences between revisions 1 and 13 (spanning 12 versions)
Revision 1 as of 2016-02-19 17:20:23
Size: 9250
Comment: Initial version, some related resources yet to be created
Revision 13 as of 2017-05-07 12:53:32
Size: 12651
Editor: ?KarstenMerker
Comment: Add "Hardware baseline and ABI choice" section
Deletions are marked like this. Additions are marked like this.
Line 19: Line 19:
In short, a '''''port''''' in Debian terminology means to provide the software normally available in the Debian archive (over 20,000 source packages) ready to install and run on systems based in a given computer architecture with the '''Linux''' kernel, or kernel-architecture combinations, with other kernels including '''Hurd''' and '''FreeBSD'''. In short, a '''''port''''' in Debian terminology means to provide the software normally available in the Debian archive (over 20,000 source packages) ready to install and run on systems based in a given computer architecture with the '''Linux''' kernel, or kernel-architecture combinations, with other kernels including '''GNU Mach''' (from GNU/Hurd) and '''kFreeBSD''' (from GNU/kFreeBSD).
Line 63: Line 63:
== Toolchain upstreaming status ==

 * binutils: upstreamed (2.28 is the first release with RISC-V support)
 * gcc: upstreamed (7.1 is the first release with RISC-V support)
 * glibc: not upstreamed yet
 * linux kernel: not upstreamed yet
 * gdb: not upstreamed yet
 * qemu: not upstreamed yet
Line 66: Line 74:
== Current Status == == Hardware baseline and ABI choice ==

The Debian port uses RV64GC as the hardware baseline and the lp64d ABI (the default ABI for RV64G systems).

Making the C extension a part of the default hardware baseline for general-purpose binary Linux distributions has been agreed upon between Fedora porters, Debian porters and members of the RISC-V foundation. According to the chairman of the board of the RISC-V foundation, the foundation will provide "a profile for standard RISC-V Unix platforms that will include C as mandatory".

== Status Log ==

 2017-05-02 ::

 :: Upstream GCC 7.1 has been [[https://gcc.gnu.org/ml/gcc/2017-05/msg00017.html|released]] with RISC-V support.

 2017-04-22::

 :: Unofficial repository published (WIP, incomplete and probably not working for you at the moment): http://riscv.mit.edu/

 :: More information about details and story in https://people.debian.org/~mafm/posts/2017/20170422_debian-gnulinux-port-for-risc-v-64-bit-riscv64/

 2017-03-04::

 :: Upstream binutils 2.28 have been released with RISC-V support on 2017-03-02.

 2017-02-06::

 :: The GCC support for RISC-V has been committed to the upstream GCC repository and will be part of the GCC 7 release. Commit list: [[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=fb55f581395180a5114f2f0ea991fccce6e93619|1]] [[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6afed82a1cc7e6cd6c5683fb673b596d26038885|2]] [[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=36387fade2cce4f8a3eaaa81484348a051c099fe|3]] [[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=71315f80663273794abb18b44b5edbf56a2676ee|4]] [[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9d1d9ee0759b749496e52c2c3e4967179ae202b9|5]] [[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b9325b843a03fe34b2181ea68e4e3e1d8d303805|6]]

 2017-01-18::

 :: The binutils support for RISC-V has been accepted upstream in November/December 2016 and will be part of binutils 2.28 (expected to be released in Q1/2017).

 :: The GCC support for RISC-V [[https://gcc.gnu.org/ml/gcc/2017-01/msg00148.html|has been accepted for upstream inclusion by the GCC Steering Committee]] but is still pending the final stages of the technical review as there have been a number of review comments that need to be addressed in a new version of the upstreaming patchset. There is reason for hoping that the RISC-V support could make it into the GCC 7 release, but this depends on how fast the review process can be finished.
Line 73: Line 111:
 :: It is expected that this situation will change soon (within few months) and that progress on this port can be started.  :: It is expected that this situation will change soon (within few months) and that progress on this port can be resumed.
Line 94: Line 132:
Follow instructions in: http://www.ports.debian.org/archive . Example:
{{{
 deb http://ftp.debian-ports.org/debian sid main
 deb http://ftp.debian-ports.org/debian unreleased main
 deb-src http://ftp.debian-ports.org/debian sid main
}}}

Mirrors ('''use them if possible''', they will likely be closer to you): http://www.ports.debian.org/mirrors . Example:
{{{
 deb http://mirrors.fe.up.pt/debian-ports sid main
 deb http://mirrors.fe.up.pt/debian-ports unreleased main
 deb-src http://mirrors.fe.up.pt/debian-ports sid main
}}}
Unofficial repository (WIP, incomplete and probably not working for you at the moment): http://riscv.mit.edu/

See https://people.debian.org/~mafm/posts/2017/20170422_debian-gnulinux-port-for-risc-v-64-bit-riscv64/ for more details.

To use it, in `/etc/apt/sources.list`:
{{{
  deb [ arch=riscv64 signed-by=/usr/share/keyrings/debian-keyring.gpg ] http://riscv.mit.edu/debian unstable main
  deb-src [ signed-by=/usr/share/keyrings/debian-keyring.gpg ] http://riscv.mit.edu/debian unstable main
}}}

The repository is signed with the key from Manuel as Debian Developer, contained in the file `/usr/share/keyrings/debian-keyring.gpg`, which is part of the package `debian-keyring` (available from Debian and derivatives).


Not in Debian infrastructure at the moment, but when it is, follow instructions in: http://www.ports.debian.org/archive . Example:
{{{
 deb http://ftp.ports.debian.org/debian-ports/ sid main
 deb http://ftp.ports.debian.org/debian-ports/ unreleased main
 deb-src http://ftp.ports.debian.org/debian-ports/ sid main
}}}

Mirrors ('''use them if possible''', they may be closer to you): http://www.ports.debian.org/mirrors
Line 118: Line 164:
Currently there are no porterboxes available. See [[#Qemu]] to install locally, if available. Currently there are no porterboxes available. See [[#Qemu|the qemu section]] to install locally, if available.
Line 142: Line 188:
 * '''''NOT CREATED YET'''''

This page contains details about the port of Debian for the RISC-V architecture (riscv64).

In a nutshell

What is RISC-V?

From the Wikipedia entry for RISC-V:

RISC-V (pronounced "risk-five") is an open source instruction set architecture (ISA) based on established reduced instruction set computing (RISC) principles.

In contrast to most ISAs, RISC-V is freely available for all types of use, permitting anyone to design, manufacture and sell RISC-V chips and software. While not the first open ISA, it is significant because it is designed to be useful in modern computerized devices such as warehouse-scale cloud computers, high-end mobile phones and the smallest embedded systems. Such uses demand that the designers consider both performance and power efficiency. The instruction set also has a substantial body of supporting software, which fixes the usual weakness of new instruction sets.

The project was originated in 2010 by researchers in the Computer Science Division at UC Berkeley, but many contributors are volunteers and industry workers that are unaffiliated with the university.

There are different versions of the instruction set for 32, 64 and 128 bits; operating as little-endian by default.

What is a Debian port?

In short, a port in Debian terminology means to provide the software normally available in the Debian archive (over 20,000 source packages) ready to install and run on systems based in a given computer architecture with the Linux kernel, or kernel-architecture combinations, with other kernels including GNU Mach (from GNU/Hurd) and kFreeBSD (from GNU/kFreeBSD).

See https://www.debian.org/ports/ and DebianPorts for more information.

What are the goals of this project in particular?

In this project the goal is to have Debian ready to install and run in systems implementing variants of the RISC-V ISA:

  • Software-wise, this port will target the Linux kernel

  • Hardware-wise, the port will target the 64-bit variant, little-endian

The ISA variant is the "default flavour" recommended by the designers, and the one that seems to attract more interest for planned implementations that might become available in the next few years (development boards, possible consumer hardware or servers).

While 32-bit and 128-bit implementations are possible, there are problems with this:

  • In the context of RISC-V design, they have not been explored as deeply, and tools and resources (e.g. simulators, research cores) as not as well studied and adapted;
  • For general purpose computers, the focus shifted to 64-bit for many years already, and there isn't a lot of interest in 32-bit architectures except for specific purposes;
  • 32-bit ports in Debian already struggle to compile some large packages of the archive in the last few months/years, a problem that will become worse with time;
  • and 128 is simply not realistic at this time.

Upstream project / Architecture / Hardware

Upstream project / Community

Architecture details

Hardware

There are different efforts from organisations around the world (research institutes, commercial companies, ...) that have shown interest in this project. Perhaps they will create some hardware available for purchase in the future, but there is nothing available or announced at this time.

The most interesting/promising project in this respect is the lowRISC project:

lowRISC is a not-for-profit organisation working closely with the University of Cambridge and the open-source community.
lowRISC is creating a fully open-sourced, Linux-capable, RISC-V-based SoC, that can be used either directly or as the basis for a custom design. [...]
Our open-source SoC (System-on-a-Chip) designs will be based on the 64-bit RISC-V instruction set architecture. Volume silicon manufacture is planned as is a low-cost development board. [...]

FPGA implementations

There are cores freely available such as Rocket, implementing the 64-bit scalar flavour of the RISC-V ISA (and MMU and an optional IEEE 754-2008-compliant FPU), which can be synthetised to an FPGA.

Toolchain upstreaming status

  • binutils: upstreamed (2.28 is the first release with RISC-V support)
  • gcc: upstreamed (7.1 is the first release with RISC-V support)
  • glibc: not upstreamed yet
  • linux kernel: not upstreamed yet
  • gdb: not upstreamed yet
  • qemu: not upstreamed yet

Debian port information

Hardware baseline and ABI choice

The Debian port uses RV64GC as the hardware baseline and the lp64d ABI (the default ABI for RV64G systems).

Making the C extension a part of the default hardware baseline for general-purpose binary Linux distributions has been agreed upon between Fedora porters, Debian porters and members of the RISC-V foundation. According to the chairman of the board of the RISC-V foundation, the foundation will provide "a profile for standard RISC-V Unix platforms that will include C as mandatory".

Status Log

2017-05-02

Upstream GCC 7.1 has been released with RISC-V support.

2017-04-22

Unofficial repository published (WIP, incomplete and probably not working for you at the moment): http://riscv.mit.edu/

More information about details and story in https://people.debian.org/~mafm/posts/2017/20170422_debian-gnulinux-port-for-risc-v-64-bit-riscv64/

2017-03-04
Upstream binutils 2.28 have been released with RISC-V support on 2017-03-02.
2017-02-06

The GCC support for RISC-V has been committed to the upstream GCC repository and will be part of the GCC 7 release. Commit list: 1 2 3 4 5 6

2017-01-18
The binutils support for RISC-V has been accepted upstream in November/December 2016 and will be part of binutils 2.28 (expected to be released in Q1/2017).

The GCC support for RISC-V has been accepted for upstream inclusion by the GCC Steering Committee but is still pending the final stages of the technical review as there have been a number of review comments that need to be addressed in a new version of the upstreaming patchset. There is reason for hoping that the RISC-V support could make it into the GCC 7 release, but this depends on how fast the review process can be finished.

2016-02-19
The preparations for this port started in private a while ago, but nothing has been made public so far and nothing useful yet for users and developers.

The main reason is the lack of official support for this architecture in fundamental pieces of the toolchain (binutils, gcc, glibc), the main OS kernel (linux) or even other software that might help with the port (e.g. qemu). All of the mentioned pieces have support in progress and are considered to submit for upstreaming, but nothing definitive has happened at the moment.

In particular, a recent message informed about some upcoming changes to the supervisor specifications (the ABI), which will affect binutils at least. Starting a Debian port without the ISA being settled is not very good, since the effort will need to be restarted from scratch.

It is expected that this situation will change soon (within few months) and that progress on this port can be resumed.

Credits

Porters:

Hardware Sponsors:

  • Bytemark provides hardware to help to kick-start this port. Bytemark is a long-time partner of Debian

  • Also using personal computers and regular Debian infrastructure

History

2016-02-19
Created page of the port in the wiki

APT sources.list

Unofficial repository (WIP, incomplete and probably not working for you at the moment): http://riscv.mit.edu/

See https://people.debian.org/~mafm/posts/2017/20170422_debian-gnulinux-port-for-risc-v-64-bit-riscv64/ for more details.

To use it, in /etc/apt/sources.list:

  deb [ arch=riscv64 signed-by=/usr/share/keyrings/debian-keyring.gpg ] http://riscv.mit.edu/debian unstable main
  deb-src [ signed-by=/usr/share/keyrings/debian-keyring.gpg ] http://riscv.mit.edu/debian unstable main

The repository is signed with the key from Manuel as Debian Developer, contained in the file /usr/share/keyrings/debian-keyring.gpg, which is part of the package debian-keyring (available from Debian and derivatives).

Not in Debian infrastructure at the moment, but when it is, follow instructions in: http://www.ports.debian.org/archive . Example:

 deb http://ftp.ports.debian.org/debian-ports/ sid main
 deb http://ftp.ports.debian.org/debian-ports/ unreleased main
 deb-src http://ftp.ports.debian.org/debian-ports/ sid main

Mirrors (use them if possible, they may be closer to you): http://www.ports.debian.org/mirrors

buildd (build-daemon) information

Porterboxes

Currently there are no porterboxes available. See the qemu section to install locally, if available.

Qemu

qemu emulation is not possible yet since the changes are not upstreamed, and the code is still being revised for changes in the specifications.

In the future, when qemu works it sould be possible to do something like:

Cross compilation

When support for RISC-V targets are added to gcc upstream and enabled in the relevant packages in Debian, they can be installed directly from the main Debian repositories:

  # apt install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu

Resources

Mailing list

IRC

  • irc.oftc.net / irc.debian.org (https://www.oftc.net/)

    • #debian-riscv
    • #lowRISC (not exactly Debian specific, but many interested people within Debian participate)

Bugs (BTS)

To: submit@bugs.debian.org
Subject: foo: FTBFS on riscv64

Package: foo
Version: 1.2.3-4
X-Debbugs-CC: debian-riscv@lists.debian.org
User: debian-riscv@lists.debian.org
Usertags: riscv64

The version of the package currently FBTFS on the riscv64 port:

  URL_of_the_log

or

To: control@bugs.debian.org
Subject: riscv64 usertags for #BUGNUMBER
CC: debian-riscv@lists.debian.org

user debian-riscv@lists.debian.org
usertag BUGNUMBER + riscv64
stop

or

To: BUGNUMBER@bugs.debian.org
Subject: Setting riscv64 usertags
CC: debian-riscv@lists.debian.org

Control: user debian-riscv@lists.debian.org
Control: usertag -1 + riscv64


CategoryPorts