forked from rarias/nixos-riscv
76 lines
1.3 KiB
Markdown
76 lines
1.3 KiB
Markdown
# NixOS on RISC-V
|
|
|
|
This repository contains NixOS configurations for different RISC-V machines.
|
|
|
|
## Lagarto Ox on FPGA Alveo U55C
|
|
|
|
To build the system and boot it on an FPGA of the MEEP cluster, you can run the
|
|
following:
|
|
|
|
```
|
|
$ nix develop -L '.#lagarto-ox' --command fpga/run-remotely.sh fpgalogin1:ci
|
|
```
|
|
|
|
To do it manually, you can first enter the development shell:
|
|
|
|
```
|
|
$ nix develop -L '.#lagarto-ox'
|
|
```
|
|
|
|
Then upload the files to the target machine (fpgalogin1 by default):
|
|
|
|
```
|
|
$ fpga/upload.sh
|
|
```
|
|
|
|
Then connect to the fpgalogin1 machine, allocate a FPGA node and load the
|
|
environment there:
|
|
|
|
```
|
|
$ cd nixos
|
|
$ . env.sh
|
|
```
|
|
|
|
Flash the images to the FPGA:
|
|
|
|
```
|
|
$ ./fpgactl -w bitstream.bit -b opensbi.bin -k kernel.bin -i initrd.bin -r rootfs.img
|
|
```
|
|
|
|
And monitor the serial line:
|
|
|
|
```
|
|
$ picocom -q -b 115200 $FPGACTL_UART
|
|
```
|
|
|
|
It should boot without any user interaction.
|
|
|
|
## Lagarto Ox on QEMU
|
|
|
|
To build the system and boot it on QEMU, you can run the following:
|
|
|
|
```
|
|
$ nix develop -L '.#qemu-lagarto-ox'
|
|
```
|
|
|
|
Then, simply run boot.sh to start the QEMU system.
|
|
|
|
```
|
|
$ ./boot.sh
|
|
```
|
|
To execute the RISC-V benchmark suite on boot stage 2, run boot.sh with the bench2 option.
|
|
|
|
```
|
|
$ ./boot.sh bench2
|
|
```
|
|
|
|
To open a debug shell on boot stage 2, run boot.sh with the debug2 option.
|
|
|
|
```
|
|
$ ./boot.sh debug2
|
|
```
|
|
|
|
## Lagarto Hun
|
|
|
|
WIP
|