CPS 210: Operating Systems

Similar documents
Machines and Virtualization. Systems and Networks Jeff Chase Spring 2006

Memory Protection. Machines and Virtualization. Architectural Foundations of OS Kernels. Memory and the CPU. Introduction to Virtual Addressing

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

CSC 2405: Computer Systems II

Process Scheduling Queues

Lecture 2: September 9

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Timers 1 / 46. Jiffies. Potent and Evil Magic

Sistemas Operacionais I. Valeria Menezes Bastos

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

CSC 4320 Test 1 Spring 2017

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Lecture 15: I/O Devices & Drivers

Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter

Chapter 13: I/O Systems

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

POSIX Threads: a first step toward parallel programming. George Bosilca

CSC 453 Operating Systems

Process Description and Control

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

Module 1. Introduction:

Threads Implementation. Jo, Heeseung

CS 5460/6460 Operating Systems

What s in a process?

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

Processes and Non-Preemptive Scheduling. Otto J. Anshus

CS5460: Operating Systems

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process

Concurrency: Deadlock and Starvation

Chapter 13: I/O Systems

CSE 120 Principles of Operating Systems

10/10/ Gribble, Lazowska, Levy, Zahorjan 2. 10/10/ Gribble, Lazowska, Levy, Zahorjan 4

殷亚凤. Processes. Distributed Systems [3]

Yi Shi Fall 2017 Xi an Jiaotong University

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

UNIVERSITY OF NEBRASKA AT OMAHA COURSE SYLLABUS/DESCRIPTION

OPERATING SYSTEMS UNIT - 1

Agenda. Threads. Single and Multi-threaded Processes. What is Thread. CSCI 444/544 Operating Systems Fall 2008

Distributed Systems Operation System Support

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Lecture 9: Midterm Review

Operating Systems. studykorner.org

Part I Introduction Hardware and OS Review

Operating Systems Comprehensive Exam. Spring Student ID # 2/17/2011

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

Client Server & Distributed System. A Basic Introduction

Introduction. CS3026 Operating Systems Lecture 01

CS370 Operating Systems

! How is a thread different from a process? ! Why are threads useful? ! How can POSIX threads be useful?

What is an Operating System? A Whirlwind Tour of Operating Systems. How did OS evolve? How did OS evolve?

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

!! How is a thread different from a process? !! Why are threads useful? !! How can POSIX threads be useful?

CS350: Final Exam Review

Course Details. Operating Systems with C/C++ Course Details. What is an Operating System?

EECS 482 Introduction to Operating Systems

Chapter 13: I/O Systems

Threads. Computer Systems. 5/12/2009 cse threads Perkins, DW Johnson and University of Washington 1

18-447: Computer Architecture Lecture 16: Virtual Memory

Operating Systems Overview. Chapter 2

06-Dec-17. Credits:4. Notes by Pritee Parwekar,ANITS 06-Dec-17 1

Qualifying exam: operating systems, 1/6/2014

Welcome to CSE 4300! Spring 2018

@2010 Badri Computer Architecture Assembly II. Virtual Memory. Topics (Chapter 9) Motivations for VM Address translation

Input/Output Management

Operating System Overview

Administrivia. Nachos guide and Lab #1 are on the web.

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition

Basic Computer Hardware

What s in a traditional process? Concurrency/Parallelism. What s needed? CSE 451: Operating Systems Autumn 2012

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall

Lecture 4: Process Management

IT 540 Operating Systems ECE519 Advanced Operating Systems

CSE 120 Principles of Operating Systems

CS30002: Operating Systems. Arobinda Gupta Spring 2017

Module 12: I/O Systems

CSE 410: Systems Programming

Lecture 1 Introduction (Chapter 1 of Textbook)

Architectural Support for Operating Systems

Operating Systems. Lecture Course in Autumn Term 2015 University of Birmingham. Eike Ritter. September 22, 2015

Chapter 13: I/O Systems

Virtual Machines Disco and Xen (Lecture 10, cs262a) Ion Stoica & Ali Ghodsi UC Berkeley February 26, 2018

Hardware OS & OS- Application interface

Lecture 2: Architectural Support for OSes

OPERATING SYSTEMS INTERNALS AND DESIGN PRINCIPLES. William Stallings SIXTH EDITION. Pearson Education International. Prentice Hall

Computer System Overview

Chapter 1: Introduction

Operating System Review

CSC 453 Operating Systems

Chapter 13: I/O Systems

Transcription:

CPS 210: Operating Systems

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

Operating Systems: The Classical View processes data data threads The Kernel

kernel Key Concepts 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.

Operating Systems: The Classical View processes in private virtual address spaces data data The kernel sets up process execution contexts to virtualize the machine. system call traps...and upcalls (e.g., signals) shared kernel code and data in shared address space CPU and devices force entry to the kernel to handle exceptional events. Threads or processes enter the kernel for services.

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?

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

Architectural Foundations of OS Kernels One or more privileged execution modes (e.g., kernel mode) protected device control registers privileged instructions to control basic machine functions System call trap instruction and protected fault handling User processes safely enter the kernel to access shared OS services. Virtual memory mapping OS controls virtual-physical translations for each address space. Device interrupts to notify the kernel of I/O completion etc. Includes timer hardware and clock interrupts to periodically return control to the kernel as user code executes. Atomic instructions for coordination on multiprocessors

Introduction to Virtual Addressing User processes address memory through virtual addresses. virtual memory (big) text data physical memory (small) The kernel controls the virtual-physical translations in effect for each space. The kernel and the machine collude to translate virtual addresses to physical addresses. BSS user stack args/env kernel The machine does not allow a user process to access memory unless the kernel says it s OK. virtual-to-physical translations The specific mechanisms for implementing virtual address translation are machine-dependent.

Part I Part II Part III CPS 210, Spring 2002 The stuff you should already know. The stuff you should learn. The questions we re trying to answer now through ongoing research in systems. Tanenbaum: undergrad OS text. Research papers: 10-12 to 20.

CPS 210: Part I Concurrency and synchronization Threads and processes, race conditions, mutexes, semaphores, coordination, condition variables, starvation and deadlock Everyone has to know this stuff. A few lectures, problem set + exam 1/29 Classical operating systems Processes and the kernel, system calls, kernel services, file I/O, virtual memory. A few more lectures. New this semester: the infamous Nachos labs: 2/5 and 2/19.

What is Nachos? (Part 1) MIPS User Applications User Applications Nachos OS Operating System Solaris OS Architecture Architecture Nachos is designed to look, feel, and crash like a real OS. Both the Nachos OS and test programs run together as an ordinary process on an ordinary Unix system (Solaris).

What is Nachos? (Part 2) User Applications MIPS User Applications Operating System Nachos OS Architecture Solaris OS Architecture Nachos runs real user programs on a simulated machine. MIPS simulator in Nachos executes real user programs. The real OS is treated as part of the underlying hardware.

Nachos: A Peek Under the Hood shell data cp data user space MIPS instructions executed by SPIM SPIM MIPS emulator fetch/execute examine/deposit ExceptionHandler() Machine::Run() Nachos kernel SaveState/RestoreState examine/deposit Machine object Rn SP PC registers memory page table process page tables

Overview of the Nachos Labs Lab 1 Synchronization primitives from scratch. Uniprocessor kernel-mode mutexes and condition variables. Kernel process management system calls. Like Unix fork/exec/exit/wait with simple virtual memory. Lab 2 Interprocessor communication using pipes and I/O descriptors. Simple command shell and user programs. Paged virtual memory with page cache management.

Secrets of the Nachos Labs 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.

Classical OS view: advanced topics CPS 210: Part II Deconstructing the OS Servers, network storage, RAID, end-system networking Resource management, continuous media Quantitative system performance Reliability and robustness Systems as an experimental research discipline Research vs. development Styles of research Goals and methodology What/how to measure? Performance? Dependability? Performability?

Effect of Hardware on Software Advances in hardware technology drive software/os changes. In the beginning, humans were cheap, computers were expensive. centralized computers, batch processing, no direct user interaction Now computers are cheap. dedicated workstations, PCs, and servers in a networked world emphasize ease-of-use and effective interaction over raw performance Faster and cheaper hardware is the defining force in systems. OS interfaces and policies depend on relative speed and cost of the different components. E.g., faster networks allow tighter coupling of clustered systems. [McKinley]

History Lesson From 1950 to now (50-year history of computing) we ve seen a 3-9 order-of-magnitude change in almost every component. Compare to: MIPS: from 0.5 in 1983 to 500 in 1998. Price/MIP: from $100K in 1983 to $300 today. Memory: 1 MB memories in 1983 to 1 GB memories today. Network: 10 Mb/s in 1983 to 1 Gb/s or more today. Secondary store: 1 GB in 1983 to 1 TB today. Virtual address space: 32 in 1983 to 64 today. transportation: horseback to the Concorde in 200 years [McKinley]

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

Contemporary research directions CPS 210: Part III Incorporating processing into network and storage elements. Active storage, extensible switches and active networks, active proxies, firewall appliances and other intermediaries, etc. Server-based computing and computing utilities. Autonomic computing : self-organizing server networks. Mobile computing and power management. Harnessing massive storage resources. Massively decentralized systems. Massive scale and robustness: sensor networks, peer-to-peer. New evaluation methodologies.

E-Track, G-Track, G and Grading Problem sets and labs Exams 3-5: 45% 3: 45% Exit interview, subjective factors 10% E-track EC on labs and problem sets Semester project Does not affect quals pass! G E