Скачать презентацию Duke Systems CPS 210 Introduction to Operating Systems Скачать презентацию Duke Systems CPS 210 Introduction to Operating Systems

b609bbee8197a85466ff3cb5028e6361.ppt

  • Количество слайдов: 39

Duke Systems CPS 210 Introduction to Operating Systems Fall 2012 Jeff Chase Duke University Duke Systems CPS 210 Introduction to Operating Systems Fall 2012 Jeff Chase Duke University

Meetings • “Lectures”: MW 3: 05 – 4: 20 – No class 10/15 – Meetings • “Lectures”: MW 3: 05 – 4: 20 – No class 10/15 – No class 11/21 – 25 lectures total • Recitations – Friday in class slot, but Soc Sci 139 – TA: Vamsi Thummala • Two midterms: 10/1 and 11/12 in class • “Light” final exam (? ): 12/13 2 -5 PM

What is this course about? • Platforms • Sharing • Concurrency • Storage • 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

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

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

Managing Complexity System Component System Environment Component Systems are built from components. Operating systems Managing Complexity System Component System Environment Component 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.

Systems as Architecture Large, long-lived software systems are like buildings. They are built by 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.

http: //www. sammlung. daimler. com/sculpt/potsdamerplatz/potsd_tinguely 500. jpg http: //www. sammlung. daimler. com/sculpt/potsdamerplatz/potsd_tinguely 500. jpg

Abstraction • Separate: – Interface from internals – Specification from implementation • Abstraction is 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 Interface and abstraction

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

Virtualization? Virtualization?

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

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

Virtual Machine (JVM) “Classical OS” Reloaded. [http: //www. android. com] Virtual Machine (JVM) “Classical OS” Reloaded. [http: //www. android. com]

EC 2 The canonical public cloud Virtual Appliance Image EC 2 The canonical public cloud Virtual Appliance Image

Open. Stack, the Cloud Operating System Management Layer That Adds Automation & Control [Anthony Open. Stack, the Cloud Operating System Management Layer That Adds Automation & Control [Anthony Young @ Rackspace]

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

Platforms are layered/nested Platforms are layered/nested

Course prerequisites • Basic data structures and programming – Graphs, queues, trees, heap – 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 – A Reading • Course notes and slides • External sources on every topic – A few academic papers – Some tutorial readings on the web – Yes, even a “comic book” We’ll look at these with varying levels of scrutiny.

New! $10! Web/Saa. S/cloud http: //saasbook. info New! $75! http: //csapp. cs. cmu. edu New! $10! Web/Saa. S/cloud http: //saasbook. info New! $75! http: //csapp. cs. cmu. edu a classic No text, but these may be useful. Saltzer/Kaashoek Very MIT Do not buy kindle edition.

Workload: projects 1. C/C++ A. Dynamic memory allocator (malloc/free) B. Unix shell 2. Java Workload: projects 1. C/C++ A. Dynamic memory allocator (malloc/free) B. Unix shell 2. Java concurrency: multi-threaded programming 3. Key/value storage server 4. Performance evaluation of storage server

Projects • Project 1 A done on your own • Projects 1 B-4 done Projects • Project 1 A done on your own • Projects 1 B-4 done in groups of 2 or 3 (or maybe 4) • Email groups to chase@cs. duke. edu – By Wednesday (Sep 5) or sooner – One message per group, list every group member – For everyone: name and Net. ID – Cc: everyone in group • Group members may be asked to rate each other • Procedure for firing and quitting in syllabus

Collaboration • OK among groups: – General discussion of course concepts and programming environment. 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 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.

Syllabus: grades, exams • Projects: 35% • Exams: 65% – Early midterm! Monday, October Syllabus: grades, exams • Projects: 35% • Exams: 65% – Early midterm! Monday, October 1 – Late midterm! Monday, November 12 – Final: Thursday, December 13 at 2: 00 PM

Syllabus: getting help • News and discussion group – Should receive an invitation • Syllabus: getting help • News and discussion group – Should receive an invitation • Office hours – With me: see web – With TA: TBA – With UTAs: TBA

Components and connectors • We use the term component for a software element: – Components and connectors • We use the term component for a software element: – Named building block Abstract Data Type (ADT) object/class/module invoke interface stream through stage or filter – Has an externally visible interface of some kind – Internal details are hidden (encapsulated). SPI “Connector” • A connector: – Enables interaction among components Component API – Established at runtime Component Garlan and Shaw, An Introduction to Software Architecture, 1994.

Instantiating components Context (Domain) Thread Program SPI “Connector” Component API Program Component Load a Instantiating components Context (Domain) Thread Program SPI “Connector” Component API Program Component Load a program and prepare to execute its instructions.

Running a program Program executable module procedure class package image archive library DLL launch Running a program Program executable module procedure class package image archive library DLL launch load execute run instantiate What causes launch?

What’s in a program? What’s in a program?

What’s in a program? code instructions (“text”) procedures data global variables (“static”) constants (“immutable”) What’s in a program? code instructions (“text”) procedures data global variables (“static”) constants (“immutable”) symbols (import/export) names interfaces signatures references

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

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

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

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

Isolated contexts (domains) On most platforms, contexts are isolated. They cannot interfere with one Isolated contexts (domains) 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. 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 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.