miro662 / r5os

A simple OS for RISC-V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

R5OS

bare-metal experiments with VisionFive 2

How to run

r5os uses cmake and LLVM to be built. You can build r5os using cmake:

cmake .
make

Then, you have many ways to run it on VisionFive 2:

Using tftp

In order to do this, you need to connect your VisionFive 2 to network where it can access a TFTP server. Then:

  1. Host a build/r5os.elf on your TFTP server.
  2. Connect to your VisionFive 2 by UART (using e.g. minicom or putty).
  3. Run your VisionFive 2 and get to u-boot prompt. You can do this by running your VisionFive 2 without any storage medium or interrupting start-up when U-boot lists available images.
  4. Configure network. You can use command dhcp:
StarFive # dhcp

or manually assign address by setting ipaddr and netmask using setenv:

StarFive # setenv ipaddr 192.168.0.100
StarFive # setenv netmask 255.255.255.0
  1. Load r5os.elf file from TFTP server:
StarFive # tftpboot ${loadAddr} [tftpServerAddr]:[pathToR5OsElf]
  1. r5os.elf is now loaded at loadAddr (0x60000000). Run it with command bootelf:
StarFive # bootelf

Using ymodem

In order to do this, you need to connect to your VisionFive 2 by UART and use program capable of transfering files via ymodem (e.g. minicom). CMake provides make vf2_ymodem command to do so (define VF2_YMODEM_FILE accordingly). You can also:

  1. Run your VisionFive 2 and get to u-boot prompt. You can do this by running your VisionFive 2 without any storage medium or interrupting start-up when U-boot lists available images.
  2. Enter loady command:
StarFive # loady
  1. Begin transfering file. In minicom, press Ctrl+A and then S. A menu should open - select ymodem, and then navigate to build/r5os.elf. Wait a while until transfer is complete and prompt appears.
  2. r5os.elf is now loaded at loadAddr (0x60000000). Run it with command bootelf:
StarFive # bootelf

Note: you might need root access to use serial port.

About

A simple OS for RISC-V

License:Apache License 2.0


Languages

Language:C 53.5%Language:Python 27.4%Language:CMake 16.4%Language:Assembly 2.7%