Lecture 4 Page 1 CS 111 Online Modularity and Virtualization CS 111 On-Line MS Program Operating Systems Peter Reiher.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

Lecture 13 Page 1 CS 111 Online File Systems: Introduction CS 111 On-Line MS Program Operating Systems Peter Reiher.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Lecture 19 Page 1 CS 111 Online Protecting Operating Systems Resources How do we use these various tools to protect actual OS resources? Memory? Files?
Lecture 12 Page 1 CS 111 Online Devices and Device Drivers CS 111 On-Line MS Program Operating Systems Peter Reiher.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
Lecture 2 Page 1 CS 236, Spring 2008 Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher Spring, 2008.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Operating Systems CS451 Brian Bershad
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
1: Operating Systems Overview
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Operating System Organization
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
DISTRIBUTED COMPUTING
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
1 Instant replay  The semester was split into roughly four parts. —The 1st quarter covered instruction set architectures—the connection between software.
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 3 Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Computer System Architectures Computer System Software
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
Networked File System CS Introduction to Operating Systems.
Guide to Linux Installation and Administration, 2e 1 Chapter 9 Preparing for Emergencies.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Virtualization. Virtualization  In computing, virtualization is a broad term that refers to the abstraction of computer resources  It is "a technique.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
CS 1308 Computer Literacy and the Internet. Introduction  Von Neumann computer  “Naked machine”  Hardware without any helpful user-oriented features.
Lecture 4 Page 1 CS 111 Spring 2015 Modularity and Virtualization CS 111 Operating Systems Peter Reiher.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Processes and OS basics. RHS – SOC 2 OS Basics An Operating System (OS) is essentially an abstraction of a computer As a user or programmer, I do not.
Lecture 2 Page 1 CS 111 Summer 2015 I/O, Modularity and Virtualization CS 111 Operating System Principles Peter Reiher.
Lecture 16 Page 1 Advanced Network Security Perimeter Defense in Networks: Virtual Private Networks Advanced Network Security Peter Reiher August, 2014.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Lecture 11 Page 1 CS 111 Online Memory Management: Paging and Virtual Memory CS 111 On-Line MS Program Operating Systems Peter Reiher.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Lecture 2 Page 1 CS 111 Online System Services for OSes One major role of an operating system is providing services – To human users – To applications.
1: Operating Systems Overview 1 Jerry Breecher Fall, 2004 CLARK UNIVERSITY CS215 OPERATING SYSTEMS OVERVIEW.
Lecture 5 Page 1 CS 111 Online Processes CS 111 On-Line MS Program Operating Systems Peter Reiher.
Introduction to Operating Systems and Concurrency.
Operating Systems: Wrap-Up Questions answered in this lecture: What is an Operating System? Why are operating systems so interesting? What techniques can.
Copyright © Clifford Neuman - UNIVERSITY OF SOUTHERN CALIFORNIA - INFORMATION SCIENCES INSTITUTE Advanced Operating Systems Lecture notes Dr.
Lecture 7 Page 1 CS 111 Online Process Communications and Concurrency CS 111 On-Line MS Program Operating Systems Peter Reiher.
Lecture 2 Page 1 CS 111 Summer 2014 Hardware, Modularity, and Virtualization CS 111 Operating System Principles Peter Reiher.
Lecture9 Page 1 CS 236 Online Operating System Security, Con’t CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
Chapter 2 Introduction to OS Chien-Chung Shen CIS/UD
Lecture 15 Page 1 CS 236 Online Evaluating Running Systems Evaluating system security requires knowing what’s going on Many steps are necessary for a full.
Page 1 2P13 Week 1. Page 2 Page 3 Page 4 Page 5.
Lecture 10 Page 1 CS 111 Online Memory Management CS 111 On-Line MS Program Operating Systems Peter Reiher.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Introduction to Operating Systems Concepts
Computer System Structures
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Introduction to Operating Systems
Outline Paging Swapping and demand paging Virtual memory.
Outline What does the OS protect? Authentication for operating systems
Outline Introduction Characteristics of intrusion detection systems
Operating System Structure
Modularity and Memory Clearly, programs must have access to memory
Outline What does the OS protect? Authentication for operating systems
Storage Virtualization
Introduction to Operating Systems
Lecture Topics: 11/1 Hand back midterms
Presentation transcript:

Lecture 4 Page 1 CS 111 Online Modularity and Virtualization CS 111 On-Line MS Program Operating Systems Peter Reiher

Lecture 4 Page 2 CS 111 Online Introduction Most useful abstractions an OS wants to offer can’t be directly realized by hardware – The hardware doesn’t do exactly what the abstraction requires – Multiple pieces of hardware are needed to achieve the abstraction – The hardware must be shared by multiple instances of the abstraction How do we provide the abstraction to users?

Lecture 4 Page 3 CS 111 Online Virtualization and Modularity Use software to make the hardware we have look like the abstraction we want – That’s virtualization Divide up the overall system you want into well-defined communicating pieces – That’s modularity Using the two techniques allows us to build powerful systems from simple components – Without making the resulting system unmanageably complex

Lecture 4 Page 4 CS 111 Online What Does An OS Do? At minimum, it enables one to run applications Preferably multiple applications on the same machine Preferably several at the same time At an abstract level, what do we need to do that? – Interpreters (to run the code) – Memory (to store the code and data) – Communications links (to communicate between apps and pieces of the system)

Lecture 4 Page 5 CS 111 Online What Have We Got To Work With? A processor – Maybe multicore – Maybe also some device controllers RAM Hard disks and other storage devices Busses and network hardware Other I/O devices

Lecture 4 Page 6 CS 111 Online How to Get From What We’ve Got to What We Want? Build abstractions for what we want Out of the hardware we’ve actually got Use those abstractions to: – Hide messiness – Share resources – Simplify use – Provide safety and security From one point of view, that’s what an operating system is all about

Lecture 4 Page 7 CS 111 Online Real Hardware Vs. Desirable Abstractions In the last lecture, we looked at some real hardware issues – With relation to OS requirements Now let’s see how those can be used to provide some useful OS abstractions

Lecture 4 Page 8 CS 111 Online Starting Simple We want to run multiple programs – Without interference between them – Protecting one from the faults of another We’ve got a multicore processor to do so – More cores than programs We have RAM, a bus, a disk, other simple devices What abstractions should we build to ensure that things go well?

Lecture 4 Page 9 CS 111 Online A Simple System Processor 1 Processor 2 Processor 3 Processor 4 Program 1 Program 2 Program 3 Program 4 Memory Disk Network A machine boundary

Lecture 4 Page 10 CS 111 Online Things To Be Careful About Interference between different user tasks User task failure causing failure of other user tasks – Worse, causing failure of the overall system User tasks improperly overusing or misusing system resources – Need to be sure each task gets a fair share

Lecture 4 Page 11 CS 111 Online Exploiting Modularity We’ll obviously have several SW elements to support the different user programs Desirable for each to be modular and self- contained – With controlled interactions Gives cleaner organization Easier to prevent problems from spreading Easier to understand what’s going on Easier to control each program’s behavior

Lecture 4 Page 12 CS 111 Online Subroutine Modularity Why not just organize the system as a set of subroutines? – All in the same address space A simplifying assumption Allowing easy in-memory communication System subroutines call user program subroutines as needed – And vice versa Soft modularity

Lecture 4 Page 13 CS 111 Online How Would This Work? Each program would be a self-contained set of subroutines – Subroutines in the program call each other – But not subroutines in other programs Shared services would be offered by other subroutines – Which any program can call – But which mostly don’t call programs Perhaps some “master routine” that calls subroutines in the various programs

Lecture 4 Page 14 CS 111 Online What’s Soft About This Modularity? Vital resources are shared – Like the stack Proper behavior would prevent one program from treading on another’s resources But no system or hardware features prevent it Maintaining module boundaries requires programs to all follow the rules – Even if they intend to, they might fail to do so because of programming errors

Lecture 4 Page 15 CS 111 Online Illustrating the Problem Processor 1 Processor 2 Processor 3 Processor 4 Program 1 Program 2 Program 3 Program 4 Memory Disk Network Stack for Program 1 Stack for Program 4 Stack for Program 2 Stack for Program 3 Now Program 4 is in trouble Even though it did nothing wrong itself

Lecture 4 Page 16 CS 111 Online Hardening the Modularity How can we more carefully separate the several competing programs? If each were on its own machine, the problem is easier No program can touch another’s resources – Except via network messages Each program would have complete control over a full machine – No need to worry if some resource is yours or not

Lecture 4 Page 17 CS 111 Online Illustrating Hard Modularity Processor 1 Processor 2 Processor 3 Processor 4 Program 1 Program 2 Program 3 Program 4 Memory 1 Memory 2 Memory 3 Memory 4 Four separate machines Perhaps in very different places Each program has its own machine

Lecture 4 Page 18 CS 111 Online Communications Across Machines Each machine would send messages to the others to communicate A machine receiving a message would take action as it saw fit – Typically doing what the sender requested – But with no opportunity for sender’s own code to run Obvious opportunities for parallelism – And obvious dangers

Lecture 4 Page 19 CS 111 Online Illustrating Communications Processor 1 Processor 2 Processor 3 Processor 4 Program 1 Program 2 Program 3 Program 4 Memory 1 Memory 2 Memory 3 Memory 4 Network If Program 1 needs to communicate with Program 4, This can’t happen!

Lecture 4 Page 20 CS 111 Online System Services In This Model Some activities are local to each program Other services are intended to be shared – Like a file system This functionality can be provided by a client/server model The system services are provided by the server The user programs are clients The client sends a message to the server to get help

Lecture 4 Page 21 CS 111 Online A Storage Example A server keeps data persistently for all user programs – E.g., a file system User programs act as clients – Sending read/write messages to the server The server responds to reads with the requested data And to writes with acknowledgements of completion

Lecture 4 Page 22 CS 111 Online Advantages of This Modularity For a Storage Subsystem Everyone easily sees the same persistent storage The server performs all actual data accesses – So no worries about concurrent writes or read/write inconsistencies Server can ensure fair sharing Clients can’t accidentally/intentionally corrupt the entire data store – Only things they are allowed to write

Lecture 4 Page 23 CS 111 Online Benefits of Hard Modularity With hard modularity, something beyond good behavior enforces module boundaries Here, the physical boundaries of the machine A client machine literally cannot touch the memory of the server – Or of another client machine No error or attack can change that – Though flaws in the server can cause problems Provides stronger guarantees all around

Lecture 4 Page 24 CS 111 Online Downsides of Hard Modularity The hard boundaries prevent low-cost optimizations In client/server organizations, doing anything with another program requires messages – Inherently more expensive than simple memory accesses If the boundary sits between components requiring fast interactions, possibly very bad A lot of what we do in operating systems involves this tradeoff

Lecture 4 Page 25 CS 111 Online One Other Problem What if I don’t have enough hardware? – Not enough machines to give one to each client and server – Not enough memory, network capacity, etc. Am I forced to fall back on sharing machines and using soft modularity?