“Overview of MINIX 3”J.N. Herder AN OVERVIEW OF MINIX 3 NICTA seminar, 20 Oct. 2008 Sydney, Australia Jorrit N. Herder Vrije Universiteit Amsterdam.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Nooks: an architecture for safe device drivers Mike Swift, The Wild and Crazy Guy, Hank Levy and Susan Eggers.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Operating System Organization
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
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?
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
ICOM Noack Operating Systems - Administrivia Prontuario - Please time-share and ask questions Info is in my homepage amadeus/~noack/ Make bookmark.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems CSCI-6140 – Computer Operating Systems David Goldschmidt, Ph.D.
Virtualization: Not Just For Servers Hollis Blanchard PowerPC kernel hacker.
Chapter 1 : The Linux System Part 1 Lecture 1 10/21/
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Can We Make Operating Systems Reliable and Secure? Andrew S. Tanenbaum, Jorrit N. Herder, and Herbert Bos Vrije Universiteit, Amsterdam May 2006 Group.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
CENG334 Introduction to Operating Systems 1 Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
Improving the Reliability of Commodity Operating Systems Michael M. Swift, Brian N. Bershad, Henry M. Levy Presented by Ya-Yun Lo EECS 582 – W161.
FTOP: A library for fault tolerance in a cluster R. Badrinath Rakesh Gupta Nisheeth Shrivastava.
Security-Enhanced Linux Stephanie Stelling Center for Information Security Department of Computer Science University of Tulsa, Tulsa, OK
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Computer System Structures
Chapter 4 – Thread Concepts
Virtualization.
Kernel Design & Implementation
Operating System Structure
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Memory Protection: Kernel and User Address Spaces
Chapter 4 – Thread Concepts
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S
Operating System Structure
KERNEL ARCHITECTURE.
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
Chapter 2: The Linux System Part 2
QNX Technology Overview
Chapter 2: System Structures
Operating Systems Bina Ramamurthy CSE421 11/27/2018 B.Ramamurthy.
Outline Midterm results summary Distributed file systems – continued
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS
Chapter 2: The Linux System Part 1
Fault Tolerance Distributed Web-based Systems
Operating Systems Chapter 5: Input/Output Management
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Architectural Support for OS
Chapter 2: Operating-System Structures
Linux Architecture Overview.
Outline Chapter 2 (cont) OS Design OS structure
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating Systems: A Modern Perspective, Chapter 3
Outline Operating System Organization Operating System Examples
Architectural Support for OS
System calls….. C-program->POSIX call
CSE 153 Design of Operating Systems Winter 2019
Chapter 2: Operating-System Structures
Chapter 13: I/O Systems.
Memory Protection: Kernel and User Address Spaces
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

“Overview of MINIX 3”J.N. Herder AN OVERVIEW OF MINIX 3 NICTA seminar, 20 Oct Sydney, Australia Jorrit N. Herder Vrije Universiteit Amsterdam

“Overview of MINIX 3”J.N. Herder “There are no significant bugs in our released software that any significant number of users want fixed.” -- Bill Gates, 1995

“Overview of MINIX 3”J.N. Herder ~26% of Windows XP crashes

“Overview of MINIX 3”J.N. Herder Talk outline ● Background and motivation ● MINIX 3 isolation architecture ● MINIX 3 self-repairing properties ● Experimental evaluation ● Discussion and conclusions

“Overview of MINIX 3”J.N. Herder Talk outline ● Background and motivation ● MINIX 3 isolation architecture ● MINIX 3 self-repairing properties ● Experimental evaluation ● Discussion and conclusions

“Overview of MINIX 3”J.N. Herder Even if OS were correct... ● Plug-ins extend OS base functionality provided by untrusted third parties comprise up to 70% of entire OS 3-7x more bugs than other OS code ● Still, extensions run in kernel all powers of the system no proper fault isolation

“Overview of MINIX 3”J.N. Herder Bug fixing is infeasible ● Software is buggy by nature survey across languages found 1-6 bugs/KLoc e.g. FreeBSD: 3.35 post-release bugs/KLoC ● Continuously changing configurations e.g. 88 new Windows drivers/day in 2004 ● Code maintainability very hard changing kernel interfaces unwieldy growth of kernel code base

“Overview of MINIX 3”J.N. Herder Linux 2.6 kernel analysis ● Sustained growth of ~5% every 6 months

“Overview of MINIX 3”J.N. Herder Consequences ● Downtime mainly due to faulty software over 50,000 kernel bugs in Linux/Windows if kernel size estimated at ~5 MLoC and fault density put at 10 bugs/KLoC any kernel bug is potentially fatal ● Windows crash dump analysis confirms: extensions cause 65-83% of all crashes

“Overview of MINIX 3”J.N. Herder It's not just a nuisance ● Unacceptable for most (ordinary) users grandma cannot handle computer crashes ● Big problem for large server farms monthly reboot means many daily failures even with 99% uptime a big problem ● Critical applications require reliability ATMs, cars, power plants, etc.

“Overview of MINIX 3”J.N. Herder MINIX 3 rationale ● Rethink OS design to improve reliability no focus on performance as in L4 ● But keep well-known UNIX “look and feel” MINIX 3 is POSIX compliant UNIX clone runs about 500 standard UNIX applications standard shell, file, and text utilities virtual file system infrastructure TCP/IP stack with BSD sockets X Window System

“Overview of MINIX 3”J.N. Herder Talk outline ● Background and motivation ● MINIX 3 isolation architecture ● MINIX 3 self-repairing properties ● Experimental evaluation ● Discussion and conclusions

“Overview of MINIX 3”J.N. Herder Isolation architecture ● Goal is to enforce least authority only grant access required to do job ● This is realized using three techniques 1) Structural constraints run drivers as unprivileged processes 2) Per-driver isolation policies grant access to only resources needed 3) Run-time memory granting enable fine-grained data sharing

“Overview of MINIX 3”J.N. Herder Structural constraints ● Multiserver design for all OS services Process manager, virtual file system Extension manager, file servers, drivers, etc.

“Overview of MINIX 3”J.N. Herder Development benefits ● User-space components easily managed Short development cycle Normal programming model No down time for crash and reboot Easy debugging Good flexibility

“Overview of MINIX 3”J.N. Herder User-space drivers ● Only microkernel has full CPU privileges manageable due to small size < 5,000 LoC ● Extensions run in user-space unprivileged CPU mode cannot change page tables, halt CPU, etc. strict address-space separation private, virtual address space

“Overview of MINIX 3”J.N. Herder Kernel support needed ● Kernel mediates privileged operations e.g., DEVIO kernel call mediates device I/O based on resources granted in isolation policy e.g., SAFECOPY call mediates memory copies based on fine-grained memory grants ● Interrupt handling done in user-space minimal, generic interrupt handler in kernel structurally prevents 26% of Windows XP crashes

“Overview of MINIX 3”J.N. Herder Per-driver isolation policies

“Overview of MINIX 3”J.N. Herder Loading drivers in MINIX 3 ● User sends request to extension manager only privileged users may start extensions ● Actual loading and policy setting 1) extension manager forks new process IPC endpoint used to identify extension 2) all OS servers are informed about policy 3) finally process can execute binary

“Overview of MINIX 3”J.N. Herder How to define policies? ● MINIX 3 policies are simple text files each key grants one or more powers e.g., 'ipc' denotes allowed IPC destinations ● Suitable for dynamic resource discovery device resources not known in advance PCI bus driver looks up device's resources

“Overview of MINIX 3”J.N. Herder Example driver policy driver rtl8029 {# isolation policy pci device10ec/8029;# PCI RTL8029 ipcpci # PCI bus driver kernel;# Kernel task ipc kernelSAFECOPY# Memory copying DEVIO# Device I/O...; }; ● Note: MINIX 3 provides only mechanisms

“Overview of MINIX 3”J.N. Herder Run-time memory granting ● Address-space separation too strict drivers typically need to exchange data ● Capability-like scheme: 'memory grants' defines byte-granularity memory area lists access rights for a specific process grant validated by SAFECOPY kernel call ● Allow DMA into driver's address space integration with grants is work in progress

“Overview of MINIX 3”J.N. Herder Using memory grants ● Tell kernel about grant table location ● Add memory grant to allow access ● Pass index into grant table to grantee

“Overview of MINIX 3”J.N. Herder Direct memory access (DMA) ● Prevent access to DMA controller impractical for bus-mastering DMA ● Solution based on I/O MMU hardware we used AMD's Device Exclusion Vector (DEV) I/O MMU driver programs I/O MMU allows DMA to only driver's address space

“Overview of MINIX 3”J.N. Herder Talk outline ● Background and motivation ● MINIX 3 isolation architecture ● MINIX 3 self-repairing properties ● Experimental evaluation ● Discussion and conclusions

“Overview of MINIX 3”J.N. Herder Self-repairing properties ● Isolation prevents fault propagation cannot prevent buggy driver from failing ● Improve dependability through recovery Failure is masked and OS can continue Common in other areas: Disks: Error correcting codes Networking: Reliable protocols Init process: respawns crashed daemons

“Overview of MINIX 3”J.N. Herder Underlying idea ● Many faults tend to go away after restart transient hardware faults race condition due to timing issues aging bugs causing failures over time e.g., due to memory leaks

“Overview of MINIX 3”J.N. Herder Detecting failures ● Human user observes system crash / hang, weird behavior, etc. ● OS triggers for recovery process exit due to internal panic crashed by CPU or MMU exception killed by user heartbeat message missing complaint by another component dynamic update by user

“Overview of MINIX 3”J.N. Herder Using recovery scripts ● Main benefit is full flexibility, e.g.: log error messages send to remote administrator binary exponential backoff if [ ! $reason -eq DYNAMIC_UPDATE ]; then sleep $((1 << ($repetition))) fi service restart $component

“Overview of MINIX 3”J.N. Herder Restart procedure ● Driver manager starts new driver ● Pub-sub system broadcasts changes ● Dependent services recovery-aware relatively small changes required check for failures upon driver interactions code to restart very similar to normal start − changes to INET limited to only 124 LoC − changes to VFS server limited to only 274 LoC − driver manager has 593 LoC relating to restarts

“Overview of MINIX 3”J.N. Herder Effectiveness of recovery ● Recovery of device drivers Network: transparent, no data loss TCP protocol guarantees end-to-end integrity Block: transparent, incidental data loss Character: not transparent, data loss likely ● Recovery of system servers yes, but result depends on state lost restart of INET destroys all network sockets still useful to improve uptime of web server

“Overview of MINIX 3”J.N. Herder Talk outline ● Background and motivation ● MINIX 3 isolation architecture ● MINIX 3 self-repairing properties ● Experimental evaluation ● Discussion and conclusions

“Overview of MINIX 3”J.N. Herder Performance considerations ● Modular design incurs some overhead overhead can be limited to 5-10% range long history of performance work in L4 context ● Our primary focus is dependability rough estimate of current overhead 10-25% MINIX 3 performs well for R&D purposes e.g., full system build and restart under 15 sec disk throughput up to 70 MB/s, limited by HDD Fast Ethernet runs as full speed, limited by NIC

“Overview of MINIX 3”J.N. Herder Raw disk throughput ● Sequential read for various I/O unit sizes highlights worst-case overhead

“Overview of MINIX 3”J.N. Herder Network driver recovery ● Repeated crashes simulated w/ SIGKILL crash intervals ranging from 1 to 25 sec ● Transparent RTL8139 driver recovery transparent recovery without data loss mean recovery time is only 0.36 sec 25% overhead with 1 crash every 1 sec 8% overhead with 1 crash every 4 sec 1% overhead with 1 crash every 25 sec no overhead with no crashes

“Overview of MINIX 3”J.N. Herder Fault-injection testing ● Goal: “Show that common OS errors in a properly isolated extension cannot propagate and damage the system.” ● Method: “Inject faults into an extension in order to induce a failure, and observe how the system is affected.”

“Overview of MINIX 3”J.N. Herder Experimental setup ● Faults representative for common errors e.g., bad pointers major crash cause (27%) ● Targeted drivers in networking subsystem ● Inject faults into text segment at run-time workload exercised driver's functionality ● In total, we injected millions of faults related work injected at most thousands nasty bugs show up only after millions

“Overview of MINIX 3”J.N. Herder Dependability results ● One experiment injected 2,400,000 faults 3 configs * 8 types * 1000 trials * 100 faults ● This induced 18,038 detectable failures CPU or MMU exceptions: 10,019 exits due to internal panic: 7,431 missing driver heartbeats: 588 ● Transparent recovery in all 18,038 cases “Failure Resilience for Device Drivers,” Proc. 37 th DSN, pp , June 2007

“Overview of MINIX 3”J.N. Herder Distribution of failures ● Driver failed, but the OS never crashed

“Overview of MINIX 3”J.N. Herder Engineering effort ● Statistics of executable source code

“Overview of MINIX 3”J.N. Herder Talk outline ● Background and motivation ● MINIX 3 isolation architecture ● MINIX 3 self-repairing properties ● Experimental evaluation ● Discussion and conclusions

“Overview of MINIX 3”J.N. Herder Conclusions (1/3) ● Extensions threaten OS dependability unwieldy driver growth not manageable isolation of untrusted code is needed ● MINIX 3 employs a multiserver design rethink OS internals to isolate extensions but keep UNIX “look and feel” for users

“Overview of MINIX 3”J.N. Herder Conclusions (2/3) ● MINIX 3 isolation architecture structural restrictions per-driver isolation policy run-time memory granting ● MINIX 3 self-repairing properties monitor driver failures at run-time script-driven recovery procedure

“Overview of MINIX 3”J.N. Herder Conclusion (3/3) ● Sacrifice performance for dependability current overhead estimated at 10-25% optimizations possible, as shown by L4 ● Fault-injection testing proves viability injected over 2,400,000 common OS faults 18,038 driver failures that could be recovered MINIX 3 operating system never crashed

“Overview of MINIX 3”J.N. Herder Acknowledgements ● NICTA Gernot Heiser Emilia Sotirova ● The MINIX 3 team Ben Gras Arun Thomas Philip Homburg Herbert Bos Andy Tanenbaum

“Overview of MINIX 3”J.N. Herder Thank you! Questions? ● Try it yourself! download MINIX 3 ● More information: web: news: comp.os.minix

“Overview of MINIX 3”J.N. Herder L4 versus MINIX 3 ● L4 refers to microkernel specification various flavors and implementations used as base for various operating systems ● L4 is much more mature than MINIX 3 actually running on consumer appliances long and rich history in many areas, e.g.: high performance power management formal verification...