D u k e S y s t e m s CPS 210 Introduction to Operating Systems Spring 2013 Jeff Chase Duke University.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

Computer Organization CS224 Fall 2012 Lesson 12. Synchronization  Two processors or threads sharing an area of memory l P1 writes, then P2 reads l Data.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
OS Spring’03 Introduction Operating Systems Spring 2003.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 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 memory.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Computer Organization
Protection and the Kernel: Mode, Space, and Context.
Winter 2015 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University Introduction and Overview.
CS 162 Discussion Section Week 1 (9/9 – 9/13) 1. Who am I? Kevin Klues Office Hours:
CS 153 Design of Operating Systems Spring 2015 Final Review.
D u k e S y s t e m s CPS 210 Software Architecture and OS Platforms Jeff Chase Duke University
D u k e S y s t e m s CPS Introduction to Operating Systems Fall 2013 Jeff Chase Duke University.
Programs and Processes Jeff Chase Duke University.
Threads, Thread management & Resource Management.
WEEK 1 COURSE INTRODUCTION INTRODUCTION TO OPERATING SYSTEMS OPERATING SYSTEM STRUCTURES Operating Systems CS3013 / CS502.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
CSE 451: Operating Systems Section 10 Project 3 wrap-up, final exam review.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
Introduction and Overview Summer 2014 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
D u k e S y s t e m s CPS 210 Introduction to Operating Systems Fall 2012 Jeff Chase Duke University.
Operating Systems and Systems Programming CS162 Teaching Staff.
Processes Introduction to Operating Systems: Module 3.
VMware vSphere Configuration and Management v6
More on Programs and Processes Jeff Chase Duke University.
Introduction to Operating Systems and Concurrency.
Overview of Operating Systems Introduction to Operating Systems: Module 0.
Paging (continued) & Caching CS-3013 A-term Paging (continued) & Caching CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Application Software System Software.
Programs and Processes Jeff Chase Duke University.
Lecture 4 Page 1 CS 111 Online Modularity and Virtualization CS 111 On-Line MS Program Operating Systems Peter Reiher.
D u k e S y s t e m s CPS Introduction to Operating Systems Spring 2016 Jeff Chase Duke University.
Data Structures and Algorithms in Java AlaaEddin 2012.
Virtual Machines Mr. Monil Adhikari. Agenda Introduction Classes of Virtual Machines System Virtual Machines Process Virtual Machines.
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Operating Systems A Biswas, Dept. of Information Technology.
RealTimeSystems Lab Jong-Koo, Lim
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.
Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Introduction to Operating Systems Concepts
Operating System Overview
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
Processes and threads.
Chapter 1: A Tour of Computer Systems
Advanced Operating Systems (CS 202)
CS399 New Beginnings Jonathan Walpole.
Java programming lecture one
Operating Systems and Systems Programming
Threads, SMP, and Microkernels
Lecture Topics: 11/1 General Operating System Concepts Processes
Introduction to Computer Systems
Introduction to Virtual Machines
Outline Operating System Organization Operating System Examples
Introduction to Virtual Machines
CSE 153 Design of Operating Systems Winter 2019
Lecture Topics: 11/1 Hand back midterms
Presentation transcript:

D u k e S y s t e m s CPS 210 Introduction to Operating Systems Spring 2013 Jeff Chase Duke University

Resources to know about Course Web – – Or other links through CS department – All powerpoints, policies, reading, schedule, lab (project) instructions are posted there. Piazza – Chatter. “Maybe even anonymous posting.” Sakai – Minimal use, e.g., mainly for disseminating grades

Meetings “Lectures”: – MF 3:05 – 4:20 – 25 lectures total Recitations – Monday in class slot, but Soc Sci 139 – TA: Vamsi Thummala Two midterms: 2/18 (recit) and 4/5 (in class) “Light” final exam (1.5x): 5/ PM

Monday Recitations – Monday: 3:05-4:20 PM – Soc Sci 139: see maps.duke.edu – TA: Vamsi Thummala – This week: important info for P1: heap manager

What is this course about? Platforms Sharing Concurrency Storage Protection and trust Resource management Virtualization Scale and performance Abstractions User Applications Operating System Substrate / Architecture

What is this course about? “Greater Unix” – Classical OS abstractions and structure – Systems programming with C and Unix Networked systems – Sockets and servers, smartphones to clouds – Elementary cryptosystems – Distributed systems topics Managing concurrency – Threads, multi-threaded Java Managing storage and data – Files, caches, disks, recovery, content delivery

“Software Architecture” User Applications Operating System(s) Substrate / Architecture Software architecture Computer architecture Comparative architecture: what works Reusable / recurring design patterns Used in OS Supported by OS Physics stops here.

Systems as Architecture Large, long-lived software systems are like buildings. They are built by workers using standard design patterns. They depend on some underlying infrastructure. But they can evolve and are not limited by the laws of physics.

Managing Complexity Environment System Component System Systems are built from components. Operating systems define styles of software components and how they interact. OS maps components onto the underlying machine. …and makes it all work together.

Abstraction Separate: – Interface from internals – Specification from implementation Abstraction is a double-edged sword. – “Don’t hide power.” More than an interface… This course is (partly) about the use of abstraction(s) in complex software systems. We want abstractions that are simple, rich, efficient to implement, and long-lasting.

Interface and abstraction

Abstraction(s) A means to organize knowledge – Capture what is common and essential – Generalize and abstract away the details – Specialize as needed – Concept hierarchy A design pattern or element – Templates for building blocks – Instantiate as needed E.g.: class, subclass, and instance

Standards, wrappers, adapters “Plug-ins” “Plug-compatible” Another layer of software can overcome superficial or syntactic differences if the fundamental are right.

Platforms are layered/nested

Virtualization?

Platform abstractions Platforms provide “building blocks”… …and APIs to use them. – Instantiate/create/allocate – Manipulate/configure – Attach/detach – Combine in uniform ways – Release/destroy Abstractions are layered. – What to expose? What to hide? The choice of abstractions reflects a philosophy of how to build and organize software systems.

Canonical OS Example: “Classical OS” Unix/Linux, Windows, OS-X Research systems – Multics – Mach – Minix – …

Some lessons of history At the time it was created, Unix was the “simplest multi-user OS people could imagine.” – It’s in the name: Unix vs. Multics Simple abstractions can deliver a lot of power. – Many people have been inspired by the power of Unix. The community spent four decades making Unix complex again....but the essence is unchanged. Unix is a simple context to study core issues for classical OS design. “It’s in there.” Unix variants continue to be in wide use. They serve as a foundation for advances.

End-to-end application delivery Cloud and Software-as-a-Service (SaaS) Rapid evolution, no user upgrade, no user data management. Agile/elastic deployment on virtual infrastructure. Where is your application? Where is your data? Where is your OS?

[ “Classical OS” Reloaded. Virtual Machine (JVM)

SaaS platform elements [wiki.eeng.dcu.ie] “Classical OS” browser container

Course prerequisites Basic data structures and programming – Graphs, queues, trees, heap – Abstract data types (ADTs), classes, objects – Dynamic data structures, garbage collection Basic discrete math and probability Basic architecture – CPU context: registers – Execution: stacks and frames – Memory, storage, and caches – Virtual addressing and data layout

Reading Course notes and slides External sources on every topic – OS in Three Easy Pieces – A few academic papers and web readings – Yes, even a “comic book” We’ll look at these with varying levels of scrutiny.

a classic Web/SaaS/cloud Saltzer/Kaashoek Very MIT Do not buy kindle edition. New! $10! No text, but these may be useful. New! $75!

Workload: projects 1.Dynamic heap memory (malloc/free) 2.Unix shell (“Devil Shell”) 3.Java concurrency: multi-threaded programming (“Elevator”) 4.Key/value storage server (“Devil Filer”) 5.Performance evaluation of storage server

Collaboration OK among groups: – General discussion of course concepts and programming environment. – “What does this part of the handout mean?” Not OK among groups – Design/writing of another’s program – “How do I do this part of the handout?” If in doubt, ask me.

Thoughts on cheating Cheating is a form of laziness. Cheating happens at those other schools. Duke students work hard and don’t cut corners. Your work is your own: if in doubt, ask. Listen to what shame tells you.

Grades: CPS 210 Fall A+ 8 A 11 A- 13 B+ 8 B 7 B- 9 C* or lower

What’s in a program?

code instructions (“text”) procedures data global variables (“static”) constants (“immutable”) symbols (import/export) names interfaces signatures references data

The Birth of a Program (C/Ux) int j; char* s = “hello\n”; int p() { j = write(1, s, 6); return(j); } myprogram.c compiler ….. p: store this store that push jsr _write ret etc. myprogram.s assembler data myprogram.o linker object file data program (executable file) myprogram data libraries and other objects

Program Running a program When a program launches, the platform allocates memory to store its code and data. data

Program Running a program “Unix Classic” simplifications Context == process == (1 VAS + 1 thread +...) Each process runs exactly one program/component instance (at a time). IPC channels are pipes. All I/O is based on a simple common abstraction: file / stream. data code constants initialized data imports/exports symbols types/interfaces

0x0 0x7fffffff Static data Dynamic data (heap/BSS) Text (code) Stack Reserved VAS example (32-bit) An addressable array of bytes… Containing every instruction the process thread can execute… And every piece of data those instructions can read/write… – i.e., read/write == load/store Partitioned into logical segments with distinct purpose and use. Every memory reference by a thread is interpreted in its VAS context. – Resolve to a location in machine memory A given address in different VAS may resolve to different locations.

On most platforms, contexts are isolated. They cannot interfere with one another, even if they are running the same program. I.e., each context is its own “sandbox”. The programs may fail independently. In classical OS, a context is called a process. Each has a private virtual address space. Protection / isolation Butler Lampson’s definition: “I am isolated if anything that goes wrong is my fault (or my program’s fault).” Isolation might not be absolute. E.g., the program instances may choose to interact, or may access shared data.

The Operating System An operating system: – sets up the contexts – enforces isolation – mediates interactions Applications trust the OS to do these things. Any software platform for running application programs can be called an OS.

Program Running a program Can a program launch multiple running instances on the same platform?

Program Can a program launch multiple running instances on the same platform? Running a program It depends. On some platforms (e.g., Android) an app is either active or it is not.

User Applications Operating System Substrate / Architecture Aggregation Composition Orchestration Exponential growth Increasing diversity Backward compatibility Drivers of Change Broad view: smartphones to servers, web, and cloud.

Moore’s Law and CPU Performance From Hennessy and Patterson, Computer Architecture: A Quantitative Approach, 4th edition, 2006  Sea change in chip design: multiple “cores” or processors per chip 3X Uniprocessor Performance (SPECint)

EC2 The canonical public cloud Virtual Appliance Image

OpenStack, the Cloud Operating System Management Layer That Adds Automation & Control [Anthony Rackspace]