[TALK] Exokernel vs. Microkernel

Hawx Chen
Hawx ChenSenior Software Engineer at Mstar Semiconductor
陳膺正 (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
1 of 26

Recommended

Application Performance & Flexibility on Exokernel Systems paper review by
Application Performance & Flexibility on Exokernel Systems paper reviewApplication Performance & Flexibility on Exokernel Systems paper review
Application Performance & Flexibility on Exokernel Systems paper reviewVimukthi Wickramasinghe
1.8K views37 slides
Application Performance and Flexibility on ExoKernel Systems by
Application Performance and Flexibility on ExoKernel SystemsApplication Performance and Flexibility on ExoKernel Systems
Application Performance and Flexibility on ExoKernel SystemsWSO2
856 views24 slides
Memory_AllocationUNIX_MINIX-COSCUP2012 by
Memory_AllocationUNIX_MINIX-COSCUP2012Memory_AllocationUNIX_MINIX-COSCUP2012
Memory_AllocationUNIX_MINIX-COSCUP2012Hawx Chen
1.7K views28 slides
Exokernel operating systems by
Exokernel operating systemsExokernel operating systems
Exokernel operating systemsGaurav Dalvi
3.4K views19 slides
Exokernel by
ExokernelExokernel
ExokernelAbu Azzam
1.5K views4 slides
In a monolithic kernel by
In a monolithic kernelIn a monolithic kernel
In a monolithic kernelTeja Bheemanapally
1K views2 slides

More Related Content

What's hot

Hybrid kernel by
Hybrid kernelHybrid kernel
Hybrid kernelAbu Azzam
3.3K views6 slides
Microkernel-based operating system development by
Microkernel-based operating system developmentMicrokernel-based operating system development
Microkernel-based operating system developmentSenko Rašić
2K views33 slides
Linux kernel architecture by
Linux kernel architectureLinux kernel architecture
Linux kernel architectureTeja Bheemanapally
9K views52 slides
Linux kernel Architecture and Properties by
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSadiqur Rahman
2.3K views16 slides
Browsing Linux Kernel Source by
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel SourceMotaz Saad
7K views40 slides
Architecture Of The Linux Kernel by
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernelguest547d74
2.2K views17 slides

What's hot(20)

Hybrid kernel by Abu Azzam
Hybrid kernelHybrid kernel
Hybrid kernel
Abu Azzam3.3K views
Microkernel-based operating system development by Senko Rašić
Microkernel-based operating system developmentMicrokernel-based operating system development
Microkernel-based operating system development
Senko Rašić2K views
Linux kernel Architecture and Properties by Sadiqur Rahman
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
Sadiqur Rahman2.3K views
Browsing Linux Kernel Source by Motaz Saad
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
Motaz Saad7K views
Architecture Of The Linux Kernel by guest547d74
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
guest547d742.2K views
What is a Kernel? : Introduction And Architecture by pec2013
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecture
pec20134.1K views
Operating system kernal by Sumit Rajpal
Operating system kernalOperating system kernal
Operating system kernal
Sumit Rajpal3.4K views
Introduction To Linux Kernel Modules by dibyajyotig
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
dibyajyotig1.9K views
Microkernel by tushart324
MicrokernelMicrokernel
Microkernel
tushart3243.6K views
Linux Kernel Tour by samrat das
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
samrat das2K views
High Performance Storage Devices in the Linux Kernel by Kernel TLV
High Performance Storage Devices in the Linux KernelHigh Performance Storage Devices in the Linux Kernel
High Performance Storage Devices in the Linux Kernel
Kernel TLV4.9K views
Linux architecture by mcganesh
Linux architectureLinux architecture
Linux architecture
mcganesh49.8K views

Similar to [TALK] Exokernel vs. Microkernel

L4 Microkernel :: Design Overview by
L4 Microkernel :: Design OverviewL4 Microkernel :: Design Overview
L4 Microkernel :: Design OverviewNational Cheng Kung University
11.8K views74 slides
Microkernels and Beyond by
Microkernels and BeyondMicrokernels and Beyond
Microkernels and BeyondDavid Evans
5.4K views61 slides
Inside the Mac OS X Kernel by
Inside the Mac OS X KernelInside the Mac OS X Kernel
Inside the Mac OS X KernelOpenSlidesArchive
2.1K views74 slides
Microkernel Evolution by
Microkernel EvolutionMicrokernel Evolution
Microkernel EvolutionNational Cheng Kung University
7.3K views120 slides
introduction.pdf by
introduction.pdfintroduction.pdf
introduction.pdfxiso
11 views40 slides
Japan's post K Computer by
Japan's post K ComputerJapan's post K Computer
Japan's post K Computerinside-BigData.com
1K views16 slides

Similar to [TALK] Exokernel vs. Microkernel(20)

Microkernels and Beyond by David Evans
Microkernels and BeyondMicrokernels and Beyond
Microkernels and Beyond
David Evans5.4K views
introduction.pdf by xiso
introduction.pdfintroduction.pdf
introduction.pdf
xiso11 views
Journal Seminar: Is Singularity-based Container Technology Ready for Running ... by Kento Aoyama
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 ...
Kento Aoyama816 views
Présentation d'Unikernel by Proto204
Présentation d'UnikernelPrésentation d'Unikernel
Présentation d'Unikernel
Proto204945 views
Lec 10-linux-review by abinaya m
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
abinaya m91 views
My amazing journey from mainframes to smartphones chm lecture aug 2014 final by Dileep Bhandarkar
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
Dileep Bhandarkar4.6K views
Linux Kernel Exploitation by Scio Security
Linux Kernel ExploitationLinux Kernel Exploitation
Linux Kernel Exploitation
Scio Security5.4K views
Linux Perf Tools by Raj Pandey
Linux Perf ToolsLinux Perf Tools
Linux Perf Tools
Raj Pandey53 views
Evolution of the Windows Kernel Architecture, by Dave Probert by yang
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
yang3.3K views
The linux kernel hidden inside windows 10 by mark-smith
The linux kernel hidden inside windows 10The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10
mark-smith2.1K views
Fedora Virtualization Day: Linux Containers & CRIU by Andrey Vagin
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIU
Andrey Vagin3K views

Recently uploaded

Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...ShapeBlue
83 views15 slides
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
46 views35 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
58 views21 slides
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITShapeBlue
91 views8 slides
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...ShapeBlue
54 views15 slides
DRBD Deep Dive - Philipp Reisner - LINBIT by
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBITShapeBlue
62 views21 slides

Recently uploaded(20)

Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue83 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue91 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue54 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue62 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely56 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue56 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro29 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software344 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue102 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu141 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays40 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue145 views

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