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
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Outline View in SwiftUI
1024jp
1
330
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
CSC509 Lecture 13
javiergs
PRO
0
110
Arm移行タイムアタック
qnighy
0
340
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
Quine, Polyglot, 良いコード
qnighy
4
650
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
240
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
A designer walks into a library…
pauljervisheath
204
24k
Unsuck your backbone
ammeep
668
57k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Designing for Performance
lara
604
68k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
The Invisible Side of Design
smashingmag
298
50k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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