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
630
技術書典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
65
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
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
php-conference-japan-2024
tasuku43
0
320
Jakarta EE meets AI
ivargrimstad
0
250
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
380
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
260
fs2-io を試してたらバグを見つけて直した話
chencmd
0
240
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
110
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
130
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
280
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
Featured
See All Featured
A better future with KSS
kneath
238
17k
Done Done
chrislema
181
16k
Music & Morning Musume
bryan
46
6.2k
Gamification - CAS2011
davidbonilla
80
5.1k
Code Reviewing Like a Champion
maltzj
520
39k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Mobile First: as difficult as doing things right
swwweet
222
9k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Scaling GitHub
holman
458
140k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
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