CSE 153 Design of Operating Systems

Similar documents
CS153: Process. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

CSE 153 Design of Operating Systems Fall 2018

CSE 153 Design of Operating Systems

EECS 482 Introduction to Operating Systems

Lecture 4: Process Management

Advanced Operating Systems (CS 202) Scheduling (1)

CS 475. Process = Address space + one thread of control Concurrent program = multiple threads of control

CSE 153 Design of Operating Systems Fall 18

CS 31: Intro to Systems Operating Systems Overview. Kevin Webb Swarthmore College March 31, 2015

PROCESSES. Jo, Heeseung

Processes. Jo, Heeseung

CSE 451: Operating Systems Winter Module 4 Processes. Mark Zbikowski Allen Center 476

Main Memory: Address Translation

18-447: Computer Architecture Lecture 16: Virtual Memory

Advanced Operating Systems (CS 202)

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission 1

Threads. CSE 410, Spring 2004 Computer Systems.

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

CSE 120 Principles of Operating Systems

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

Process management. What s in a process? What is a process? The OS s process namespace. A process s address space (idealized)

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

EECS 482 Introduction to Operating Systems

Processes & Threads. Recap of the Last Class. Microkernel System Architecture. Layered Structure

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CSE 153 Design of Operating Systems

OS lpr. www. nfsd gcc emacs ls 9/18/11. Process Management. CS 537 Lecture 4: Processes. The Process. Why Processes? Simplicity + Speed

Kernels & Processes The Structure of the Operating System

CIS Operating Systems Introduction. Professor Qiang Zeng

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

Announcement. Exercise #2 will be out today. Due date is next Monday

Process Description and Control

Advanced Operating Systems (CS 202) Scheduling (1) Jan, 23, 2017

Midterm 1. Administrivia. Virtualizing Resources. CS162 Operating Systems and Systems Programming Lecture 12. Address Translation

CSE 153 Design of Operating Systems

518 Lecture Notes Week 3

Lecture 4: Mechanism of process execution. Mythili Vutukuru IIT Bombay

EECS 482 Introduction to Operating Systems

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

CS 153 Design of Operating Systems Winter 2016

Processes and Threads

Operating Systems and Protection CS 217

Slide 6-1. Processes. Operating Systems: A Modern Perspective, Chapter 6. Copyright 2004 Pearson Education, Inc.

Introduction to Process in Computing Systems SEEM

CS 31: Intro to Systems Operating Systems Overview. Kevin Webb Swarthmore College November 8, 2018

Lecture 4: Threads; weaving control flow

Unix Processes. What is a Process?

Today: Protection. Protection

Today: Protection! Protection!

CS 153 Design of Operating Systems Winter 2016

High Performance Computing Lecture 11. Matthew Jacob Indian Institute of Science

www nfsd emacs lpr Process Management CS 537 Lecture 4: Processes Example OS in operation Why Processes? Simplicity + Speed

Processes. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems

CS5460: Operating Systems

CS61 Scribe Notes Date: Topic: Fork, Advanced Virtual Memory. Scribes: Mitchel Cole Emily Lawton Jefferson Lee Wentao Xu

CS 318 Principles of Operating Systems

Lecture 9: Midterm Review

CS510 Operating System Foundations. Jonathan Walpole

Processes & Threads. Recap of the Last Class. Layered Structure. Virtual Machines. CS 256/456 Dept. of Computer Science, University of Rochester

Operating System Review

CSE 410: Computer Systems Spring Processes. John Zahorjan Allen Center 534

Lecture 4: Memory Management & The Programming Interface

Preview. The Thread Model Motivation of Threads Benefits of Threads Implementation of Thread

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

CS 326: Operating Systems. Lecture 1

Threads. CS-3013 Operating Systems Hugh C. Lauer. CS-3013, C-Term 2012 Threads 1

OPERATING SYSTEM OVERVIEW

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

CS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement"

Distributed Systems Operation System Support

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

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

Lecture 2: Processes. CSE 120: Principles of Opera9ng Systems. UC San Diego: Summer Session I, 2009 Frank Uyeda

CSE 120 Principles of Operating Systems

The Process Abstraction. CMPU 334 Operating Systems Jason Waterman

Virtual Memory. CS61, Lecture 15. Prof. Stephen Chong October 20, 2011

What s in a process?

Processes. CS439: Principles of Computer Systems January 24, 2018

Applications of. Virtual Memory in. OS Design

CS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University

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

CS/ECE 6780/5780. Al Davis

Page 1. Lab 5 Logistics. Implicit Threads. Explicit Thread Semantics. Problem not enough interrupt pins CS/ECE 6780/5780. Al Davis

ECE 598 Advanced Operating Systems Lecture 14

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

CS 5460/6460 Operating Systems

EECS 482 Introduction to Operating Systems

Anne Bracy CS 3410 Computer Science Cornell University

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

csci3411: Operating Systems

Spring 2017 :: CSE 506. Introduction. Nima Honarmand

Virtual Memory. 11/8/16 (election day) Vote!

CSE 410: Systems Programming

(Refer Slide Time: 1:26)

CSE 451: Operating Systems. Section 10 Project 3 wrap-up, final exam review

Page 1. Goals for Today" Virtualizing Resources" Important Aspects of Memory Multiplexing" CS162 Operating Systems and Systems Programming Lecture 20

Processes. CS439: Principles of Computer Systems January 30, 2019

CS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College November 15, 2018

Transcription:

CSE 153 Design of Operating Systems Winter 2019 Lecture 4: Processes

Administrivia If you have not already, please make sure to enroll in piazza ~20 students have not yet Lab 1: please check the hints part of the lab (bottom section)-- I will may post additional items CSE 153 Lecture 4 Processes 2

Last class OS structure, operation, and interaction with user progs Privileged mode: To enforce isolation and manage resources, OS must have exclusive powers not available to users» How does the switch happen securely? OS is not running unless there is an event:» OS schedules a user process to run then goes to sleep» It wakes up (who wakes it?) to handle events» Many types of events Program view and system calls: program asks the OS when it needs a privileged operation CSE 153 Lecture 4 Processes 3

OS Abstractions Applications Process File system Virtual memory Operating System CPU Hardware Disk RAM Today, we start discussing the first abstraction that enables us to virtualize (i.e., share) the CPU processes! CSE 153 Lecture 4 Processes 4

What is virtualization? What is a virtual something? Somehow not real? But still functional? Provide illusion for each program of own copy of resources Lets say the CPU or memory; every program thinks it has its own In reality, limited physical resources (e.g., 1 CPU)» It must be shared! (in time, or space) Frees up programs from worrying about sharing The OS implements sharing, creating illusion of exclusive resources àvirtualization! Virtual resource provided as an object with defined operations on it. à Abstraction 5

Virtualizing the CPU -- Processes This lecture starts a class segment that covers processes, threads, and synchronization Basis for Midterm and Labs 1 and 2 Today s topics are processes and process management How do we virtualize the CPU?» Virtualization: give each program the illusion of its own CPU» What is the magic? We only have one real CPU How are applications represented in the OS? How is work scheduled in the CPU? CSE 153 Lecture 4 Processes 6

The Process The process is the OS abstraction for execution It is the unit of execution It is the unit of scheduling A process is a program in execution Programs are static entities with the potential for execution Process is the animated/active program» Starts from the program, but also includes dynamic state» As the representative of the program, it is the owner of other resources (memory, files, sockets, ) How does the OS implement this abstraction? How does it share the CPU? CSE 153 Lecture 4 Processes 7

How to support this abstraction? First, we ll look at what state a process encapsulates State of the virtual processor we are giving to each program Next we will talk about process behavior/cpu time sharing How to implement the process illusion Next, we discuss how the OS implements this abstraction What data structures it keeps, and the role of the scheduler Finally, we see the process interface offered to programs How to use this abstraction Next class CSE 153 Lecture 4 Processes 8

Process Components A process contains all the state for a program in execution An address space containing» Static memory: The code and input data for the executing program» Dynamic memory: The memory allocated by the executing program An execution stack encapsulating the state of procedure calls Control registers such as the program counter (PC) A set of general-purpose registers with current values A set of operating system resources» Open files, network connections, etc. A process is named using its process ID (PID) CSE 153 Lecture 4 Processes 9

Address Space (memory abstraction) 0xFFFFFFFF Stack SP Dynamic Address Space 0x00000000 Heap (Dynamic Memory Alloc) Static Data (Data Segment) Code (Text Segment) PC Static CSE 153 Lecture 4 Processes 10

How to support this abstraction? First, we ll look at what state a process encapsulates State of the virtual processor we are giving to each program Next we will talk about process behavior/cpu time sharing How to implement the process illusion Next, we discuss how the OS implements this abstraction What data structures it keeps, and the role of the scheduler Finally, we see the process interface offered to programs How to use this abstraction Next class CSE 153 Lecture 4 Processes 11

Process Execution State A process is born, executes for a while, and then dies The process execution state that indicates what it is currently doing Running: Executing instructions on the CPU» It is the process that has control of the CPU» How many processes can be in the running state simultaneously? Ready: Waiting to be assigned to the CPU» Ready to execute, but another process is executing on the CPU Waiting: Waiting for an event, e.g., I/O completion» It cannot make progress until event is signaled (disk completes) CSE 153 Lecture 4 Processes 12

Execution state (cont d) As a process executes, it moves from state to state Unix ps -x : STAT column indicates execution state What state do you think a process is in most of the time? How many processes can a system support? CSE 153 Lecture 4 Processes 13

Execution State Graph Create Process New Ready I/O Done Unschedule Process Schedule Process Waiting Terminated Running I/O, Page Fault, etc. Process Exit CSE 153 Lecture 4 Processes 14