Skip to content

kassane/riscv64-hello-linux

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Linux RISC-V 64

This tiny tool lets you print some information from /proc and uname from Linux on RISC-V 64.

Build

Rust Version

You will need Rust and the linker from riscv64-linux-gnu-gcc.

cargo build --release

or zig linker:

cargo install cargo-zigbuild

cargo zigbuild --release

Zig version

You will need Zig

# zig version v0.11 or higher (default self-hosting compiler [stage3]) 
zig build -Doptimize=<mode> -Dtarget=arch-os-libc
# mode = ReleaseSafe|ReleaseFast|ReleaseSmall

# specific target
zig build -Doptimize=<mode> -Dtarget=riscv64-linux -Dcpu=baseline_rv64+v # Allwinner D1

# more features RISC-V: https://github.com/lupyuen/zig-bl602-nuttx/issues/1

# Execute (after builded)
./zig-out/bin/hello-zig
# or run directly (default: host target) 
zig build run -Doptimize=<mode> -Dtarget=riscv64-linux

# all targets
zig targets | jq .libc

Run via cpu

cpu -key ~/.ssh/cpu_rsa -timeout9p 2000ms target-host \
  ./target/riscv64gc-unknown-linux-gnu/release/hello-rust
  or
  ./zig-out/bin/hello-zig

About

A simple program for Linux on RISC-V 64, written in Rust and Zig

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Zig 55.1%
  • Rust 37.9%
  • Makefile 7.0%