(Created page with "How to run Fedora/RISC-V on an FPGA. = What you will need to buy = Current recommended hardware is the [http://store.digilentinc.com/nexys-4-ddr-art...") |
|||
Line 11: | Line 11: | ||
= Download = | = Download = | ||
Grab all the files from | Grab all the files from http://oirase.annexia.org/riscv/nexys-4-ddr-fpga/ <code>.xz</code>-compressed files must be uncompressed. | ||
* The <code>vmlinux</code> and <code>root.bin</code> files were provided by [http://www.lowrisc.org/docs/untether-v0.2/fpga-demo/ lowRISC]. They are a Linux 3.14.41 kernel and a busybox root filesystem respectively (we will replace the root filesystem with a Fedora-based one, but keep the precompiled Linux kernel). You can also build these from source [http://www.lowrisc.org/docs/untether-v0.2/ using the instructions on the lowRISC website]. | * The <code>vmlinux</code> and <code>root.bin</code> files were provided by [http://www.lowrisc.org/docs/untether-v0.2/fpga-demo/ lowRISC]. They are a Linux 3.14.41 kernel and a busybox root filesystem respectively (we will replace the root filesystem with a Fedora-based one, but keep the precompiled Linux kernel). You can also build these from source [http://www.lowrisc.org/docs/untether-v0.2/ using the instructions on the lowRISC website]. |
Revision as of 14:02, 20 August 2016
How to run Fedora/RISC-V on an FPGA.
What you will need to buy
Current recommended hardware is the Digilent Nexys 4 DDR. Richard bought one which cost £261 including tax and delivery.
You will also need a micro SDHC card (16GB recommended), plus whatever card reader you might need for your computer. The Nexys 4 comes with everything else.
You will need a host laptop running Fedora/x86_64, with "screen" installed.
Download
Grab all the files from http://oirase.annexia.org/riscv/nexys-4-ddr-fpga/ .xz
-compressed files must be uncompressed.
- The
vmlinux
androot.bin
files were provided by lowRISC. They are a Linux 3.14.41 kernel and a busybox root filesystem respectively (we will replace the root filesystem with a Fedora-based one, but keep the precompiled Linux kernel). You can also build these from source using the instructions on the lowRISC website. - The
chip_top.new.bit
file is the FPGA bitstream (program). RWMJ compiled this using Xilinx Vivado etc using the instructions on the lowRISC website. Note that it is not redistributable. boot
is the Berkeley Bootloader as supplied by lowRISC for the Nexys 4. RWMJ compiled it using the instructions on the lowRISC website.
Boot the FPGA
- Copy the files
chip_top.new.bit
,boot
,vmlinux
androot.bin
to the root directory of the SD card. Note the SD card must be formatted with a single FAT partition. - Insert the SD card into the Nexys 4.
- Set the "POWER" switch to "OFF".
- Set "JP1" to "USB/SD", and "JP2" to "SD".
- Connect the OTG USB cable between your laptop and the Nexys 4 board.
- Run:
screen /dev/ttyUSB1 115200
- Set the "POWER" switch to "ON".
- The yellow light should come on, and after a few seconds, this is replaced by a green light. If this doesn't happen, consult 2.3 USB Host and Micro SD Programming in the Nexys 4 reference manual.
- You should also see Linux booting in the serial console (in "screen").
This boots into the lowRISC busybox environment.
Boot Fedora on the FPGA
Create an alternate root.bin containing either stage3 or stage4 Fedora/RISC-V.
You must compile the bootstrapping environment first.
For stage3 you would run:
cd stage3-chroot; virt-make-fs . ../root.bin -t ext2 -F raw -s +100M
NB The root.bin
file must not exceed 2GB. (This limit comes from the FAT filesystem used by the SD card, which unfortunately we cannot change). If the final filesystem is too big, then you will need to remove files from stage3-chroot, or adjust the virt-make-fs -s
parameter.
Copy the new root.bin
to the SD card and proceed as above.