Add stage 2 riscv-pk package, containing the Berkeley bootloader (bbl).
[fedora-riscv.git] / README
1 A plan for Fedora/RISC-V
2 ----------------------------------------------------------------------
3 by Richard W.M. Jones (rjones@redhat.com)
4
5 Project home page: https://fedoraproject.org/wiki/Architectures/RISC-V
6
7
8 The aim of the project
9 ----------------------
10
11 Get Fedora running on the RISC-V architecture!  This will just be an
12 initial pass, which we're calling an "experimental architecture".  It
13 won't even be a secondary architecture for perhaps 1 to 3 years.
14
15 About Fedora: https://getfedora.org/
16 About RISC-V: https://riscv.org/
17               https://en.wikipedia.org/wiki/RISC-V
18      lowRISC: http://www.lowrisc.org/
19
20
21 How do we expect people to consume Fedora/RISC-V?
22 -------------------------------------------------
23
24 Most users will download binaries.  Of course source will be available
25 for [almost*] everything, buildable from source RPMS.
26
27 Currently no hardware is available, so you either have to run RISC-V
28 on an FPGA, or use QEMU emulation.
29
30 For the FPGA option, you will need a Nexys 4 DDR development kit
31 costing around US$341, plus an ordinary micro SD card (8+ GB), plus a
32 host Fedora/x86-64 computer.
33
34   - Maximum system RAM is 128 MB (1 GB is available if you use the
35     other far more expensive FPGA development kit)
36
37   - There is a 115200 bps 8n1 serial port.
38
39   - There is no ethernet and no display.
40
41 For the QEMU emulation option, see below.
42
43   - QEMU has unlimited system RAM.
44
45   - Network access is available.
46
47
48 [*] Some CPU peripherals use proprietary IP.  The aim is to replace
49 these with open equivalents eventually.  Building the FPGA bitstream
50 will require proprietary tools, although the source itself is free
51 software.
52
53
54 What parts of Fedora are we aiming to build?
55 --------------------------------------------
56
57 The @Core packages (as RPMs), rpmbuild, gcc, and a bootable binary
58 disk image.
59
60 Only 64 bit RISC-V will be targeted.
61
62 Once those are done, we can declare victory.
63
64
65 What parts of Fedora are we *not* aiming to build?
66 --------------------------------------------------
67
68 Nothing outside @Core except for specific compilers and build tools.
69
70 Not Anaconda.
71
72 Not Koji (at least, not at first).
73
74 Not Grub nor EDK2.  We will initially use the Berkeley bootloader
75 (bbl), but aim for a standard bootloader later.
76
77
78 Where will we build it?
79 -----------------------
80
81 The packages which are run on the host (x86-64) computer will be built
82 in COPR (https://copr.fedorainfracloud.org/).
83
84 However the majority of packages will be built on RISC-V itself.
85 Since there are no RISC-V builders, and we cannot really provide them,
86 initially developers will be building them on their own FPGAs / QEMUs
87 and uploading them.
88
89 Getting build infrastructure would be a more long-term aim.
90
91
92 Bootstrapping stages
93 --------------------
94 [See also: https://fedoraproject.org/wiki/Architectures/AArch64/Bootstrap]
95
96 * Stage 1
97
98 (1a) riscv-qemu.x86_64: QEMU + RISC-V system emulation
99
100 Not upstream, fork of qemu 2.5.0.
101 https://github.com/riscv/riscv-qemu
102 Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv
103
104 Note this package runs on x86-64 hosts, and is intended for people who
105 want to run Fedora/RISC-V but who do not have FPGA/hardware.
106
107 (1b) Nexys4 DDR FPGA
108
109 Various sources, see:
110 http://www.lowrisc.org/docs/untether-v0.2/fpga-demo/
111
112 * Stage 2
113
114 (2a) GNU cross-compiler toolchain.
115
116 https://github.com/lowRISC/riscv-gnu-toolchain
117 Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv
118
119 (2b) Berkley Bootloader (bbl)
120
121 https://github.com/lowrisc/riscv-pk.git
122 Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv
123
124 Used to boot the kernel and mount the root filesystem on FPGAs and
125 QEMU.
126
127 * Stage 3
128
129 (3a) kernel.riscv64: The Linux kernel, cross-compiled.
130
131 Current status: Not upstream, fork of Linux 4.6.
132 https://github.com/lowrisc/riscv-linux
133
134 (3b) "Just enough userspace"
135
136 The following packages, cross-compiled from x86-64 host to riscv64
137 target filesystem.  The aim is to have a filesystem (not RPMs) that
138 can be booted on RISC-V hardware or under QEMU, which will be
139 sufficient to use to compile RPMs.
140
141 bash.riscv64
142 glibc.riscv64
143 binutils.riscv64
144 gcc.riscv64
145 cpp.riscv64
146 rpm.riscv64
147 coreutils.riscv64
148 filesystem.riscv64 (?)
149 gawk.riscv64
150 grep.riscv64
151 gzip.riscv64
152 sed.riscv64
153 xz.riscv64
154 zlib.riscv64
155
156 We will also need to add the following noarch packages (these do not
157 need to be compiled, they can just be copied from another Fedora
158 system):
159
160 basesystem.noarch
161 ca-certificates.noarch
162 crypto-policies.noarch
163 emacs-filesystem.noarch
164 fedora-release.noarch
165 fedora-repos.noarch
166 setup.noarch
167 tzdata.noarch
168
169     ==== At this point, Fedora on RISC-V will be self-hosting ====
170
171 * Stage 4
172
173 (4a) kernel.riscv64: The Linux kernel, compiled as an RPM on RISC-V.
174
175 (4b) Userspace RPMs
176
177 (See the above list of packages, but built from SRPMs)
178
179 (4c) Recreate the filesystem from RPMs.
180
181 Distribute an initial bootable binary disk image which is completely
182 built from RPMs (but note, not created by Anaconda).
183
184 (4d) Continue compiling all other RPMs from @Core.
185
186 As more packages are compiled, distribute them as RPMs and distribute
187 updated bootable binary disk image.
188
189 (4e) Declare victory and celebrate!
190
191
192 Open issues
193 -----------
194
195 What architecture string to use (eg. in RPM package names)?  There are
196 32, 64 and (in theory) 128 bit variants of RISC-V.  GNU uses "riscv64".