http://hawxchen.blogspot.tw/2013/08/talk-exokernel-vs-microkernel.html
I presented this slide at COSCUP 2013 with about 1500 attendees in Taiwan.
I focus on introduction for Exokernel's design and comparison between other kernels, like Microkernel.
Hawx ChenSenior Software Engineer at Mstar Semiconductor
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
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
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.