From Fedora Project Wiki
(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 [http://oirase.annexia.org/riscv/nexys-4-ddr-fpga/]. <code>.xz</code>-compressed files must be uncompressed.
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.

Boot the FPGA

  • Copy the files chip_top.new.bit, boot, vmlinux and root.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.