1 Micro-kernel. 2 Key points Microkernel provides minimal abstractions –Address space, threads, IPC Abstractions –… are machine independent –But implementation.

Slides:



Advertisements
Similar presentations
Slide 19-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 19.
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Improving IPC by Kernel Design Jochen Liedtke Slides based on a presentation by Rebekah Leslie.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
MICRO-KERNELS New Generation Innovation. The contents Traditional OS view & its problems. Micro-kernel : introduction to concept. First generation micro-kernels.
Outline of the Paper Introduction. Overview Of L4. Design and Implementation Of Linux Server. Evaluating Compatibility Performance. Evaluating Extensibility.
Memory Management Paging &Segmentation CS311, CS350 & CS550.
Chorus Vs Unix Operating Systems Overview Introduction Design Principles Programmer Interface User Interface Process Management Memory Management File.
1.1 Advanced Operating Systems  -kernels The idea of  -kernel is minimizing the kernel. I.e. implementing outside the kernel whatever possible. The 
Advanced Operating Systems
Computer Systems/Operating Systems - Class 8
Presented By Srinivas Sundaravaradan. MACH µ-Kernel system based on message passing Over 5000 cycles to transfer a short message Buffering IPC L3 Similar.
CS533 Concepts of Operating Systems Class 20 Summary.
Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Improving IPC by Kernel Design Jochen Liedtke Presented by Ahmed Badran.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
3.5 Interprocess Communication
Improving IPC by Kernel Design Jochen Liedtke Shane Matthews Portland State University.
Microkernels: Mach and L4
Early OS security Overview by: Greg Morrisett Cornell University, Edited (by permission) for CSUS CSc250 by Bill Mitchell.
Exokernel: An Operating System Architecture for Application-Level Resource Management Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr. M.I.T.
The Structure of the “THE” -Multiprogramming System Edsger W. Dijkstra Jimmy Pierce.
MicrokernelsCS-502 (EMC) Fall Microkernels CS-502, Operating Systems Fall 2009 (EMC) (Slides include materials from Modern Operating Systems, 3 rd.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CS533 Concepts of OS Class 16 ExoKernel by Constantia Tryman.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
COP 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
CS533 Concepts of Operating Systems Jonathan Walpole.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Lecture 19: Virtual Memory
IT253: Computer Organization
The Performance of Microkernel-Based Systems
CS533 Concepts of Operating Systems Jonathan Walpole.
The Performance of Micro-Kernel- Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presentation by: Seungweon Park.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day14:
Virtual Memory Part 1 Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology May 2, 2012L22-1
Processes Introduction to Operating Systems: Module 3.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
The Performance of μ-Kernel-Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presenter: Sunita Marathe.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
The Performance of Micro-Kernel- Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presentation by: Tim Hamilton.
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Advanced Operating Systems (CS 202) Extensible Operating Systems (II) Jan, 13, 2016.
Low Overhead Real-Time Computing General Purpose OS’s can be highly unpredictable Linux response times seen in the 100’s of milliseconds Work around this.
Introduction to Operating Systems Concepts
Memory Management Paging (continued) Segmentation
CS 6560: Operating Systems Design
Memory Caches & TLB Virtual Memory
Memory Management Paging (continued) Segmentation
COP 4600 Operating Systems Spring 2011
Improving IPC by Kernel Design
Process Description and Control
Improving IPC by Kernel Design
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Process Description and Control
Improving IPC by Kernel Design
Operating Systems: A Modern Perspective, Chapter 3
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CSE 471 Autumn 1998 Virtual memory
Operating Systems Structure
Memory Management Paging (continued) Segmentation
Operating Systems Structure
Presentation transcript:

1 Micro-kernel

2 Key points Microkernel provides minimal abstractions –Address space, threads, IPC Abstractions –… are machine independent –But implementation is hardware dependent Myths about inefficiency of micro-kernel stem from inefficient implementation and not from microkernel approach

3 What abstractions? Determining criterion: –Functionality not performance Hardware and microkernel should be trusted but applications are not –Hardware provides page-based virtual memory –Kernel builds on this to provide protection for services above and outside the microkernel Principles of independence and integrity –Subsystems independent of one another –Integrity of channels between subsystems protected from other subsystems

4 Microkernel Concepts Hardware mapping provides address space –from virtual page to a physical page –implemented by page tables and TLB Microkernel concept of address spaces –Hides the hardware address spaces and provides an abstraction that supports Grant? Map? Flush? –These primitives allows building a hierarchy of protected address spaces

5 Grant, Map and Flush

6 Power and flexibility of address spaces –Initial memory manager for address space A0 appears by magic and encompasses the physical memory –Allow creation of stackable memory managers (all outside the kernel) –Pagers can be part of a memory manager or outside the memory manager –All address space changes (map, grant, flush) orchestrated via kernel for protection –Device driver can be implemented as a special memory manager outside the kernel as well

7 Microkernel processor M0, A0, P0 PT M1, A1, P1 PT M2, A2, P2 PT Map/grant

8 Threads and IPC A thread executes in an address space –Associated (or represented by) PC, SP, processor registers, and state info (such as address space) IPC is cross-address-space communication –Supported by the microkernel Classic method is message passing between threads via the kernel –Sender sends info; receiver decides if it wants to receive it, and if so where –Address space operations such as map, grant, flush need IPC –Higher level communication (e.g. RPC) built on top of basic IPC

9 Interrupts? –Each hardware device is a thread from kernel’s perspective –Interrupt is a null message from a hardware thread to the software thread –Kernel transforms hardware interrupt into a message Does not know or care about the semantics of the interrupt Device specific interrupt handling outside the kernel Clearing hardware state (if privileged) then carried out by the kernel upon driver thread’s next IPC –TLB handler? In theory software TLB handler can be outside the microkernel In practice first level TLB handler inside the microkernel or in hardware

10 Unique IDs Kernel provides uid over space and time for –Threads –IPC channels

11 Breaking some performance myths Kernel-user switches Address space switches Thread switches and IPC Memory effects Base system: 486 (50 MHz) – 20 ns cycle time

12 Kernel-user switches Machine instruction for entering and exiting –107 cycles –Mach measures 900 cycles for kernel-user switch Why? –Empirical proof L3 kernel ~ 123 cycles (accounting for some TLB, cache misses) –Where did the remaining 800 cycles go in MACH? Kernel overhead (construction of the kernel, and inherent in the approach)

13 Address space switches TLBs Instruction and data caches –Usually physically tagged in most modern processors so TLB flush has no effect Address space switch –Complete reload of Pentium TLB ~ 864 cycles

14 Do we need a TLB flush always? –Implementation issue of “protection domains” –Liedtke suggests similar approach in the microkernel in an architecture-specific manner PowerPC: use segment registers => no flush Pentium or 486: share the linear hardware address space among several user address spaces => no flush –There are some caveats in terms of size of user space and how many can be “packed” in a 2**32 global space

15 Conclusions –Address space switching among medium or small protection domains can ALWAYS be made efficient by careful construction of the microkernel –Large address spaces switches are going to be expensive ALWAYS due to cache effects and TLB effects, so switching cost is not the most critical issue

16 Thread switches and IPC

17 Segment switch (instead of AS switch) makes cross domain calls cheap

18 Memory Effects – System

19 Capacity induced MCPI

20 Portability vs. Performance Microkernel on top of abstract hardware while portable –Cannot exploit hardware features –Cannot take precautions to avoid performance problems specific to an arch –Incurs performance penalty due to abstract layer

21 Examples of non-portability Same processor family –Use address space switch implementation TLB flush method preferable for 486 Segment register switch preferable for Pentium => 50% change of microkernel! –IPC implementation Details of the cache layout (associativity) requires different handling of IPC buffers in 486 and Pentium Incompatible processors –Exokernel on R4000 (tagged TLB) Vs. 486 (untagged TLB) => Microkernels are inherently non-portable

22 Summary Minimal set of abstractions in microkernel Microkernels are processor specific (at least in implementation) and non-portable Right abstractions and processor-specific implementation leads to efficient processor-independent abstractions at higher layers