Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RISC-VボードでRustを動かす話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daniel
July 03, 2019
Technology
1
960
RISC-VボードでRustを動かす話
最近買ったRISC-VボードHifive1 RevBの上でRustを動かす話です。(時間の関係ではなせなかった部分が少し増えてます)
Daniel
July 03, 2019
Tweet
Share
More Decks by Daniel
See All by Daniel
Juliaで機械学習
peshogo
2
810
一年生へ
peshogo
1
74
炭酸飲料が飲めない学校で炭酸飲料を飲めるよにした話
peshogo
0
92
Other Decks in Technology
See All in Technology
Generative UI を試そう!A2-UIでAIエージェントにダッシュボードを作らせてみた
kamoshika
1
220
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
3
1.4k
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
310
StrandsAgentsで構築したAIエージェントにMCP Apps機能を追加してみた
kmiya84377
0
130
22nd ACRi Webinar - 1Finity Tamura-san's slide
nao_sumikawa
0
130
Three-Legged OAuth in AgentCore Gateway
hironobuiga
1
100
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
240
判断は人、準備はAI - チケット管理で見えた仕事の境界
yusukeshimizu
2
130
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
180
AIで 浮いた時間で 何をする? 2026春 #devsumi
konifar
4
1.1k
なぜAIは チーム開発を 速くしないのか
tan_go238
6
3k
生成AIで始める業務改革 - 製造業編 in 福島 -
daikikanemitsu
2
570
Featured
See All Featured
Everyday Curiosity
cassininazir
0
140
Thoughts on Productivity
jonyablonski
75
5.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
77
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Curse of the Amulet
leimatthew05
1
8.9k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
How to train your dragon (web standard)
notwaldorf
97
6.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Transcript
RISC-VボードでRustを動かす話
⾃⼰紹介 Self Self { { name name: : " ダニエル"
" ダニエル", , school school: : " 東京農⼯⼤学" " 東京農⼯⼤学", , twitter twitter: : "@daniel_program" "@daniel_program", , } }
RISC-V
RISC-Vとは… CPUのオープンソースな命令セット(ISA)の⼀種
HIFive RevB HIFive RevB のページ
HIFive RevB Hifive RV IMAC Rust riscv imac-unknown-none-elf このボード向けにコンパイルできるのでは?
やってみた C⾔語からRustを呼び出す Rust単体で実⾏する
Cから呼び出す rustから使いやすいようにCを書く rustを書く staticlib として書き出す cbindgenで.h ファイルを作る ⼀緒にコンパイルする
rustから使いやすいようにCを書く freedom-e-sdk void void led_on led_on( () ) { {.
.. .. .} } void void led_off led_off( () ) { {. .. .. .} } int int main main( () ) { { . .. .. . blink_rs blink_rs( () ); ; } }
rustを書く extern extern { { fn fn led_on led_on( ()
); ; fn fn led_off led_off( () ); ; } } #[no_mangle] #[no_mangle] pub pub extern extern fn fn blink_rs blink_rs( () ) { { loop loop { { unsafe unsafe{ { led_on led_on( () ); ; } } delay delay( () ); ; unsafe unsafe{ { led_off led_off( () ); ; } } delay delay( () ); ; } } } }
staticlib Cargo.toml [ [package package] ] name name = =
"blink" "blink" version version = = "0.1.0" "0.1.0" authors authors = = [ ["Daniel" "Daniel"] ] edition edition = = "2018" "2018" [ [lib lib] ] crate-type crate-type= =[ ["staticlib" "staticlib"] ] [ [dependencies dependencies] ]
cbindgen $ cargo $ cargo install install cbindgen cbindgen $
cbindgen $ cbindgen . . .. .... .. void blink_rs void blink_rs( (void void) ); ;
⼀緒にコンパイルする コンパイラにstaticlib も投げればコンパイルしてくれる。 今回はMakefile の依存関係に書くだけでコンパイルしてくれた。
Rust単体で実⾏する Github - riscv-rust-quickstart https://github.com/riscv-rust/riscv-rust-quickstart
"cargo run " で実⾏ができる!
Example leds_blinkでLチカができている
None
実⾏はしっかりできます
まとめ riscvボードでRustは動かせる。 Cとつなげるのは⾯倒くさい ライブラリ周りがまだしっかりしていない
ありがとうございます! @daniel_program