CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chapter 3 Process Description and Control
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Slide 2-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 2 Using the Operating System 2.
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
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6 Implementing Processes, Threads, and Resources.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Chapter 6 Implementing Processes, Threads, and Resources.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it.
OS Organization. OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Concurrency Thread abstraction of.
OS Spring’04 Introduction Operating Systems Spring 2004.
Operating System Organization
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Slide 1-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Threads, Thread management & Resource Management.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
 Create an abstract machine environment  A nicer environment than bare hardware  Consists of multiple, autonomous abstract components  Components.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Mid Term review CSC345.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6 Implementing Processes, Threads, and Resources 6.
Operating System Organization Chapter 3 Michelle Grieco.
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.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
Threads, Thread management & Resource Management.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
What is a Process ? A program in execution.
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
Processes and threads.
Operating Systems: A Modern Perspective, Chapter 6
OS Organization.
Chapter 1: Intro (excerpt)
Mid Term review CSC345.
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads Chapter 4.
Operating Systems: A Modern Perspective, Chapter 3
Operating Systems: A Modern Perspective, Chapter 6
OS Organization.
Implementing Processes, Threads, and Resources
CS510 Operating System Foundations
Outline Operating System Organization Operating System Examples
Outline Process Management Process manager Hardware process
Implementing Processes, Threads, and Resources
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Presentation transcript:

CSCI/CMPE 4334 Operating Systems Review: Exam 1 1

Review Chapters 1 ~ 6 in your textbook Lecture slides In-class exercises (on the course website) Review slides 2

Review 5 questions (100 points) + 1 bonus question (20 points) Question types – Q/A 3

Time & Place & Event 9:25am ~ 10:40am, Feb. 18, Thursday ENGR Closed-book exam 4

Chapter 1: Introduction and Overview of Operating Systems Computer system – Hardware – Software Application software System software – Operating system Operating system – resource abstraction: software & hardware abstraction – resource sharing: time & space multiplexing Operating Systems Strategies 5

Chapter 1: Software Classification 6 Loader OS Database Management System Database Management System Window System Window System Application Programmer System Software Libraries Compiler Hardware Command Line Interpreter Command Line Interpreter Libraries Software API

Chapter 1: Purpose of an OS (What is Resource Management?) “An OS creates resource abstractions” “An OS manages resource sharing” 7

Chapter 1: Operating System Functions Resource manager – manage hardware and software resources – Resource abstraction and sharing A nicer environment – implement a virtual machine for processes to run in A program in execution is called a process – a nicer environment than the bare hardware 8

Chapter 1: Abstract Resources 9 Hardware Resources OS OS Resources (OS Interface) Middleware Abstract Resources (API) Application User Interface

Chapter 1: Resource Management Functions Transform physical resources to logical resources – Resource abstraction Make the hardware resources easier to use Multiplex one physical resource to several logical resources – Create multiple, logical copies of resources Schedule physical and logical resources – Decide who gets to use the resources 10

Chapter 1: Resource Sharing Two types of sharing – Time multiplexed sharing time-sharing schedule a serially-reusable resource among several users – Space multiplexed sharing space-sharing divide a multiple-use resource up among several users 11

Chapter 1: Operating Systems Strategies Several different strategies have been used – Earliest computers were dedicated to a single program and there was no multiprogramming and no OS – Batch systems – Timesharing systems – There are a few other recent strategies Personal computers and workstations Embedded systems Small, communicating computers Network technology 12

Chapter 2: Using the Operating System Operating systems provide a virtual computing environment for application programmers – Functions provided by O.S. – Abstract resources by O.S. Files Processes and threads Objects – Programmers can develop applications more efficiently 13

Chapter 2: Using the Operating System (cont'd) Process – an infrastructure in which execution takes place – address space + resources Thread – a program in execution within a process context – each thread has its own stack – Components program counter register set stack space 14

Chapter 2: Using the Operating System (cont'd) UNIX fork() creates a process – Creates a new address space – Copies text, data, & stack into new address space – Provides child with access to open files UNIX wait() allows a parent to wait for a child to terminate UNIX execve() allows a child to run a new program UNIX sleep() allows a process to suspend itself for some time Windows CreateProcess() and CreateThread() Examples of using functions above (see lecture slides) 15

Chapter 2: Processes vs. Threads Benefits of multithreading – Improve application responsiveness Netscape uses multithreaded programming – Use multiprocessors efficiently – Improve program structure – Use fewer system resources – Faster to switch between threads than processes 16

Chapter 2: Algorithms, Programs, and Processes 17 Data Files Other Resources Algorithm Idea Source Program Source Program Binary Program Execution Engine Process Stack Status

Chapter 2: Process Abstraction 18 Hardware Data Process Stack Processor Executable Memory Program Operating System

Chapter 2: A Process with Multiple Threads 19 Data Files Other Resources Binary Program Process Stack Status Stack Status Stack Status Thread (Execution Engine)

Chapter 2: The File Abstraction 20 Hardware Data Process Stack Processor Executable Memory Program Operating System Storage Device File Descriptor File Descriptor

Chapter 3: OS Organization Basic OS Responsibilities Basic OS Functions Three basic implementation mechanisms – Processor modes What are Supervisor & user modes? How to switch between them? What are privileged instructions? – I/O instructions, and instructions to change the mode or set the halt flag – Kernels What is trap instruction for? How to use it? – Method of invoking system service How to perform a system call or message passing? 21

Chapter 3: Basic OS Organization 22 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager

Chapter 3: Device Management OS uses policies chosen by designer or system administrator to manage – Allocation – Isolation – Sharing Device manager in two parts – Device independent – provides unified interface – Device dependent – device driver: handles those aspects unique to a device 23

Chapter 3: Process Management 24 Protection Deadlock Synchronization Process Description Process Description Resource Manager Resource Manager Resource Manager Resource Manager Resource Manager Resource Manager Process Mgr Scheduler CPU Other H/W

Chapter 3: Memory Management 25 Primary Memory Process Manager Process Manager Block Allocation Block Allocation Virtual Memory Virtual Memory Isolation & Sharing Isolation & Sharing Storage Devices

Chapter 3: File System Management 26

Chapter 3: Processor Modes Mode bit: Supervisor or User mode – Some processors may have more than one mode Supervisor mode (privileged, protected) – Can execute all machine instructions – Can reference all memory locations User mode – Can only execute a subset of instructions – Can only reference a subset of memory locations 27

Chapter 3: Trap Instruction 28 … fork(); … fork() { … trapN_SYS_FORK() … } sys_fork() sys_fork() { /* system function */ … return; } Kernel Trap Table

Chapter 3: How to Make a System Call For the system – through a trap instruction which causes an interrupt Hardware saves PC and current status information Hardware changes mode to system mode Hardware loads PC from system call interrupt vector location. Execute the system call interrupt handler return from the handler, restores PC and other saved status information User process continues. 29

Chapter 3: Message Passing 30 send(…, A, …); receive(…, B, …); receive(…A, …); … send(…, B, …); send/receive

Chapter 4: Device Management Abstract all devices (and files) to a few interfaces Device management strategies – Direct I/O with polling – Direct I/O with interrupts – DMA I/O with interrupts – How to use the above strategies to perform I/O? Buffering & Spooling Access time of disk device* – FCFS, SSTF, Scan/Look, Circular Scan/Look – See examples in Exercise (2) 31

Chapter 4: Device Management Organization 32 Application Process Application Process File Manager File Manager Device Controller Command Status Data Hardware Interface System Interface Device-Independent Device-Dependent

Chapter 4: Direct-Memory Access 33

Chapter 5: Implementing Processes, Threads, and Resources Modern process Address space Context switching State diagram 34

Chapter 5: Classic Processes New abstraction divides aspects of classic process into two parts – Modern process: the part that defines a customized computational framework in which a program executes – Thread: the part that keeps track of code executions within this framework Classic process = modern process with 1 thread 35

Chapter 5: The Address Space 36 Process Address Space Address Binding Executable Memory Other objects Files

Chapter 5: Modern Process Composed of: Address space Program to define behavior of process Data used by process Resources needed for thread execution – Process created with a minimal set of resources – Additional resources allocated as needed 37

Chapter 5: Context Switching 38 CPU New Thread Descriptor Old Thread Descriptor

Chapter 5: Simple State Diagram 39 Ready Blocked Running Start Schedule Request Done Request Allocate

Chapter 5: A Generic Resource Manager 40 Process Resource Manager Process Blocked Processes Resource Pool request() release() Policy

Good Luck! Q/A 41