Operating Systems Chapter 5: Input/Output Management

Slides:



Advertisements
Similar presentations
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Advertisements

Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components.
Categories of I/O Devices
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
Part 5 (Stallings) Input/Output 5.1 Principles of I/O hardware
1 Input/Output Chapter Principles of I/O hardware 5.2 Principles of I/O software 5.3 I/O software layers 5.4 Disks 5.5 Clocks 5.6 Character-oriented.
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.
Lecture 7b I/O. I/O devices  Device (mechanical hardware)  Device controller (electrical hardware)  Device driver (software)
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Paging Design Input-Output.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Chapter 5 Input/Output 5.1 Principles of I/O hardware
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 Input/Output – 3 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Copyright ©: Nahrstedt, Angrave, Abdelzaher
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
1 I/O and Filesystems. 2 How to provide interfaces Rough reading guide (no exam guarantee): Tanenbaum Ch. 5.1 – 5.5 & Silberschatz Ch. 13 & ,
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Sistem Operasi IKH311 Masukan Luaran (Input/Output)
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.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
Interrupts By Ryan Morris. Overview ● I/O Paradigm ● Synchronization ● Polling ● Control and Status Registers ● Interrupt Driven I/O ● Importance of Interrupts.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
Chapter 5 Input/Output 5.1 Principles of I/O hardware
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 2 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
I/O Software CS 537 – Introduction to Operating Systems.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Introduction to Operating Systems Concepts
Input/Output (I/O) Important OS function – control I/O
I/O Management.
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Multiple Platters.
Operating Systems (CS 340 D)
Input/Output.
CS 286 Computer Organization and Architecture
CS703 - Advanced Operating Systems
Computer Architecture
CSCI 315 Operating Systems Design
© CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA
Module 2: Computer-System Structures
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Chapter 5: I/O Systems.
CSE 451: Operating Systems Spring 2007 Module 15 I/O
Module 2: Computer-System Structures
Chapter 8 I/O.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Module 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 2: Computer-System Structures
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Operating Systems Chapter 5: Input/Output Management Instr: Yusuf Altunel IKU Department of Computer Engineering

Content Principles of I/O hardware Principles of I/O software I/O Devices Device Controllers Direct Memory Access Interrupts Principles of I/O software Programmed I/O Interrupt Driven I/O I/O Using DMA

Introduction OS Functions The I/0 codes represent to control all the computer’s I/O (Input/Output) devices issue commands to the devices catch interrupts handle errors to provide an interface to the devices device independence: the interface should be the same for all devices The I/0 codes represent a significant fraction of the total operating system

I/O Hardware block devices stores information Common block sizes: in fixed-size blocks, each one with its own address. Common block sizes: range from 512 bytes to 32,768 bytes. it is possible to ‘read or write data blocks independently of all the other ones. Disks are the most common block devices

I/O Hardware character devices delivers or accepts a stream of characters, no block structure is available. It is not addressable does not have any seek operation. Examples: printers, network interfaces, mouse, …

Some device, network, and data base rates Speed Some device, network, and data base rates

Device Controllers I/O devices have components: device controller mechanical component electronic component device controller the electronic component can handle multiple devices Controller's tasks convert serial bit stream to block of bytes perform error correction make data available to transfer it to main memory

Memory-Mapped I/O Devices addressed independent of the memory Devices are addressed in common address space A hybrid approach

Bus Architecture (a) A single-bus architecture (b) A dual-bus memory architecture

Direct Memory Access CPU must be able DMA (Direct Memory Access) to address the device controllers to exchange data with them DMA (Direct Memory Access) memory address register The memory address to be used in DMA operation a byte count register The amount of bytes to transfer one or more control registers to identify the I/O port to use the direction of the transfer unit: bytes or words the number of bytes to transfer in one burst

DMA Transfer Operations of DMA Transfer

Interrupts When an I/O device finishes its job interrupts can be it causes an interrupt by asserting a signal on a hits line This signal is detected by the interrupt controller a chip on the main board interrupts can be enabled or disabled by the operating system If no other interrupts are pending process the interrupt immediately. If another one is in progress the device is just ignored for the moment it continues to assert until it is serviced by the CPU Pending: Askıda

How an Interrupt Happens Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires

Handling Interrupts To handle the interrupt, the controller puts a number on the address lines for the address of the device The interrupt signal causes the CPU to stop what it is doing and start doing something else. The number on the address lines is used as an index into a table called the interrupt vector to fetch a new program counter. program counter points to the interrupt service procedure.

I/O Software Device independence Uniform naming Error handling programs can access any I/O devices without specifying device in advance floppy, hard drive, CD-ROM ... Uniform naming device name must be machine-independent Error handling handle erorrs as close to the hardware

I/O Software Synchronous vs. asynchronous transfers Buffering blocked transfers interrupt-driven transfers Buffering data coming from a device cannot be stored in final destination Sharable vs. dedicated devices disks are sharable tape drives can not be shared

I/O Types Programmed I/O Interrupt-driven I/O I/O using DMA

Programmed I/O user process to print string “ABCDEFGH” on the printer: assemble the string in a buffer in user space acquire the printer for writing by making a system call to open it If the printer is currently in use fail and return an error code or will block until the printer is available make the system call to print the string on the printer

Programmed I/O Operating System copies the buffer checks to see to an array in kernel space checks to see if the printer is available If not, it waits until it is available copies the first character to the printer’s data register if the printer is ready to accept another one when ready, it prints the next character

Steps in Printing a String

Interrupt-Driven I/O to allow the CPU In case of system call do something else while waiting for device In case of system call to print the string is made, the buffer is copied to kernel space, as soon as the printer becomes ready the first character is copied to the printer cuncerrently., CPU calls the scheduler to run some other processes The process printing the string is blocked until the entire string has printed.

Example: Writing a string to the printer using interrupt-driven I/O Code executed when print system call is made Interrupt service procedure

I/O Using DMA Interrupts take time A solution is to use DMA wastes CPU time A solution is to use DMA let the DMA controller feed the characters to the printer one at time without bothering the CPU DMA is programmed I/O the DMA controller is doing all the work instead of the main CPU

Disadvantages DMA controller is If then much slower than the main CPU. the DMA controller is not capable of driving the device at full speed or the CPU usually has nothing to do while waiting for the DMA interrupt then interrupt-driven I/O or even programmed I/O may be better

Input/Output Management End of Chapter 5 Input/Output Management