Skip to content

Latest commit

 

History

History
33 lines (17 loc) · 1 KB

README.md

File metadata and controls

33 lines (17 loc) · 1 KB

Examples of embedded application in minimalistic style for RISC-V in Rust

How to build

  • Install Rust following instructions on this page

  • rustup +nightly component add rust-src

  • rustup +nightly target add riscv64gc-unknown-none-elf

  • cargo install cargo-xbuild

  • cargo +nightly xbuild --release

optionally

  • rustup +stable component add llvm-tools-preview

  • cargo install cargo-binutils

then this will work.

rustup run stable rust-objcopy -O binary target/riscv64gc-unknown-none-elf/release/step1-puts step1-puts.text

or you may use gnu binutils' objdump or llvm-objdmp with proper riscv support from your distributyon or elsewhere.

for instance you can find riscv64-unknown-elf toolchain here.

Other notes

  • link.x includes a few assembler instructions to setup the stack pointer and the program counter.

  • Use rvemu to run the generated codes.