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
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
470
php-conference-japan-2024
tasuku43
0
320
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
300
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
260
Beyond ORM
77web
7
930
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
520
39k
A designer walks into a library…
pauljervisheath
204
24k
Designing for humans not robots
tammielis
250
25k
How to Ace a Technical Interview
jacobian
276
23k
Automating Front-end Workflow
addyosmani
1366
200k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Typedesign – Prime Four
hannesfritz
40
2.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
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