CPS 110/EE 153 Course Intro.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

Introduction CSCI 444/544 Operating Systems Fall 2008.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Phones OFF Please Operating System Introduction Parminder Singh Kang Home:
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Operating Systems.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Protection and the Kernel: Mode, Space, and Context.
9/14/2015B.Ramamurthy1 Operating Systems : Overview Bina Ramamurthy CSE421/521.
CPS 210: Operating Systems. The operating system (OS) is the interface between user applications and the hardware. An OS implements a sort of virtual.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
Fall 2000M.B. Ibáñez Lecture 01 Introduction What is an Operating System? The Evolution of Operating Systems Course Outline.
Threads and Concurrency. A First Look at Some Key Concepts kernel The software component that controls the hardware directly, and implements the core.
April 2000Dr Milan Simic1 Network Operating Systems Windows NT.
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.
Race Conditions Defined 1. Every data structure defines invariant conditions. defines the space of possible legal states of the structure defines what.
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.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Introduction to Operating Systems and Concurrency.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
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.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Introduction to Operating Systems Concepts
Introduction to threads
Operating System Overview
Chapter 1: Introduction
Introduction to Basic OS Concepts
Definitions, intro, history
Operating Systems : Overview
CS 6560: Operating Systems Design
COMPSCI 110 Operating Systems
Chapter 1: Introduction
Operating System Structure
CS490 Windows Internals Quiz 2 09/27/2013.
Chapter 1: Introduction
Operating Systems and Systems Programming
Operating Systems : Overview
OS Organization.
Objective Understand the concepts of modern operating systems by investigating the most popular operating system in the current and future market Provide.
Chapter 2: System Structures
Operating Systems : Overview
Lecture Topics: 11/1 General Operating System Concepts Processes
Introduction to Operating Systems
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Threads Chapter 4.
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems Lecture 3.
Subject Name: Operating System Concepts Subject Number:
Operating Systems : Overview
Operating Systems : Overview
OS Components and Structure
CS510 Operating System Foundations
Outline Operating System Organization Operating System Examples
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Objective Understand the concepts of modern operating systems by investigating the most popular operating system in the current and future market Provide.
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Lecture Topics: 11/1 Hand back midterms
Presentation transcript:

CPS 110/EE 153 Course Intro

Operating Systems: The Big Picture The operating system (OS) is the interface between user applications and the hardware. An OS implements a sort of virtual machine that is easier to program than the raw hardware. User Applications Operating System Architecture virtual machine interface physical machine interface [McKinley]

The OS and the Hardware The OS is the “permanent” software with the power to: control/abstract/mediate access to the hardware CPUs and memory I/O devices so user code can be: simpler device-independent portable even “transportable” interrupts Processor Cache Memory Bus I/O Bridge Main Memory I/O Bus Disk Controller Graphics Controller Network Interface Disk Disk Graphics Network

The OS and User Applications The OS defines a framework for users and their programs to coexist, cooperate, and work together safely, supporting: concurrent execution/interaction of multiple user programs shared implementations of commonly needed facilities “The system is all the code you didn’t write.” mechanisms to share and combine software components Extensibility: add new components on-the-fly as they are developed. policies for safe and fair sharing of resources physical resources (e.g., CPU time and storage space) logical resources (e.g., data files, programs, mailboxes)

Overview of OS Services Storage: primitives for files, virtual memory, etc. control devices and provide for the “care and feeding” of the memory system hardware and peripherals Protection and security set boundaries that limit damage from faults and errors establish user identities, priorities, and accountability access control for logical and physical resources Execution: primitives to create/execute programs support an environment for developing and running applications Communication: “glue” for programs to interact

The Four Faces of Your Operating System service provider The OS exports commonly needed facilities with standard interfaces, so that programs can be simple and portable. executive/bureaucrat/juggler The OS controls access to hardware, and allocates physical resources (memory, disk, CPU time) for the greatest good. caretaker The OS monitors the hardware and intervenes to resolve exceptional conditions that interrupt smooth operation. cop/security guard The OS mediates access to resources and grants/denies requests.

Other Useful Metaphors 1. Phone systems Defines an infrastructure for users to call each other and talk. - doesn’t dictate who you call; doesn’t dictate what you say - supports services not imagined by creators, e.g., 900 numbers 2. Government Sets rules and balances demands from a diverse community. Users/subjects want high levels of service with low taxes. 3. Transportation Wide range of choices for a wide range of user goals and needs. - race car: simple interface to powerful technology…goes fast…crashes hard. - cadillac: makes choices automatically…comfortable…no fun to drive. - SUV: runs on any terrain…rolls over bumps…burns gas…but gas is cheap. Race car: a thin layer between the driver and the engine. Cadillac: dual air bags, power assist steering, kind of clunky. Phcone system: digital communications, call waiting, caller ID, and other unanticipated uses….basic infrastructure, much the same everywhere. SUV comes in lots of nice colors timesharing: city bus…somebody else is driving…cheap, but takes a while to get where you’re going The System as Taxi Cab generic goes where you want...fast enough you only get it when its idle you don’t need to know how to drive you have little control over safety (a network OS for a cluster of public workstations)

Studying Operating Systems This course deals with “classical” operating systems issues: the services and facilities that operating systems provide; OS implementation on modern hardware; (and architectural support for modern operating systems) how hardware and software evolve together; the techniques used to implement software systems that are: large and complex, long-lived and evolving, concurrent, performance-critical.

Server farms (clusters) The World Today desktop clients Servers database file web ... Internet Server farms (clusters) mobile devices Internet appliances LAN/SAN Network

The Big Questions 1. How to divide function/state/trust across components? reason about flow of data and computation through the system 2. What abstractions/interfaces are sufficiently: powerful to meet a wide range of needs? efficient to implement and simple to use? versatile to enable construction of large/complex systems? 3. How can we build: reliable systems from unreliable components? trusted systems from untrusted components? unified systems from diverse components? coherent systems from distributed components?

Classical View: The Questions The basic issues/questions in this course are how to: allocate memory and storage to multiple programs? share the CPU among concurrently executing programs? suspend and resume programs? share data safely among concurrent activities? protect one executing program’s storage from another? protect the code that implements the protection, and mediates access to resources? prevent rogue programs from taking over the machine? allow programs to interact safely?

Memory and the CPU OS data OS code CPU Data Data registers OS code CPU OS data Program A Data data R0 x Program B Rn Data PC x registers code library 2n main memory

A First Look at Some Key Concepts kernel The software component that controls the hardware directly, and implements the core privileged OS functions. Modern hardware has features that allow the OS kernel to protect itself from untrusted user code. thread An executing stream of instructions and its CPU register context. virtual address space An execution context for thread(s) that provides an independent name space for addressing some or all of physical memory. process An execution of a program, consisting of a virtual address space, one or more threads, and some OS kernel state.

The Kernel The kernel program resides in a well-known executable file. The “machine” automatically loads the kernel into memory (boots) on power-on or reset. The kernel is (mostly) a library of service procedures shared by all user programs, but the kernel is protected: User code cannot access internal kernel data structures directly. User code can invoke the the kernel only at well-defined entry points (system calls). Kernel code is like user code, but the kernel is privileged: Kernel has direct access to all hardware functions, and defines the machine entry points for interrupts and exceptions.

A Protected Kernel OS data OS code CPU OS code CPU Mode register bit indicates whether the CPU is running in a user program or in the protected kernel. Some instructions or data accesses are only legal when the CPU is executing in kernel mode. OS data Program A data Data mode R0 x Program B Rn Data PC x registers code library 2n main memory

Threads A thread is a schedulable stream of control. defined by CPU register values (PC, SP) suspend: save register values in memory resume: restore registers from memory Multiple threads can execute independently: They can run in parallel on multiple CPUs... - physical concurrency …or arbitrarily interleaved on a single CPU. - logical concurrency Each thread must have its own stack.

The Problem of Concurrency

Making It Concrete It is best to learn the general concepts of systems from a careful study of particulars. Microsoft Windows and NT (Windows 2000)? Unix or Sun Microsystem’s Solaris? MacOS? Linux or *BSD? Java? Nope: we will use “Nachos”.

Course Materials for CPS 110 Course viewgraphs on the web site http://www.cs.duke.edu/~chase/cps110 The Nachos instructional OS Nachos Project Guide Nutt: Operating Systems: A Modern Perspective (1998) Other readings on the course web site Birrell: An Introduction to Programming with Threads. etc.?

Nachos Projects Labs 1-3: concurrency and synchronization race conditions with processes and threads implementing/using synchronization for safe concurrent code Lab 4: protected kernel with multiprogramming OS kernel with system calls, memory allocation, virtual address translation, protection Lab 5: I/O and inter-process communication Labs 6-7: virtual memory page faults and demand loading page replacement and page cache management

We’re Not in Kansas Anymore Be careful out there: CPS 110 is For Mature Audiences Only. Any OS is a complex beast with lots of moving parts. Concurrency adds an unfamiliar and difficult element. Virtual Machines are difficult to think about and debug. For Nachos you will extend a base of Someone Else’s Code. Working in teams is a double-edged sword. These labs by design leave more opportunity for creative interpretation than is common in introductory classes. The Unix/C++ development environment is a powerful tool offering many opportunities to “shoot yourself in the foot”.

Secrets of the Nachos Labs We skip the hand holding; you skip the hand wringing over picky details of what you are “supposed to do”. You are free to resolve ambiguity as you see fit, and you must justify your choices. It’s the thought that counts. Think before you design it. Think before you code it. Think before you run it. Think before you debug it. The time needed to conceive and write the code is moderate, but debugging time is potentially unbounded.

Secrets of CPS 110 1. If you work hard, we work hard to help you. Slackers are persona non grata (you know who you are). 2. Be ready to work concurrency problems on the exams. Drill it and use it in the labs. 3. Pay careful attention to team management for the labs. New rule this semester: teams may eject slackers by unanimous vote of the remaining members. 4. Pay attention to the newsgroup, and post if you need help. cc: chase 5. Have confidence in the grading.

Overview of Nachos Labs 1-3 In the thread assignments, you build and test the kernel’s internal primitives for processes and synchronization. Think of your program as a “real” kernel doing “real basic” things. boot and initialize run main(), parse arguments, initialize machine state run a few tests create multiple threads to execute some kernel code shut down ...runs native, directly on the host machine. Kernel only; no user programs (until Lab 4)

What To Do Next 1. Form teams of four. (2-5) 2. Look at the course web and the Nachos Project Guide. On the Web, and I will hand out hard-copy on Tuesday. 3. Install and build the Nachos release. Determine where your source code will reside. Set up ACLs so your team and my TAs can access your code. Optional: set up version control (e.g., CVS). Report any problems.