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

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Threads, SMP, and Microkernels
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Public Key Infrastructure (PKI) Providing secure communications and authentication over an open network.
Computer Systems/Operating Systems - Class 8
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
CSE331: Introduction to Networks and Security Lecture 28 Fall 2002.
CSI 400/500 Operating Systems Spring 2009 Lecture #20 – Security Measures Wednesday, April 29 th.
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Virtualization and the Cloud
03 December 2003 Public Key Infrastructure and Authentication Mark Norman DCOCE Oxford University Computing Services.
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 Security Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Programming mobile devices Part II Programming Symbian devices with Symbian C++
COMP 321: Introduction to Computer Systems Scott Rixner Alan L. Cox
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
CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
Systems Security & Audit Operating Systems security.
CS 162 Discussion Section Week 1 (9/9 – 9/13) 1. Who am I? Kevin Klues Office Hours:
D u k e S y s t e m s CPS Introduction to Operating Systems Fall 2013 Jeff Chase Duke University.
1 Introduction to Operating Systems 9/16/2008 Lecture #1.
M.A.Doman Short video intro Model for enabling the delivery of computing as a SERVICE.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
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.
D u k e S y s t e m s CPS 210 Security in Networked Systems Always Use Protection Jeff Chase Duke University
Section 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.
D u k e S y s t e m s CPS 210 Introduction to Operating Systems Spring 2013 Jeff Chase Duke University.
CS 444 Introduction to Operating Systems
April 2000Dr Milan Simic1 Network Operating Systems Windows NT.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Review COMPSCI 210 Recitation 7th Dec 2012 Vamsi Thummala.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
CE Operating Systems Lecture 3 Overview of OS functions and structure.
D u k e S y s t e m s CPS 210 Introduction to Operating Systems Fall 2012 Jeff Chase Duke University.
(a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not always the same. So please give three examples.
Operating Systems and Systems Programming CS162 Teaching Staff.
Processes Introduction to Operating Systems: Module 3.
11/21/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Sam King and Andrew.
Cloud Computing – UNIT - II. VIRTUALIZATION Virtualization Hiding the reality The mantra of smart computing is to intelligently hide the reality Binary->
Virtual Machines Mr. Monil Adhikari. Agenda Introduction Classes of Virtual Machines System Virtual Machines Process Virtual Machines.
Implementing Remote Procedure Call Landon Cox February 12, 2016.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
CS 162 Discussion Section Week 2. Who am I? Prashanth Mohan Office Hours: 11-12pm Tu W at.
Introduction to Operating Systems Concepts
Final exam: Wednesday, March 20, 2:30pm
Advanced Operating Systems (CS 202)
Java programming lecture one
CMPE419 Mobile Application Development
Operating Systems and Systems Programming
Lecture Topics: 11/1 General Operating System Concepts Processes
COMPSCI210 Recitation 5 Oct 2012 Vamsi Thummala
Outline Chapter 2 (cont) OS Design OS structure
Prof. Leonardo Mostarda University of Camerino
Introduction to Computer Systems
System calls….. C-program->POSIX call
CSE 153 Design of Operating Systems Winter 2019
EECE.4810/EECE.5730 Operating Systems
CMPE419 Mobile Application Development
Presentation transcript:

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

What is this course about? Programs Platforms Performance … User Applications Operating System Substrate / Architecture “The system is all the code your program uses that you didn’t have to write.”

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

Resources to know about Course Web – – Or other links through CS department – All powerpoints, policies, reading, schedule, lab (project) instructions are posted there. Piazza – Announcements – Questions from you: anonymous postings OK Sakai – Grades, quizzes

Meetings “Lectures”: – WF 1:25 – 2:40 – ~25 lectures total “Recitations”: – M 3:05 (same room) – TA: Max Demoulin – (But I will do some) Two midterms Final exam (1.5x)

Course goals Learn to think about systems holistically. Sound mastery of structures and principles. Reinforce with practical, concrete examples. Reduce “unknown unknowns”. 2003

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.

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

A simple module (or “component”) A set of procedures/functions/methods. An interface (API) that defines a template for how to call/invoke the procedures. State is just data maintained and accessed by the procedures. A module may be a class that defines a template (type) for a data structure. A class may have multiple instances (objects) constructed from the template. The class procedures (methods) operate on a specific object. P1() P2() P3() P4() state Abstract Data Type (ADT): the module’s state is manipulated only through its API (Application Programming Interface).

OS Platform: A Model OS platform: same for all applications on a system E,g,, classical OS kernel Libraries/frameworks: packaged code used by multiple applications Applications/services. May interact and serve one another. OS mediates access to shared resources. That requires protection and isolation. [RAD Lab] Protection boundary API

Android Security Architecture [ “A central design point of the Android security architecture is that no application, by default, has permission to perform any operations that would adversely impact other applications, the operating system, or the user. This includes reading or writing the user's private data (such as contacts or s), reading or writing another application's files, performing network access, keeping the device awake, and so on. Because each Android application operates in a process sandbox, applications must explicitly share resources and data. They do this by declaring the permissions they need for additional capabilities not provided by the basic sandbox. Applications statically declare the permissions they require, and the Android system prompts the user for consent at the time the application is installed. Android has no mechanism for granting permissions dynamically (at run-time) because it complicates the user experience to the detriment of security.” Isolation and Sharing

Platform abstractions Platforms provide “building blocks”… …and APIs to use them to construct software. – Instantiate/create/allocate – Manipulate/configure – Attach/detach – Combine in uniform ways – Release/destroy Abstractions are layered. – Expose the power through APIs – Hide the details behind APIs The choice of abstractions reflects a philosophy of how to build and organize software systems.

Course prerequisites Basic data structures and programming – Lists, stacks, queues, graphs, DAGs, trees – Abstract data types (ADTs), classes, objects – Dynamic data structures Basic architecture (CPS 250) – CPU context: registers, control – Execution: runtime stack and frames – Memory and L1/L2/L3 caches, DMA I/O – Virtual addressing and memory layout

Code: instructions in memory _p1: pushq%rbp movq%rsp, %rbp movl$1, %eax movq%rdi, -8(%rbp) popq%rbp ret load_x, R2; load global variable x addR2, 1, R2; increment: x = x + 1 storeR2, _x; store global variable x These are examples of sequences of machine instructions. Details of instruction set architecture (ISA) vary by machine.

Multicore

[Image: ExtremeTech: Moore’s Law is dead, long live Moore’s Law]

Multithreading

Steve Yegge

Read it on the course web

Performance

Cumulative Distribution Function Total score X Probability that a random student’s score is X or below A* B* C* Grading: 50% exams (2M+F) 50% projects/labs Normalize to 100

10% quantile 90% quantile median value 80% of the requests have response time R with x1 < R < x2. x1x2 “Tail” of 10% of requests with response time R > x2. What’s the mean R? Understand how the mean (average) can be misleading, e.g. if tail is heavy. A few requests have very long response times. 50% (median) Cumulative Distribution Function (CDF)

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. [Google Chrome Comics]

a classic Saltzer/Kaashoek Very MIT Do not buy kindle edition. No text, but these may be useful. $70 A good intro to web-scale systems: Web/SaaS/cloud

Workload: projects 1.Dynamic heap memory (malloc/free) 2.Threads and concurrent programming 3.Black hat lab (“buggyserver”) 4.Distributed consensus (“Raft”)

Collaboration OK among groups: – General discussion of course concepts, programming environment, problems, pitfalls. – “What does this part of the handout mean?” Not OK among groups – “Substantive” code sharing – “How do I do this part of the handout?” Definitely not OK: – Using code from a previous semester. – (Or from any unattributed source) Read the syllabus. 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. Cheating is a response to fear, but it just creates more fear.

gitlab.oit.duke.edu We will use the git version control system. Repositories are hosted on gitlab.oit service. Your group’s repository is private to your group and to us (and to the auto-grader). You will use the git command to clone your repository in a local directory/folder. Use git to commit/push/checkin and pull/fetch updates. The git command runs as a local program/process that talks to gitlab.oit over the network. Q: how does gitlab.oit know who you are? – A1: Login to gitlab.oit with your NetID using Shibboleth. – A2: register a public key with gitlab.oit.

AuthZ 101 subjectactionobject reference monitor applies guard policy checker policy rules subj/obj attributes Authenticated by PKI / SSL / MAC “subject says action” service request requester authorizer (subject) object guardcredentials Alic e identity

Cryptography for Busy People Standard crypto functions parameterized by keys. – Key is a fixed-width “random” value (width matters!) – Symmetric (DES): fast, requires shared key: K = K1 = K2 – Asymmetric (RSA): slow, uses two keys: a keypair {K1, K2} “Believed to be computationally infeasible” to break ED Encrypt Decrypt K1 K2 M Message (plaintext) M [Image: Landon Cox] {M} K1 Encrypted version of M (ciphertext)

Asymmetric (public key) crypto Each subject/principal possesses a keypair. – Decrypt(K, Encrypt(K -1, M)) = M Keep one key private; the other is public. Either key can be used to encrypt/decrypt. If we know one another’s public keys then we can communicate securely. Anyone can mint a keypair.

ED Crypt Asymmetric crypto works both ways [Landon Cox] A’s private key or A’s public key or A’s private key

How to use asymmetric crypto? A can send a message to B, encrypted with A’s private key. B can send a message to A, encrypted with A’s public key. Benefits? Other possibilities?

Spelling it out Do encrypt message M with your private key to authenticate it, i.e., to convince the recipient that M really came from you. – Better yet, digitally sign M: that’s faster (next). Do encrypt M with the recipient’s public key to keep it secret: only the intended recipient can decrypt it. Don’t encrypt M with your public key: it’s just weird and pointless, since nobody else can read the encrypted message. Bob probably blew his chances with Alice. Don’t encrypt M with the recipient’s private key: if you know someone’s private key then you should not use it! Forget it and don’t tell anyone.

Extra slides The point of the remaining slides is: We take a broad view of “operating systems” encompassing a variety of application platforms. We start with Unix, a canonical/classical OS. Unix has continuing relevance: it continues to thrive deep inside the rich platforms we use today: knowing about the Unix kernel helps to understand how they work. Hardware and application demands change rapidly. Operating system kernels evolve slowly, but we often add more code around them to adapt to change. You’ll see these slides again.

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

Platforms are layered/nested

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?

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

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

EC2 The canonical public cloud Virtual Appliance Image

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.

“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.

But Java programs are interpreted They run on an “abstract machine” (e.g., JVM) implemented in software (e.g., a C program). ”bytecode”

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