1 A plan for Fedora/RISC-V
2 ----------------------------------------------------------------------
3 by Richard W.M. Jones (rjones@redhat.com)
5 Project home page: https://fedoraproject.org/wiki/Architectures/RISC-V
11 Stuck getting QEMU to work. See:
12 https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/fdbhLufxezA
14 Will likely wait until September when we may see a working QEMU that
15 is compatible with the latest RISC-V software.
18 The aim of the project
19 ----------------------
21 Get Fedora running on the RISC-V architecture! This will just be an
22 initial pass, which we're calling an "experimental architecture". It
23 won't even be a secondary architecture for perhaps 1 to 3 years.
25 About Fedora: https://getfedora.org/
26 About RISC-V: https://riscv.org/
27 https://en.wikipedia.org/wiki/RISC-V
28 lowRISC: http://www.lowrisc.org/
31 How do we expect people to consume Fedora/RISC-V?
32 -------------------------------------------------
34 Most users will download binaries. Of course source will be available
35 for [almost*] everything, buildable from source RPMS.
37 Currently no hardware is available, so you either have to run RISC-V
38 on an FPGA, or use QEMU/Spike emulation.
40 For the FPGA option, you will need a Nexys 4 DDR development kit
41 costing around US$341, plus an ordinary micro SD card (8+ GB), plus a
42 host Fedora/x86-64 computer.
44 - Maximum system RAM is 128 MB (1 GB is available if you use the
45 other far more expensive FPGA development kit)
47 - There is a 115200 bps 8n1 serial port.
49 - There is no ethernet and no display.
51 For the QEMU emulation option, see below.
53 - QEMU has unlimited system RAM.
55 - Network access is available.
57 For the Spike emulation option, see below.
59 - Spike has unlimited system RAM.
64 [*] Some CPU peripherals use proprietary IP. The aim is to replace
65 these with open equivalents eventually. Building the FPGA bitstream
66 will require proprietary tools, although the source itself is free
70 What parts of Fedora are we aiming to build?
71 --------------------------------------------
73 The @Core packages (as RPMs), rpmbuild, gcc, and a bootable binary
76 Only 64 bit RISC-V will be targeted.
78 Once those are done, we can declare victory.
81 What parts of Fedora are we *not* aiming to build?
82 --------------------------------------------------
84 Nothing outside @Core except for specific compilers and build tools.
88 Not Koji (at least, not at first).
90 Not Grub nor EDK2. We will initially use the Berkeley bootloader
91 (bbl), but aim for a standard bootloader later.
94 Where will we build it?
95 -----------------------
97 The packages which are run on the host (x86-64) computer will be built
98 in COPR (https://copr.fedorainfracloud.org/).
100 However the majority of packages will be built on RISC-V itself.
101 Since there are no RISC-V builders, and we cannot really provide them,
102 initially developers will be building them on their own FPGAs /
103 emulators and uploading them.
105 Getting build infrastructure would be a more long-term aim.
110 [See also: https://fedoraproject.org/wiki/Architectures/AArch64/Bootstrap]
114 (1a) riscv-qemu.x86_64: QEMU + RISC-V system emulation
116 Not upstream, fork of qemu 2.5.0.
117 https://github.com/riscv/riscv-qemu
118 Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv
120 Note this package runs on x86-64 hosts, and is intended for people who
121 want to run Fedora/RISC-V but who do not have FPGA/hardware.
123 (1b) riscv-isa-sim.x86_64: Spike system emulator
125 Since QEMU is broken at the moment, we must use the slower Spike
130 Various sources, see:
131 http://www.lowrisc.org/docs/untether-v0.2/fpga-demo/
135 (2a) GNU cross-compiler toolchain.
137 https://github.com/lowRISC/riscv-gnu-toolchain
138 Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv
140 (2b) Berkley Bootloader (bbl)
142 https://github.com/lowrisc/riscv-pk.git
143 Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv
145 Used to boot the kernel and mount the root filesystem on FPGAs and
150 (3a) kernel.riscv64: The Linux kernel, cross-compiled.
152 Current status: Not upstream, fork of Linux 4.6.
153 https://github.com/lowrisc/riscv-linux
155 (3b) "Just enough userspace"
157 The following packages, cross-compiled from x86-64 host to riscv64
158 target filesystem. The aim is to have a filesystem (not RPMs) that
159 can be booted on RISC-V hardware or under QEMU, which will be
160 sufficient to use to compile RPMs.
169 filesystem.riscv64 (?)
177 We will also need to add the following noarch packages (these do not
178 need to be compiled, they can just be copied from another Fedora
182 ca-certificates.noarch
183 crypto-policies.noarch
184 emacs-filesystem.noarch
185 fedora-release.noarch
190 ==== At this point, Fedora on RISC-V will be self-hosting ====
194 (4a) kernel.riscv64: The Linux kernel, compiled as an RPM on RISC-V.
198 (See the above list of packages, but built from SRPMs)
200 (4c) Recreate the filesystem from RPMs.
202 Distribute an initial bootable binary disk image which is completely
203 built from RPMs (but note, not created by Anaconda).
205 (4d) Continue compiling all other RPMs from @Core.
207 As more packages are compiled, distribute them as RPMs and distribute
208 updated bootable binary disk image.
210 (4e) Declare victory and celebrate!
216 What architecture string to use (eg. in RPM package names)? There are
217 32, 64 and (in theory) 128 bit variants of RISC-V. GNU uses "riscv64".