extensible operating systems - cs.cornell.edu · extensible operating systems 9/29/11 8:25 pm...

27
9/29/11 8:25 PM Extensible Operating Systems Page 1 of 27 file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Extensible Operating Systems Shrutarshi Basu

Upload: others

Post on 14-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 1 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Extensible OperatingSystems

Shrutarshi Basu

Page 2: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 2 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Why Extensible Operating Systems?

Appel and Li — general purpose VM primitives impactperistent stores, GC and distributed shared memory

Cao et al. — application control over file caching reducesrunning time by 45%.

Harty and Cheriton and Krueger et al. — app-specific VMpolicies increase performance

Stonebraker — file-system implementations affectdatabase performance

Thekkath and Levy — exceptions made order ofmagnitude faster by deferring to applications

Page 3: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 3 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

What Can We Do?

VirtualizationMultiple guest operating systems inside a guest OS

MicrokernelsProvide the minimum amount of kernel mechanisms

ExokernelsExpose hardware resources as directly as possible

Extensible KernelsAllow guaranteed safe components into the kernel

Page 4: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 4 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Exokernels vs Extensible Kernels

Exokernels

Expose underlying hardware functionality

Kernel provides resource protection, not management

We'll look at Aegis and ExOS

Extensible Kernels

Provide a safe extension infrastructure

Provide a core set of extensible services

We'll look at SPIN

Page 5: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 5 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Exokernel: An OperatingSystem Architecture for

Application-Level ResourceManagement

Dawson R. Engler

M. Frans Kaashoek

James O'Toole

MIT Laboratory for Computer Science

Page 6: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 6 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

The People

Dawson R. Engler

MIT → Stanford (EE and CS)

ACM Grace Hopper Award & SIGOPS Mark WeiserAward

"If you know how to hack, we should meet."

M. Frans Kaashoek

Vrije Universiteit → MIT EECS (CSAIL)

NSF Young Investigator Award & SIGOPS Mark WeiserAward

James O'Toole Jr.

???

Page 7: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 7 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Problems and Solutions

The Problem

Fixing OS abstractions → limited performance, flexibilityand functionality

Denies the advantages of domain-specific optimizations

Discourages changes to existing abstractions

Restricts the flexibility of application builders

The Solution

Separate resource protection from management

Allow application level management of physicalresources

Exports hardware resources through low-level interfaces

Library operating systems implement services & policies

Page 8: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 8 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

The "End-to-end" argument

"The exokernel architecture is founded on andmotivated by a single, simple and old observation: thelower the level of a primitive, the more efficiently it canbe implemented, and the more latitude it grants toimplementors of higher-level abstractions".

Page 9: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 9 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Exokernel Design Principles

Securely expose hardwareAllow hardware resources to be accessed as directly as possible.

Expose allocationAllow libOS to request specific physical resources

Expose namesExport physical names removing a level of indirection

Expose revocationWell-behaved libOS can perform effective application-level resource management

Page 10: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 10 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Exokernel Design Techniques

Secure bindingsAllow libOS to securely bind to machine resources

Visible revocationAllow libOS to participate in resource revocation

Abort protocolBreak secure bindings of uncooperative libOS by force

Downloading codeDownloading code into the kernel for performance and bounding

Page 11: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 11 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Case Studies

Aegis: an exokernel supporting some system calls and"primitive operations"

ExOS: A libOS implementing IPC, VM and remote commat an application level

Page 12: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 12 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Aegis: System Call Interface

Yield — Yield processor to named process

Scall — Synchronous protected control transfer

Acall — Asynchronous protected control transfer

Alloc — Allocation of resources

Dealloc — Deallocation of resources

Page 13: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 13 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Aegis: Primitive Operations

TLBwr — Insert Mapping into TLB

FPUmod — Enable or disable FPU

CIDswitch — Install context identifier

TLBvadelete — Delete virtual address from TLB

Page 14: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 14 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Aegis: Resource Access

Processor time slices — CPU resources

Exception contexts — dispatch hardware exceptions toapplications

Address translations — virtual memory

Protected Control Translations — substrate for IPCabstractions

Page 15: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 15 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

ExOS: Abstractions

IPC Abstractionsbuilt atop of protected control transfer mechanisms

Application-level Virtual Memoryaliasing, sharing, caches, page allocation and DMA

Application-Specific Safe Handlersuntrusted message-handlers downloaded into kernel and verified via inspection and sandboxing

Page 16: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 16 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

ExOS: Extensibility

Remote Procedure Call — server managed registers

Page table structures — inverted page tables

Schedulers — application level stride scheduling

Performance comparison between standard ExOSabstractions and above mentioned custom ones

Page 17: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 17 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Performance EvaluationComparisons against Ultrix and between multiple library operating systems

Looking at the Paper …

Page 18: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 18 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Takeaways

Simple primitives allow for very efficient implementation

Low-level secure multiplexing of hardware isimplemented efficiently.

Traditional OS abstractions implemented efficiently bylibraries

Special-purpose implementations of abstractions bylibrary modification

Page 19: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 19 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Extensibility, Safety andPerformance in the SPIN

operating systemBershad, Savage, et al.

Department of Computer Science and Engineering, University of Washington

Page 20: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 20 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

The People

Brian N. Bershad

UC Berkeley → U. Washington → CMU → U.Washington

NSF Young Investigator Award & SIGOPS Mark WeiserAward

Appliant Inc and Illumita

Stefan Savage

CMU → U. Washington → UC San Diego

Asta Networks, Rendition Networks, Netsift (Cisco)

Page 21: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 21 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Overview

OS that can be dynamically specialized to be safely meetthe performance and functionality requirements ofapplications

Motivated by the need to support applicaions whosedemands are poorly matched by the OS implementationor interface

Page 22: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 22 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Design Techniques

ColocationOS extensions are dynamically linked into the kernel virtual address space

Enforced modularityExtensions cannot accesss memory or execute instruction unless explicitly given access via an interface

Logical protetion domainsKernel namespaces containing code and exported interfaces resolved by an in-kernel linker

Dynamic call bindingExtensions execute in response to system events

Page 23: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 23 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Related Work

Hydra: multi-level policies and capability basedprotection

Microkernels exporting a small number of abstractionsallowing application-specific extensions but with high-communication overhead

"Little languages" that allow interpreted code in thekernel

Software fault isolation to safely link arbitrary code intothe kernel's address space

Page 24: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 24 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Protection Model

Capabilities are unforgetable references to systemresources, implemented by pointers checked at compileto prevent illegal access

Protection domains define the set of accessible namesavailable to an execution context named by a capabilityand used to control dynamic linking.

Create, Resolve and Combine operations to managedomains

Page 25: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 25 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Extension Model

Extensions defined in terms of services and handlers

An event is a message that announces a change in thesystem state or a request for services.

An extension install a handler for the event via a centraldispatcher

Any procedure exported by an interface is also an event.

Primary right to handle an event is restricted to thedefault implementation that can arbitrate the installationof new handlers

Guards may be used to further restrict access to events

Page 26: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 26 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

Core Services

Extensible memory management – physical and virtualaddresses and translations

Extensible thread management – processor contextscalled strands, applications can provide their own threadmodel and schedulers

Page 27: Extensible Operating Systems - cs.cornell.edu · Extensible Operating Systems 9/29/11 8:25 PM file:///Users/basus/Documents/cs6410/extos/index.html#slide1 Page 1 of 27 Extensible

9/29/11 8:25 PMExtensible Operating Systems

Page 27 of 27file:///Users/basus/Documents/cs6410/extos/index.html#slide1

SPIN vs Aegis/ExOS

SPIN uses Modula 3 features to download extensionsinto the kernel while protecting it.

Aegis provides a small set of optimized primitives forapplication ExOS to use.

Both systems support downloading code but this is not acore feature in Aegis/ExOS.