SlideShare ist ein Scribd-Unternehmen logo
1 von 26
陳膺正 (Hawx Chen )
yingjheng.chen@gmail.com
http://hawxchen.blogspot.tw
Exokernel
vs.
Microkernel
Who Am I
• Experience
– 2008 NCTU CS Bachelor
– 2010 NTU CSIE Master
– 2010~presnet MStar Semiconductor
• Senior software engineer
• Talk:
– 2012 COSCUP.
– 2013 COSCUP.
• Open Source
– https://github.com/HawxChen/MIT-6.828-Adventure
Enjoy to implement OS.
Outline
• Importance of History
• Base Arch
• Exokernel Principle
• Example: page handling
• Geek Part
Outline
• Importance of History
• Base Arch
• Exokernel Principle
• Example: page handling
• Geek Part
Importance of History
Unics UNIXv6
MINIXMTS
LinuxBSD
L4
1975
Exokernel
199519871967
1969 1978 1991
Time
Importance of history
A.D 1967
Hardware
Importance of history
Hardware
Exokernel
LibOS
App
LibOS’
App’
LibOS’’
App’’
Pager Swapper Ignore
pag e fault
A.D 1995
User mode
Kernel mode
Outline
• Importance of History
• Base Arch
• Exokernel Principle
• Example: page handling
• Geek Part
UNIX Arch
User Process
System Call
Interface (Library Routines)
User Process
Hardware
Process
Management
Memory
Management File
System
I/O Services
Scheduler
I/O Buffers
Device
Drivers
Kernel Space
MINIX Arch
Kernel Space
Scheduler/ message passing Memory copy
Exokernel Arch: Aegis/ExOS
Kernel Space
Libs’Libs
ExOS has
TCP, IPC, and FS.
App App’
ExOS’ has
VM, POSIX, and
Scheduler.
Libs’’
ExOS’’ has
Timer Service
Routine.
App’’
Disk TLB Network Memory Frame buffer
Resource
Allocation
Resource
Revocation
Information
Query Protection
Outline
• Importance of History
• Base Arch
• Exokernel Principle and Design
• Example: page handling
• Geek Part
Exokernel Principle
1. Separate protection from management
2. Expose Names
3. Expose allocation
4. Expose Revocation
5. Expose Information
Library Operating System
(Replaceable )
Exokernel Approach
VMIPC
Traps
Vecs
Distributed Shared
MemoryWWW
POSIX TCP
Disk TLB Network Memory Frame buffer
Mosaic Barnes-HutApps
Library
Kernel
HW
Expose allocation/revocation/names/information,
and Support Protection
Exokernel Approach
VMIPC
Traps
Vecs
Distributed Shared
Memory
WWW
POSIX TCP
Expose allocation/revocation/names/information,
and Support Protection
Disk TLB Network Memory Frame buffer
Mosaic Barnes-Hut
CPL = 3
CPL = 0
Library Operating System
(Replaceable )
Apps
Library
Kernel
HW
Design: Monolithic kernel
Hardware
Scheduler
Timer Services
IPC, Signal, System Calls,
POSIX
File Systems: ext2, ext3, NFS,… etc. VFS
Memory manager.
…
…
Device drivers
Proc1 Proc2 Proc3 Proc4 Proc5 Proc6 Proc7
Kernel Space
Design: Microkernel
Hardware
Kernel Space
Design: Exokernel
WWW
POSIX TCP
Expose allocation/revocation/names/information,
and Support Protection
Mosaic
VMIPC
Traps
Distributed Shared
Memory
Barnes-Hut
Kernel Space
Hardware
Outline
• Importance of History
• Base Arch
• Exokernel Principle
• Example: page handling
• Geek Part
Exokernel Way
Page fault
Exception
Page Fault Handler
LibOS
App
Pager
LibOS
App
Pager: Now
You See Me.(
Exception
Vector Table
Hardware
Exokernel
………….
………….
………….
………….
………….
1. Trigger the page fault
exception
2. Query exception vector
table
3. Page fault handler (trick)
4. Translate to real pager
5. Allocate a free page
6. Map
7. UnMap
8. Adjust the stack (trick)
9. Return to the fault
happening instruction
CPL = 3
CPL = 0
Outline
• Importance of History
• Base Arch
• Exokernel Principle
• Example: page handling
• Geek Part
Geek Part
• Make page fault handler execute in user mode.
– Expose something out of kernel
– The stack trick
• Implementation:
– https://github.com/HawxChen/MIT-6.828-
Adventure/tree/lab4
Stack
Page Fault Happening.
WWW
POSIX
TCP
Expose allocation/revocation/names/information,
and Support Protection
Disk TLB Network Memory Frame buffer
Mosaic
Apps
Library Operating System
(Replaceable )
Exokernel
HW
CPL=3
CPL=0User Context
Pager
0xEEEEEEEE: esp
0xBBBBBBBB:esp
0x00001688:eip
&(pager):eip
EIP: 0x00001688
-> &(pager):eip
ESP: 0xEEEEEEEE
-> 0xBBBBBBBB Page fault
handler
Page fault handler (trick)
Adjust the stack (trick)
0x00001688:eip
ret
Conclusion
• App and OS co-design.
• Application driven design.
• Don’t limit app’s scalability.
– Everyone is ambitious.
Reference
Thanks

Weitere ähnliche Inhalte

Was ist angesagt?

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 

Was ist angesagt? (20)

Hybrid kernel
Hybrid kernelHybrid kernel
Hybrid kernel
 
Microkernel-based operating system development
Microkernel-based operating system developmentMicrokernel-based operating system development
Microkernel-based operating system development
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
 
What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecture
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Microkernel
MicrokernelMicrokernel
Microkernel
 
Monolithic kernel
Monolithic kernelMonolithic kernel
Monolithic kernel
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
High Performance Storage Devices in the Linux Kernel
High Performance Storage Devices in the Linux KernelHigh Performance Storage Devices in the Linux Kernel
High Performance Storage Devices in the Linux Kernel
 
2. microkernel new
2. microkernel new2. microkernel new
2. microkernel new
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Architecture of Linux
 Architecture of Linux Architecture of Linux
Architecture of Linux
 
Microkernel design
Microkernel designMicrokernel design
Microkernel design
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 

Ähnlich wie [TALK] Exokernel vs. Microkernel

Fedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIU
Andrey Vagin
 

Ähnlich wie [TALK] Exokernel vs. Microkernel (20)

L4 Microkernel :: Design Overview
L4 Microkernel :: Design OverviewL4 Microkernel :: Design Overview
L4 Microkernel :: Design Overview
 
Microkernels and Beyond
Microkernels and BeyondMicrokernels and Beyond
Microkernels and Beyond
 
Inside the Mac OS X Kernel
Inside the Mac OS X KernelInside the Mac OS X Kernel
Inside the Mac OS X Kernel
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
introduction.pdf
introduction.pdfintroduction.pdf
introduction.pdf
 
Japan's post K Computer
Japan's post K ComputerJapan's post K Computer
Japan's post K Computer
 
Journal Seminar: Is Singularity-based Container Technology Ready for Running ...
Journal Seminar: Is Singularity-based Container Technology Ready for Running ...Journal Seminar: Is Singularity-based Container Technology Ready for Running ...
Journal Seminar: Is Singularity-based Container Technology Ready for Running ...
 
Présentation d'Unikernel
Présentation d'UnikernelPrésentation d'Unikernel
Présentation d'Unikernel
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
μ-Kernel Evolution
μ-Kernel Evolutionμ-Kernel Evolution
μ-Kernel Evolution
 
My amazing journey from mainframes to smartphones chm lecture aug 2014 final
My amazing journey from mainframes to smartphones  chm lecture aug 2014 finalMy amazing journey from mainframes to smartphones  chm lecture aug 2014 final
My amazing journey from mainframes to smartphones chm lecture aug 2014 final
 
Linux Kernel Exploitation
Linux Kernel ExploitationLinux Kernel Exploitation
Linux Kernel Exploitation
 
Linux Perf Tools
Linux Perf ToolsLinux Perf Tools
Linux Perf Tools
 
Oct2009
Oct2009Oct2009
Oct2009
 
Evolution of the Windows Kernel Architecture, by Dave Probert
Evolution of the Windows Kernel Architecture, by Dave ProbertEvolution of the Windows Kernel Architecture, by Dave Probert
Evolution of the Windows Kernel Architecture, by Dave Probert
 
The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10
 
Fedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIU
 
CERNBox: Site Report
CERNBox: Site ReportCERNBox: Site Report
CERNBox: Site Report
 
2. Vagin. Linux containers. June 01, 2013
2. Vagin. Linux containers. June 01, 20132. Vagin. Linux containers. June 01, 2013
2. Vagin. Linux containers. June 01, 2013
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

[TALK] Exokernel vs. Microkernel

  • 1. 陳膺正 (Hawx Chen ) yingjheng.chen@gmail.com http://hawxchen.blogspot.tw Exokernel vs. Microkernel
  • 2. Who Am I • Experience – 2008 NCTU CS Bachelor – 2010 NTU CSIE Master – 2010~presnet MStar Semiconductor • Senior software engineer • Talk: – 2012 COSCUP. – 2013 COSCUP. • Open Source – https://github.com/HawxChen/MIT-6.828-Adventure Enjoy to implement OS.
  • 3. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  • 4. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  • 5. Importance of History Unics UNIXv6 MINIXMTS LinuxBSD L4 1975 Exokernel 199519871967 1969 1978 1991 Time
  • 8. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  • 9. UNIX Arch User Process System Call Interface (Library Routines) User Process Hardware Process Management Memory Management File System I/O Services Scheduler I/O Buffers Device Drivers Kernel Space
  • 10. MINIX Arch Kernel Space Scheduler/ message passing Memory copy
  • 11. Exokernel Arch: Aegis/ExOS Kernel Space Libs’Libs ExOS has TCP, IPC, and FS. App App’ ExOS’ has VM, POSIX, and Scheduler. Libs’’ ExOS’’ has Timer Service Routine. App’’ Disk TLB Network Memory Frame buffer Resource Allocation Resource Revocation Information Query Protection
  • 12. Outline • Importance of History • Base Arch • Exokernel Principle and Design • Example: page handling • Geek Part
  • 13. Exokernel Principle 1. Separate protection from management 2. Expose Names 3. Expose allocation 4. Expose Revocation 5. Expose Information
  • 14. Library Operating System (Replaceable ) Exokernel Approach VMIPC Traps Vecs Distributed Shared MemoryWWW POSIX TCP Disk TLB Network Memory Frame buffer Mosaic Barnes-HutApps Library Kernel HW Expose allocation/revocation/names/information, and Support Protection
  • 15. Exokernel Approach VMIPC Traps Vecs Distributed Shared Memory WWW POSIX TCP Expose allocation/revocation/names/information, and Support Protection Disk TLB Network Memory Frame buffer Mosaic Barnes-Hut CPL = 3 CPL = 0 Library Operating System (Replaceable ) Apps Library Kernel HW
  • 16. Design: Monolithic kernel Hardware Scheduler Timer Services IPC, Signal, System Calls, POSIX File Systems: ext2, ext3, NFS,… etc. VFS Memory manager. … … Device drivers Proc1 Proc2 Proc3 Proc4 Proc5 Proc6 Proc7 Kernel Space
  • 18. Design: Exokernel WWW POSIX TCP Expose allocation/revocation/names/information, and Support Protection Mosaic VMIPC Traps Distributed Shared Memory Barnes-Hut Kernel Space Hardware
  • 19. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  • 20. Exokernel Way Page fault Exception Page Fault Handler LibOS App Pager LibOS App Pager: Now You See Me.( Exception Vector Table Hardware Exokernel …………. …………. …………. …………. …………. 1. Trigger the page fault exception 2. Query exception vector table 3. Page fault handler (trick) 4. Translate to real pager 5. Allocate a free page 6. Map 7. UnMap 8. Adjust the stack (trick) 9. Return to the fault happening instruction CPL = 3 CPL = 0
  • 21. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  • 22. Geek Part • Make page fault handler execute in user mode. – Expose something out of kernel – The stack trick • Implementation: – https://github.com/HawxChen/MIT-6.828- Adventure/tree/lab4
  • 23. Stack Page Fault Happening. WWW POSIX TCP Expose allocation/revocation/names/information, and Support Protection Disk TLB Network Memory Frame buffer Mosaic Apps Library Operating System (Replaceable ) Exokernel HW CPL=3 CPL=0User Context Pager 0xEEEEEEEE: esp 0xBBBBBBBB:esp 0x00001688:eip &(pager):eip EIP: 0x00001688 -> &(pager):eip ESP: 0xEEEEEEEE -> 0xBBBBBBBB Page fault handler Page fault handler (trick) Adjust the stack (trick) 0x00001688:eip ret
  • 24. Conclusion • App and OS co-design. • Application driven design. • Don’t limit app’s scalability. – Everyone is ambitious.