Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[TALK] Exokernel vs. Microkernel

7,065 views

Published on

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.

Published in: Technology, Education

[TALK] Exokernel vs. Microkernel

  1. 1. 陳膺正 (Hawx Chen ) yingjheng.chen@gmail.com http://hawxchen.blogspot.tw Exokernel vs. Microkernel
  2. 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. 3. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  4. 4. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  5. 5. Importance of History Unics UNIXv6 MINIXMTS LinuxBSD L4 1975 Exokernel 199519871967 1969 1978 1991 Time
  6. 6. Importance of history A.D 1967 Hardware
  7. 7. Importance of history Hardware Exokernel LibOS App LibOS’ App’ LibOS’’ App’’ Pager Swapper Ignore pag e fault A.D 1995 User mode Kernel mode
  8. 8. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  9. 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. 10. MINIX Arch Kernel Space Scheduler/ message passing Memory copy
  11. 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. 12. Outline • Importance of History • Base Arch • Exokernel Principle and Design • Example: page handling • Geek Part
  13. 13. Exokernel Principle 1. Separate protection from management 2. Expose Names 3. Expose allocation 4. Expose Revocation 5. Expose Information
  14. 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. 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. 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
  17. 17. Design: Microkernel Hardware Kernel Space
  18. 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. 19. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  20. 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. 21. Outline • Importance of History • Base Arch • Exokernel Principle • Example: page handling • Geek Part
  22. 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. 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. 24. Conclusion • App and OS co-design. • Application driven design. • Don’t limit app’s scalability. – Everyone is ambitious.
  25. 25. Reference
  26. 26. Thanks

×