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
技術書典7で見つけたベアメタルRust本 / Bare Metal with Rust
Search
Yuya Kato
October 05, 2019
Programming
1
620
技術書典7で見つけたベアメタルRust本 / Bare Metal with Rust
Yuya Kato
October 05, 2019
Tweet
Share
More Decks by Yuya Kato
See All by Yuya Kato
DevLOVE関西 自分の現場でやった“こと”と“経験”をみんなが話す会 / DevLOVE Kansai sharing experiences
yuyakato
0
61
Rustの新しい書籍『実践Rust入門』の紹介 / Introduction of Rust bicycle book
yuyakato
0
250
Rubyから世界へ / Let’s start a journey around the world beyond Ruby
yuyakato
0
530
サーマルプリンタとRaspberry Piでカンバンを改善した話
yuyakato
3
1.3k
「チームで学ぼう!TensorFlow実践編」第1期で僕が学んだこと
yuyakato
0
300
Other Decks in Programming
See All in Programming
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
flutterkaigi_2024.pdf
kyoheig3
0
150
距離関数を極める! / SESSIONS 2024
gam0022
0
290
みんなでプロポーザルを書いてみた
yuriko1211
0
280
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
CSC509 Lecture 12
javiergs
PRO
0
160
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
For a Future-Friendly Web
brad_frost
175
9.4k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
GitHub's CSS Performance
jonrohan
1030
460k
4 Signs Your Business is Dying
shpigford
180
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Unsuck your backbone
ammeep
668
57k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Become a Pro
speakerdeck
PRO
25
5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Transcript
1 Rust Kansai Meetup #5 ٕज़ॻయ7Ͱݟ͚ͭͨ ϕΞϝλϧRustຊ 201910݄5() @ηϯελΠϜδϟύϯ גࣜձࣾಹ༝ଟ
Ճ౻༐
ࣗݾհ: Ճ౻ ༐ • ιϑτΣΞΤϯδχΞʢ2000ʙʣ • גࣜձࣾಹ༝ଟ දऔకʢ2007ʙʣ ͳ Ώ
ͨ • झຯ: • ͷͮ͘Γશൠʢιϑτ/ϋʔυʣ • 3DϓϦϯλʢ2013ʙʣ • ϘϧμϦϯάʢ2011ʙʣ 2 yuyakato1984 nayutaya
ٕज़ॻయ 3
4 ٕज़ॻయͱʁ ৽͍ٕ͠ज़ʹग़ձ͑Δ ͓ࡇΓͰ͢ɻ https://techbookfest.org/ ΑΓҾ༻ ٕज़ಉਓࢽͷଈചձ ۙͰ20199݄22()ʹାʹͯ։࠵ ࢀՃͨ͠ਓ
ٕज़ॻయ7ͷઓར 5 ↑ࣄͰ6 ←झຯͰ5 Λ ͓͔͍ͭ ͯ͠Β͍·ͨ͠ ͋Γ͕ͱ͏ʂI܅
ϕΞϝλϧ 6
ϕΞϝλϧͱʁ 7 ʲϕΞϝλϧʳʪ໊ʫ Bare Metal ༁Ͱʮ࿐ग़ͨۚ͠ଐʯʮΉ͖ग़͠ͷۚଐʯɻ సͯ͡ɺOSͳͲ͕Πϯετʔϧ͞Ε͍ͯͳ͍ɺ·ͬ͞Βͳ ίϯϐϡʔλɺ·ͨετϨʔδɻ
ϕΞϝλϧͱʁ 8
ϕΞϝλϧͱʁ 8 OSͷͳ͍Ϛγϯ ཁ͢Δʹ
9 RustΛѪ͢Δ ϕΞϝλϧΛѪ͢Δ ͔ͭ ͚ͩʹ ͞Δ3Λհ͠·͢ ͜ͷੈʹԿਓ͍Δ͔͔Βͳ͍ ͻͱ
հ͢Δ3 10 M5StackͰ࢝ΊΔ ΈࠐΈRust Rust on Bare-metal Raspberry Pi Rust
on Bare-metal Raspberry Pi Vol.2
1 11
M5StackͰ࢝ΊΔΈࠐΈRust 12 Kenta IDA ஶ / 58ϖʔδ μϯϩʔυ൛ 500ԁ https://booth.pm/ja/items/1569213
৽ץ
M5StackɺESP32ͱʁ 13 Wi-FiɺBluetoothΛଂ͢Δ ҆Ձ͔ͭଟػೳͳϚΠίϯ ESP32ɺӷথσΟεϓϨΠɺ ϘλϯɺόοςϦͳͲ͕ଂ͞Εͨ ίϯύΫτͳ։ൃϞδϡʔϧ ͜ͷϞδϡʔϧͷ தʹؚ·ΕΔνοϓ ελοΫͰ͖ΔΑʂ
US$5͘Β͍Ͱങ͑ΔΑʂ
ରಡऀ • M5Stackɺ·ͨESP32ʹ৮ͬͨ͜ͱ͕͋Δ • Arduino IDEɺPlatform IOɺ·ͨESP-IDFͰ ϓϩάϥϜΛ࡞ͬͨ͜ͱ͕͋Δ • RustͷʮHello,
worldʯܦݧࡁΈ 14 ֘͢Δਓ
͜ͷຊͷεΰΠͱ͜Ζ 15
͜ͷຊͷεΰΠͱ͜Ζ 15 LLVMɺrustc ͷϏϧυ͔Β͡·Δ ESP32ͷCPUTensilicaࣾͷXtensa LX6
QiitaهࣄΛॻ͖·ͨ͠ 16 ESP32 + RustͰ Hello world https://qiita.com/yuyakato/items/c11de0a43d14dea6c9dd Ϗϧυ͢Δ͚ͩͰ 30ʙ2͔͔࣌ؒΓ·͢
Ωʔϫʔυ #[no_std] #[no_mangle] #[global_allocator] #[alloc_error_handler] extern “C" bindgen FreeRTOS 17
2 18
Rust on Bare-metal Raspberry Pi 19 naotaco ஶ / 62ϖʔδ
ཧຊ 800ԁ https://booth.pm/ja/items/1318760 Kindle൛ 700ԁ https://www.amazon.co.jp/dp/B07QG3WX3T طץ
ରಡऀ • OSͷແ͍ੈքʹಌΕ͍ͯΔ • Raspberry Pi 3Λ࣋ͯ༨͍ͯ͠Δ • ϋʔυΣΞͷ͜ͱΛͬͱΓ͍ͨ 20
※ͪͳΈʹॻ੶ʹॻ͍ͯ͋Γ·ͤΜ ֘͢Δਓ
Raspberry Piͱʁ 21 ͜Εઆ໌ෆཁͩͱࢥΘΕΔͷͰলུ
͜ͷຊͷεΰΠͱ͜Ζ 22
͜ͷຊͷεΰΠͱ͜Ζ 22 mainؔ·Ͱ͕͍ ϕΞϝλϧ͋Δ͋Δ
Ωʔϫʔυ #[no_std] #[global_allocator] Arm Cortex-A53 SoC Ϩδελ DMA MMIO ϒʔτϩʔμ
UART registerΫϨʔτ compiler_fence fence JTAG OpenOCD gdb 23 DMA: Direct Memory Access MMIO: Memory Mapped I/O
3 24
Rust on Bare-metal Raspberry Pi Vol.2 25 naotaco ஶ /
50ϖʔδ ཧຊ 700ԁ https://booth.pm/ja/items/1575818 ৽ץ
͜ͷຊͷεΰΠͱ͜Ζ 26
͜ͷຊͷεΰΠͱ͜Ζ 26 ༰͕΄΅DMAC DMAC: DMA Controller
Ωʔϫʔυ DMAC #[repr(C)] ΩϟογϡϝϞϦ 27 DMAC: DMA Controller
·ͱΊ • ·͢·͕͢ΔRustͷద༻ൣғ • ϕΞϝλϧ͔Θ͍͍ΑϕΞϝλϧ 28
Let's dive into bare metal with Rust 29