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

Slides:



Advertisements
Similar presentations
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
Advertisements

CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Processes CSCI 444/544 Operating Systems Fall 2008.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Wednesday, June 07, 2006 “Unix is user friendly … it’s just picky about it’s friends”. - Anonymous.
© 2004, D. J. Foreman 1 CS350 Operating Systems. © 2004, D. J. Foreman 2 Administrivia  Assignments ■ Homework on most chapters ■ Approximately 8 lab.
OS Spring’03 Introduction Operating Systems Spring 2003.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
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?
Programming mobile devices Part II Programming Symbian devices with Symbian C++
COMP 321: Introduction to Computer Systems Scott Rixner Alan L. Cox
9/13/20151 Threads ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original slides.
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:
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
Threads, Thread management & Resource Management.
WEEK 1 COURSE INTRODUCTION INTRODUCTION TO OPERATING SYSTEMS OPERATING SYSTEM STRUCTURES Operating Systems CS3013 / CS502.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
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 Introduction to Operating Systems Spring 2013 Jeff Chase Duke University.
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.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
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.
CPS 110/EE 153 Course Intro. The operating system (OS) is the interface between user applications and the hardware. An OS implements a sort of virtual.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
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.
CS333 Intro to Operating Systems Jonathan Walpole.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Introduction to Operating Systems and Concurrency.
Overview of Operating Systems Introduction to Operating Systems: Module 0.
Department of Computer Science and Software Engineering
Programs and Processes Jeff Chase Duke University.
D u k e S y s t e m s CPS Introduction to Operating Systems Spring 2016 Jeff Chase Duke University.
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.
Embedded Real-Time Systems
Introduction CSE 410, Spring 2005 Computer Systems
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
Chapter 1: A Tour of Computer Systems
CS 6560: Operating Systems Design
Advanced Operating Systems (CS 202)
CS399 New Beginnings Jonathan Walpole.
Java programming lecture one
Operating Systems and Systems Programming
Lecture Note 0: Course Introduction
Lecture Topics: 11/1 General Operating System Concepts Processes
CSCE 313 – Introduction to UNIx process
Prof. Leonardo Mostarda University of Camerino
Introduction to Computer Systems
Lecture Note 0: Course Introduction
Outline Operating System Organization Operating System Examples
CSE 153 Design of Operating Systems Winter 2019
EECE.4810/EECE.5730 Operating Systems
Lecture Topics: 11/1 Hand back midterms
Presentation transcript:

D u k e S y s t e m s CPS Introduction to Operating Systems Fall 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 – Announcements – Chatter. “Maybe even anonymous posting.” Sakai – Minimal use, e.g., mainly for disseminating grades

Meetings “Lectures”: – MW 3:05 – 4:20 – ~25 lectures total Recitations – Fri 3:05, Bio Sci 111 – TA: Balakrishnan Chandrasekaran Two midterms – 10/4 (recit) and 11/6 (in class) “Light” final exam (1.5x) – 12/15 from 2-5 PM “Bio Sci”

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

Steve Yegge

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

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 platform mediates access to shared resources. [RAD Lab]

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

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. – What to expose? What to hide? The choice of abstractions reflects a philosophy of how to build and organize software systems.

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.

Comparative software 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.

Watch it! Computer systems is a liberal arts discipline. Just because someone will pay you to do it doesn’t mean it’s not liberal arts.

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

Dynamic data structures

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

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

A Peek Inside a Running Program 0 high code library your data heap registers CPU core R0 Rn PC “memory” x x your program common runtime stack address space (virtual or physical) e.g., a virtual memory for a running program (process) SP y y

Data in memory 64 bytes: 3 ways p + 0x0 0x1f 0x0 0x1f 0x0 char p[] char *p int p[] int* p p char* p[] char** p Pointers (addresses) are 8 bytes on a 64-bit machine. Memory is “fungible”.

Heap: dynamic memory Allocated heap blocks for structs or objects. Align! The “heap” is an ADT in a runtime library: the code to maintain the heap is a heap manager. It allocates a contiguous slab of virtual memory from the OS kernel, then “carves it up” as needed. It enables the programming language environment, to store dynamic objects. E.g., with Unix malloc and free library calls. Free block

Read it on the course web

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

Platforms are layered/nested

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

Cumulative Distribution Function CPS 2/310 Spring 2013 Total score X Probability that a random student’s score is X or below A* B* C*

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)

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

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 store (“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?” Definitely not OK: – Using code from a previous semester. 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.

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

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.

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

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

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

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)