SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 

What's hot (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
 

Similar to [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
 

Similar to [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
 

Recently uploaded

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
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

[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.