Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Unikernelで始める自作OS/OS Development with Unikernel
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Akira Moroo
October 06, 2019
Technology
730
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Unikernelで始める自作OS/OS Development with Unikernel
Unikernelの設計/実装を使って自作OSができるのではないかという話です.
Akira Moroo
October 06, 2019
More Decks by Akira Moroo
See All by Akira Moroo
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
670
Exploring x86 MSR Space
retrage
0
1.6k
LLMでバイナリ解析支援
retrage
0
290
GitHub ActionsでDevSecOpsごっこ
retrage
0
130
Practical Rust (Hypervisor) Firmware
retrage
3
2k
Bypassing UEFI Secure Boot with Thin-Hypervisor
retrage
0
1.4k
Porting Linux to Nabla Containers
retrage
0
1.3k
Network Boot from Bell Labs
retrage
2
1.9k
LLVM Backend Development for EFI Byte Code
retrage
2
1.2k
Other Decks in Technology
See All in Technology
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
140
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
0
270
詳解 never 型 - ボトム型の性質を深掘り
nealle
0
140
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
550
SLOを阻む不安
sraku2159
0
220
OneLakeをデータソースにした AI Search(Foundry IQ)の ライフサイクル管理
ryuseiiida
0
220
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
現場を動かすAIエージェント#2_製造業現場でのAI活用から見た、ハマる罠と実践知
kintotechdev
1
130
re:Inventで、人生は変わったのか? / growth-builders-hub-1-reinvent-2026
mhrtech
2
300
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
200
AIで選択肢が広がった組織設計の理想と現実
konifar
16
7.6k
"AWSはちょっと苦手"でも大丈夫。AWS Blocks で手軽に作る Flutter のバックエンド #FlutterKaigi
tacck
PRO
0
130
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The browser strikes back
jonoalderson
0
1.9k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
The SEO Collaboration Effect
kristinabergwall1
1
610
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
760
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Evolving SEO for Evolving Search Engines
ryanjones
0
350
Designing Experiences People Love
moore
143
24k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Transcript
Unikernelで 始める⾃作OS October 6, 2019 第17回 ⾃作OSもくもく会 @retrage
Q: なぜOS⾃作? 1
A: 楽しいから 2
A: 学習のため • こういう⼈もいるはず • コンピュータアーキテクチャやOSを知る • 書籍や資料を読んだり • 既存OSの実装を読んだり
• 実際に⼿を動かしてみることで理解が深まる 3
学習のためのOS⾃作 • 1. ゼロから全部実装 • 全てを⾃分で実装したコードで制御できる • 関⼼のある部分の実装にたどり着くまでが⼤変 • 2.
既存OSの改造 • 関⼼のある部分の実装にすぐ着⼿できる • 既存OSの実装を理解している必要がある • Linuxのような⼤規模なOSの場合かなり⼤変 4
OS⾃作の障壁 • x86プラットフォームは⽐較的複雑 • 歴史的経緯による • 煩雑な起動プロセス • 多種多様なデバイスへの対応 •
学習⽤途であれば仮想環境で⼗分では? • デバイス: virtio, シリアルコンソール • OSの起動: -kernel os.img • => Unikernelが使えそう 5
Unikernel: 概要 • OSの形態の1つ (Library OS) • 仮想環境で動作す ることを前提 •
空間の分離なし • シングルプロセス • ハイパーバイザで 隔離性を担保 • 実装は多数 6
Unikernel: ⾃作OSの観点 • 簡易化したOSとみなせる • 1. ゼロからの実装: • マルチプロセスの実装が不要 •
実装すべきデバイスドライバは少数 • 2. 既存OSの改造: • コード量が⽐較的少ない • 例: Unikraft 108,523⾏ 7
Unikernels as Processes • Unikernelをホスト上のプロセスとして動かす • 隔離はOS上のプロセスで⼗分 • Unikernelに対する制約 •
システムコールを直接発⾏できない 8
ハイパーコール 9
Unikernels as Processes: ⾃作OSの観点 • 抽象化されたデバイス • デバイスドライバを書く必要がない • ハイパーコールを発⾏するだけで利⽤可能
• デバッグが⽐較的容易 • ただのユーザ空間のプロセスのため • エミュレータも不要 • => ⾼レイヤーな部分を作るのに最適 10
課題点 • 学習を⽬的に設計実装されていない • コードが不親切だったり • コードの説明がなかったり • 汎⽤OSでは必須な機能の実装がない •
マルチタスク • ユーザ空間とカーネル空間の分離 • =>どこに興味があるかに依存 11
実例 12
Unikraft 13
Linux Kernel Library 14 • vanillaなLinux Kernelがユーザ空 間で動作 • ホスト固有の
コードは綺麗に 分離 • mutex/semaphore /thread/block rw etc. • arch/lkl
LKL on Unikraft 15 uk-host.o lkl.o LKL App unikraft_linuxu_x86_64 liblkl
LK mutex.o thread.o timer.o
LKL on Unikraftデモ 16 $ ./build/boot_linuxu-x86_64 Welcome to _ __
_____ __ _____ (_) /__ _______ _/ _/ /_ / // / _ \/ / '_// __/ _ `/ _/ __/ \_,_/_//_/_/_/\_\/_/ \_,_/_/ \__/ Titan 0.2~51691ea /* snip */ [ 0.000000] Linux version 4.17.0+ (
[email protected]
) (gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC)) #1 Thu Jan 10 14:04:16 JST 2019 /* snip */ [ 0.000000] This architecture does not have kernel memory protection. lkl_start_kernel(&lkl_host_ops, "mem=16M loglevel=8") = 0 /* snip */