Microkernels and Client- Server Architectures

Similar documents
Microkernels In a Bit More Depth

Chapter 5: Microkernels and fast local IPC Advanced Operating Systems ( L)

Microkernels In a Bit More Depth

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

MICROKERNELS IN A BIT MORE DEPTH

OS concepts and structure. q OS components & interconnects q Structuring OSs q Next time: Processes

The Performance of µ-kernel-based Systems

Operating System Architecture. CS3026 Operating Systems Lecture 03

ELEC 377 Operating Systems. Week 1 Class 2

Microkernels: From Mach to sel4 (Lecture 8, cs262a) Ion Stoica, UC Berkeley September 21, 2016

Operating System Support

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

CS533 Concepts of Operating Systems. Jonathan Walpole

OS DESIGN PATTERNS II. CS124 Operating Systems Fall , Lecture 4

Microkernels. Overview. Required reading: Improving IPC by kernel design

Process Description and Control

CS 261 Fall Mike Lam, Professor. Virtual Memory

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

Machine-Independent Virtual Memory Management for Paged June Uniprocessor 1st, 2010and Multiproce 1 / 15

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

OS Extensibility: Spin, Exo-kernel and L4

Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

Operating System Kernels

CSE473/Spring st Midterm Exam Tuesday, February 19, 2007 Professor Trent Jaeger

COS 318: Operating Systems

A Comparison of Two Distributed Systems: Amoeba & Sprite. By: Fred Douglis, John K. Ousterhout, M. Frans Kaashock, Andrew Tanenbaum Dec.

COS 318: Operating Systems

Operating System Structure

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18

Cute Tricks with Virtual Memory

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

Applications, services. Middleware. OS2 Processes, threads, Processes, threads, communication,... communication,... Platform

Chapter 3: Processes. Operating System Concepts 8th Edition

SPIN Operating System

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011

Virtual Memory Oct. 29, 2002

Advanced Operating Systems. COMP9242 Introduction

Real Time and Embedded Systems. by Dr. Lesley Shannon Course Website:

Operating System Structure

Advanced Operating Systems. COMP9242 Introduction

MICROKERNELS: MACH AND L4

Mac OS X. Mach in the Darwin Kernel. COMP342 4/5/06

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Computer Systems Engineering: Spring Quiz I Solutions

Motivations for Virtual Memory Virtual Memory Oct. 29, Why VM Works? Motivation #1: DRAM a Cache for Disk

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Microkernel Construction. Introduction. Michael Hohmuth. Lars Reuther. TU Dresden Operating Systems Group

Opal. Robert Grimm New York University

Operating Systems Structure. Otto J. Anshus

Staff. Advanced Operating Systems. Why are you here? What can you expect?

Introduction. COMP /S2 Week Gernot Heiser UNSW/NICTA/OKL. Distributed under Creative Commons Attribution License 1

@2010 Badri Computer Architecture Assembly II. Virtual Memory. Topics (Chapter 9) Motivations for VM Address translation

Staff. Advanced Operating Systems. Why are you here? What can you expect?

Introduction. COMP9242 Advanced Operating Systems 2010/S2 Week 1

Process. Program Vs. process. During execution, the process may be in one of the following states

CHAPTER 3 - PROCESS CONCEPT

CS370 Operating Systems

Distributed Systems. Definitions. Why Build Distributed Systems? Operating Systems - Overview. Operating Systems - Overview

0x1A Great Papers in Computer Security

Chapter 14: Protection. Operating System Concepts 9 th Edition

Operating System Support

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

Mach External pager. IPC Costs. Why the difference? Example of IPC Performance. First generation microkernels were slow Mach, Chorus, Amoeba

CISC 360. Virtual Memory Dec. 4, 2008

Process Scheduling Queues

Memory Management! How the hardware and OS give application pgms:" The illusion of a large contiguous address space" Protection against each other"

Operating Systems Structure and Processes Lars Ailo Bongo Spring 2017 (using slides by Otto J. Anshus University of Tromsø/Oslo)

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

Sistemi in Tempo Reale

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

CSE 4/521 Introduction to Operating Systems

Verteilte Systeme (Distributed Systems)

!! How is a thread different from a process? !! Why are threads useful? !! How can POSIX threads be useful?

Processes. CS 416: Operating Systems Design, Spring 2011 Department of Computer Science Rutgers University

Chapter 13: Protection. Operating System Concepts Essentials 8 th Edition

CSC 553 Operating Systems

6.033 Spring Lecture #6. Monolithic kernels vs. Microkernels Virtual Machines spring 2018 Katrina LaCurts

Archive material from Edition 3 of Distributed Systems: Concepts and Design CHAPTER CDK3 18

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

virtual memory Page 1 CSE 361S Disk Disk

Operating System Control Structures

Memory Protection. Machines and Virtualization. Architectural Foundations of OS Kernels. Memory and the CPU. Introduction to Virtual Addressing

CSC 5930/9010 Cloud S & P: Virtualization

OS Structure. Kevin Webb Swarthmore College January 25, Relevant xkcd:

Distributed File Systems Issues. NFS (Network File System) AFS: Namespace. The Andrew File System (AFS) Operating Systems 11/19/2012 CSC 256/456 1

Virtual Memory. Robert Grimm New York University

0. Course Overview. 8 Architecture models; network architectures: OSI, Internet and LANs; interprocess communication III. Time and Global States

Machines and Virtualization. Systems and Networks Jeff Chase Spring 2006

Lecture 4: Memory Management & The Programming Interface

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

Outline. Interprocess Communication. Interprocess Communication. Communication Models: Message Passing and shared Memory.

Memory Management! Goals of this Lecture!

Threads, SMP, and Microkernels. Chapter 4

CS 390 Chapter 2 Homework Solutions

Transcription:

Microkernels and Client- Server Architectures I m not interested in making devices look like user-level. They aren t, they shouldn t, and microkernels are just stupid. Linus Torwalds 1

Motivation Early operating systems had very little structure. A strictly layered approach was promoted by [Dijkstra, 1968]. Later OS (more or less) followed that approach (e.g., Unix). PROBLEMS WITH LAYERED APPROACH Widening range of services and applications OS bigger, more complex, slower, more error prone. Need to support same OS on different hardware. Like to support various OS environments. Distribution impossible to provide all services from same (local) kernel. 2

Idea: Break Up the OS 3

Monolithic versus Client- Server OS Structure 4

KERNEL: Contains code which must run in supervisor mode; Isolates hardware dependence from higher levels; Is small and fast extensible system; Kernel provides mechanisms. USER-LEVEL SERVERS: Are hardware independent/portable, Provide OS environment / OS personality (maybe several), May be invoked: from application (via message-passing IPC) from kernel (upcalls); Servers implement policies [Brinch Hansen, 1970]. 5

Down Call vs. Upcall unprivileged code enters kernel mode implemented via trap privileged code enters user mode implemented via IPC or callback 6

Early example: Hydra Separation of mechanism from policy e.g. protection vs. security No hierarchical layering of kernel. Viewed layering as an unnecessary restriction Protection, even within OS. Uses (segregated) capabilities. Objects, encapsulation, units of protection. Objects have a type associated with them. Includes a procedure type, which can be associated with object Created indirectly via the representative of that type Can create new types by creating a new representative Unique object name, no ownership. Object persistence based on reference counting [Wulf et al., 1974]. 7

Hydra can be considered the first object-oriented OS; has been called the first microkernel OS; has had enormous influence on later operating systems research; was never widely used even at CMU because of poor performance, lack of a complete environment. 8

Popular Example: Mach Developed at CMU by Rashid and others [Rashid et al., 1988] from 1984 successor of Accent [Fitzgerald and Rashid, 1986] and RIG [Rashid, 1988]. GOALS: Tailorability: support different OS interfaces. Portability: almost all code H/W independent. Real-time capability. Multiprocessor and distribution support. Security. Coined term microkernel. 9

Basic Features Of MACH Microkernel Task and thread management; interprocess communication (asynchronous message-passing); memory object management; system call redirection; device support; multiprocessor support. 10

MACH Basic Abstractions 11

MACH Tasks And Threads Task consists of one or more threads. Task provides address space and other environment. Thread is active entity (basic unit of CPU utilisation). Threads have own stacks, are kernel scheduled. Threads may run in parallel on multiprocessor. Privileged user-state program may be used to control scheduling. Task created from blueprint with empty or inherited address space. Activated by creating a thread in it. 12

MACH IPC: Ports Addressing based on ports: port is a mailbox, allocated/destroyed via a system call; has a fixed-size message queue associated with it; is protected by (segregated) capabilities; has exactly one receiver, but possibly many senders; can have send-once capability to a port. Can pass the receive capability for a port to another process give up read access to the port. Kernel detects ports without senders or receiver. Processes may have many ports (UNIX server has 2000!) Ports can be grouped into port sets. Allows listening to many ports (like select()) Send blocks if queue is full except with send-once cap (used for server replies) 13

MACH IPC: Messages Segregated capabilities: threads refer to them via local indices. kernel marshalls capabilities in messages. message format must identify caps Message contents: Send capability to destination port (mandatory) used by kernel to validate operation; optional send capability to reply port for use by receiver to send reply possibly other capabilities; in-line (by-value) data; out-of-line (by reference) data, using copy-on-write, may contain whole address spaces; 14

MACH Ports and Messages 15

MACH Message Transfer 16

MACH Virtual Memory Management Address space constructed from memory regions initially empty populated by: explicit allocation explicitly mapping a memory object; inheriting from blueprint (as in Linux clone()), inheritance: not, shared or copied; allocated automatically by kernel during IPC when passing by-reference parameters; sparse virtual memory use (unlike UNIX). 3 page states: unallocated, allocated & unreferenced, allocated & initialised 17

Copy-on-write In MACH When data is copied ( blueprint or passed by-reference): source and destination share single copy, both virtual pages are mapped to the same frame. Marked as read-only. When one copy is modified, a fault occurs. Handling by kernel involves making a physical copy is made, VM mapping is changed to refer to the new copy. Advantage: efficient way of sharing/passing large amounts of data. Drawbacks: expensive for small amounts of data (page table manipulations) data must be properly aligned 18

MACH Address Maps Address spaces represented as address maps: Any part of AS can be mapped to (part of) a memory object Compact representation of sparse address spaces Compare to multi-level page tables? 19

20

Memory Objects Kernel doesn t support file system Memory objects are an abstraction of secondary storage: can be mapped into virtual memory are cached by the kernel in physical memory pager invoked if uncached page is touched used by file system server to provide data Support data sharing by mapping objects into several address spaces Memory is only cache for memory objects 21

User-Level Page Fault Handlers All actual I/O performed by pager; can be default pager (provided by kernel), or external pager, running at user-level. Intrinsic page fault cost: 2 IPCs 22

Handling Page Faults 1. Check protection & locate memory object uses address map 2. Check cache, invoke pager if cache miss uses a hashed page table 3. Check copy-on-write perform physical copy if write fault 4. Enter new mapping into H/W page tables. 23

Remote Communication Client A sends message to server B on remote node. 1. A sends message to local proxy port for B s receive port 2. User-level network message server receives from proxy port 3. NMS converts proxy port into (global) network port. 4. NMS sends message to NMS on B s node may need conversion (byte order...) 5. Remote NMS converts network port into local port (B s). 6. Remote NMS sends message to that port. 24

Remote Communication 25

MACH UNIX Emulation emulation library in user address space handles IPC invoked by system call redirection (trampoline mechanism) supports binary compatibility 26

MACH = Microkernel? Most OS services implemented at user level using memory objects and external pagers Provides mechanisms, not policies. Mostly hardware independent. 140 system calls. Size: 200k instructions. Performance??? tendency to move features into kernel Served as basis for OSF/1, MacOS X... Further information on Mach: [Young et al., 1987; Coulouris, 1994; Sinha, 1997] 27

Chorus Developed at INRIA, France, from 1980 on. Commercialised by Chorus Systèmes in 1988. Basic ideas similar to Mach Servers can be: user-level, dynamically loaded into kernel (to save system call costs). Support for group communication (multicast, any of a group). Like Mach, kernel threads, port groups. Uses password capabilities but servers use ACL based protection. Uses copy-on-write, but receiver controls placement of data. 28

Chorus UNIX Emulation System call redirection to server(s) All UNIX emulation in server (to avoid protection problems) Further information in [Dean and Armand, 1992; Rozier et al., 1990; Rozier et al., 1992; Coulouris, 1994; Sinha, 1997]. 29

Other Client-Server Systems Lots. Most notable systems: Amoeba: Mullender, Tanenbaum (early 1980 s) [Tanenbaum and Mullender, 1981; Tanenbaum and Mullender, 1984; Mullender and Tanenbaum 1986]. Windows NT: Microsoft (early 1990 s) [Custer, 1993]. 30