1 I/O Devices Controller: physically controls the devices Devices are diverse and complicated Present simpler interface to OS E.g, convert a linear sector.

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.
Operating Systems COMP 4850/CISG 5550 Processes Introduction to Threads Dr. James Money.
EEE 435 Principles of Operating Systems Operating System Concepts (Modern Operating Systems 1.5)
EEE 435 Principles of Operating Systems Principles and Structure of I/O Software (Modern Operating Systems 5.2 & 5.3) 5/22/20151Dr Alain Beaulieu.
Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
OPERATING SYSTEM LESSON 2. INTRODUCTION TO OPERATING SYSTEM Computer Hardware’s complexity Operating Systems (OS) hide this complexity from users OS manages.
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 Processes Professor Jennifer Rexford
1 Processes and Pipes COS 217 Professor Jennifer Rexford.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
OPERATING SYSTEM OVERVIEW
Embedded Real-time Systems The Linux kernel. The Operating System Kernel Resident in memory, privileged mode System calls offer general purpose services.
1 Device Management The von Neumann Architecture System Architecture Device Management Polling Interrupts DMA operating systems.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Process Management: Processes and Threads CS 342 – Operating Systems Ibrahim.
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 3 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
1 Outline Basic memory management Swapping Virtual memory Page replacement algorithms Modeling page replacement algorithms Design issues for paging systems.
System Calls 1.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
Chapter 5 Input/Output. 2 Introduction I/O: main function of OS –Drive devices, catch interrupts, handle errors –Provide a device independent interface.
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Chapter 3 Process Description and Control
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.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: Phone:
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
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.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Introduction to Operating Systems and Concurrency.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
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.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 2 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
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.
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
I/O Software CS 537 – Introduction to Operating Systems.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Operating Systems: History, Hardware & Concepts Ch 1.4 & 1.5 Thursday, January 18, 2007.
Threads prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University 1July 2016Processes.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
CS 3305 System Calls Lecture 7.
© CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA
More examples How many processes does this piece of code create?
Operating Systems Chapter 5: Input/Output Management
Today’s agenda Hardware architecture and runtime system
Chapter 5: I/O Systems.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Lecture 6: Multiprogramming and Context Switching
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CS510 Operating System Foundations
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Presentation transcript:

1 I/O Devices Controller: physically controls the devices Devices are diverse and complicated Present simpler interface to OS E.g, convert a linear sector number to number of cylinder, sector and head. Device driver: software talks to a controller Installation of drivers Re-link kernel with new driver, reboot Register driver in system file, reboot Install on-the-fly, PNP, NO reboot device controller driver Operating system

2 Handle I/O: Busy Waiting User programKernelDriver I/O device Issue a system call (TRAP) Call driver Start I/O PollingDo I/O Put data Return control to caller Continue TIMETIME CPU Wasted

3 An Example // p is the buffer for (i=0; i<count; i++){ while (*printer_status_reg!=READY); *printer_data_register=p[i]; } return_to_user(); // loop on every character // loop until ready // output one character

4 I/O by Interrupt Driver tells controller what to do by writing its device registers. Then the controller starts the device. Controller finishes reading/writing, and then signals the interrupt controller If interrupt controller can accept the interrupt, it informs CPU Interrupt controller puts the number of device on the bus, CPU read it CPU Interrupt controllerDisk controller Disk drive

5 Interrupt-Driven I/O Print system call enable_interrupts(); *printer_data_register=p[0]; scheduler(); Interrupt service procedure if (count==0){ unblock_user(); } else { *printer_data_register=p[I]; count--; i++; } acknowledge_interrupt(); return_from_interrupt(); Interrupt occurs on every character!

6 Direct Memory Access (DMA) User programKernel I/O device & memory Issue a system call Set up DMA chip Suspended Run other programs I/O directly Issue interrupt when finish Set the program status as “ready” Ready to continue

7 I/O Using DMA Too many interrupts in interrupt-driven I/O DMA reduces # of interrupts from 1/char to 1/buffer printed Print system call copy_from_user(buffer, p, count); set_up_DMA_controller(); scheduler(); Interrupt service procedure acknowledge_interrupt(); unblock_user(); return_from_interrupt();

8 Advanced Computer With Multiple Buses IDE bus SCSI bus USB bus Level 2 cache CPU PCI bridge Main memory Cache busLocal busMemory bus PCI bus Available PCI slot SCSIUSB ISA bridge IDE disk Graphics adaptor Monitor ISA bus MouseKeyboard ModemSound cardPrinter Available ISA slot

Chapter 2 Processes and Threads

10 Outline Processes Threads Inter-process communication (IPC) Classical IPC problems Scheduling

11 Process A program in execution a single instance of an executable program User enters a command, invokes a program, while this program is executing it is called a process E.g, when a user types the command “ls”, the UNIX system creates a process for this command. Different processes running different programs: Word, Excel Different processes running same programs: multiple web-browsers in a PC

12 Much More Than A Program Address space contain the executable program, the program’s data, and its stack. I/O devices associated Files opened Execution State: Registers, e.g., PC, PSW, SP, …

13 Process Vs. Programs: An Analogue A baker (CPU) uses a recipe (program) to transform the baking ingredients (input data), with the aid of cooking utensils and appliances (resources), into a cake (output). We recognize this entire activity as the process - an abstraction of an executing recipe.

14 Process Vs. Program Program is a script, while process is an activity (execution) based on this script. Cake recipe  program, baking cake based on the recipe  process Different processes may share the same program One copy of script, but multiple executions Process is more than a script Script, input, output, state, etc.

15 Information About Process Process table in operating systems One entry for each process in existence Process ID, program counter, working directory, registers, etc. Core image: process address space Instruction codes and data Process information = Process table entry + core image

16 Interleaving Execution of Processes More than one process exist. CPU switches from process to process. Process A Process B Process A Process C Process B Process C Which process to run next? Process switching Time

17 Pseudo-parallelism At any instant, the CPU is running only one process. In the course of 1 second, it may work on several different processes. The illusion of parallelism The true hardware parallelism: multi-processor Multi-programming CPU switches back and forth between processes.

18 Different Points of View Process D  C  B  A  Time  Running independently of each other. Each process has its own logical program counter (PC). But only one physical PC in CPU. A  B  C  D  E  From User From OS t1

19 Process Creation – When? System initialization Created by another process User request Initialization of a batch job

20 Process Creation in System Initialization Foreground processes Interact with users E.g., UNIX shell Background processes Not associated with particular user Daemons: have some specific functions E.g., Accepting s, accepting web page request