The code here is a very simple low-level look at the two SiFive HiFive and Red-V boards which are long out of production now. I did incorperate QEMU for those without these now rare hard to find boards. So not all is lost.
##Project requires QEMU and RISC-V Toolchain
sudo apt update && sudo apt upgrade -y
apt install qemu-system
#RISC-V Toolchain
sudo apt install git-all
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
mkdir risc-v
cd risc-v
git clone https://github.com/riscv/riscv-gnu-toolchain.git
mkdir /opt/riscv
./configure --prefix=/opt/riscv --enable-multilib
make
#Adding to path:
echo 'export PATH=/opt/riscv/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
#Verify
riscv64-unknown-elf-gcc --version
#run
make
If this is successful in QEMU, you will see instruction for compiling for hardware(make hardware). It does require a different linker script which is provided. Simply drag and drop the hex in the file directory that represent your board. It will simply print hello world to the terminal.