Lecture 7b I/O. I/O devices  Device (mechanical hardware)  Device controller (electrical hardware)  Device driver (software)

Slides:



Advertisements
Similar presentations
Chapter 6 I/O Systems.
Advertisements

Chapter 5 Input/Output 5.1 Principles of I/O hardware
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.
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
Operating System - Overview Lecture 2. OPERATING SYSTEM STRUCTURES Main componants of an O/S Process Management Main Memory Management File Management.
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)
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
04/16/2010CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying an earlier edition.
Oregon Health and Science University
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Device Management.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 1: Introduction
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.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
Operating Systems Input/Output Devices (Ch 5: )
Chapter 2: Computer-System Structures
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
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 1. Introduction What is an Operating System? Mainframe Systems
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
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)
CS399 New Beginnings Jonathan Walpole. Device 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.
CS 333 Introduction to Operating Systems Class 15 - Input/Output Jonathan Walpole Computer Science Portland State University.
Advanced Programming for 3D Applications CE Bob Hobbs Staffordshire university Data Capture, Streams and Devices Lecture 11.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
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.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: Phone:
Lecture 35: Chapter 6 Today’s topic –I/O Overview 1.
Chapter 13: I/O Systems. 13.2/34 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware.
Input/Output Computer component : Input/Output I/O Modules External Devices I/O Modules Function and Structure I/O Operation Techniques I/O Channels and.
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
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.
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.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 I/O through system calls Protection.
Device Management Mark Stanovich Operating Systems COP 4610.
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.
I/O Management.
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Multiple Platters.
CS703 - Advanced Operating Systems
CSCI 315 Operating Systems Design
© CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA
Operating Systems Chapter 5: Input/Output Management
CS703 - Advanced Operating Systems
Chapter 5: I/O Systems.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems.
Presentation transcript:

Lecture 7b I/O

I/O devices  Device (mechanical hardware)  Device controller (electrical hardware)  Device driver (software)

Devices and their controllers  Components of a simple personal computer Monitor Bus

How to communicate with a device?  Hardware supports I/O ports or memory mapped I/O for accessing device controller registers and buffers

Wide performance range for I/O

Performance challenges: I/O hardware  How to prevent slow devices from slowing down memory  How to identify I/O addresses without interfering with memory performance

Hardware view of Pentium Structure of a large Pentium system

Performance challenges: I/O software  How to prevent CPU throughput from being limited by I/O device speed  How to prevent I/O throughput from being limited by CPU speed  How to achieve good utilization of CPU and I/O devices  How to meet the real-time requirements of devices

Programmed I/O  Polling/busy-waiting approach copy_from_user(buffer,p,count); for(i=0;i<count;i++){ while (*p_stat_reg != READY); *p_data_reg = p[i]; } return();

Interrupt driven I/O (b)

Interrupt-driven I/O  Asynchronous approach  give device data, do something else!  resume when device interrupts copy_from_user(buffer,p,count); enable_interrupts(); while (*p_stat_reg != READY); *p_data_reg=p[0]; scheduler(); if (count==0){ unblock_user(); } else { *p_data_reg = p[i]; count--; i++; } ack_interrupt(); return_from_interrupt();

DMA  Offload all work to a DMA controller  avoids using the CPU to do the transfer  reduces number of interrupts  DMA controller is like a co-processor doing programmed I/O copy_from_user(buffer,p,count); set_up_DMA_controller(); scheduler(); ack_interrupt(); unblock_user(); return_from_interrupt();

DMA

Software engineering-related challenges  How to remove the complexities of I/O handling from application programs  standard I/O APIs (libraries and system calls)  generic across different device types  How to support a wide range of device types on a wide range of operating systems  standard interfaces for device drivers  standard/published interfaces for access to kernel facilities

I/O Software: Device Drivers  Device drivers “connect” devices with the operating system  Typically a nasty assembly-level job Must deal with hardware changes Must deal with O.S. changes  Device drivers are typically given kernel privileges  Can bring down O.S.!

I/O Software design issues  Synchronous vs. asynchronous transfers  Blocked transfers vs. interrupt-driven  Buffering  Data coming off a device cannot be stored in final destination  Sharable vs. dedicated devices  Disks are sharable  Tape drives would not be

I/O software design issues  Device independence  programs can access any I/O device without specifying device in advance (floppy, hard drive, or CD-ROM)  Uniform naming  Name of a file or device a string or an integer not depending on which machine  Shouldn’t depend upon the device  Error handling  Handle as close to the hardware as possible

Devices as files  Before mounting,  files on floppy are inaccessible  After mounting floppy on b,  files on floppy are part of file hierarchy

Spare Slides

Disks

Disk geometry  Disk head, platters, surfaces

Disk geometry  CAV & CLV

RAID

CD-ROMs

Plastic technology  CDs  Approximately 650 Mbytes of data  Approximately 74 minutes of audio  DVDs  Many types of formats DVD-R, DVD-ROM, DVD-Video  Single layer vs. multi-layer  Single sided vs. double sided  Authoring vs. non-authoring

Disk scheduling algorithms  Time required to read or write a disk block determined by 3 factors  Seek time  Rotational delay  Actual transfer time  Seek time dominates  Error checking is done by controllers

Disk scheduling algorithms  First-come first serve  Shortest seek time first  Scan  back and forth to ends of disk  C-Scan  only one direction  Look  back and forth to last request  C-Look  only one direction

Disk scheduling algorithms

Display hardware  PCI graphics card (traditional)  Map frame buffer into memory

Display hardware  Intel-based systems

Display hardware  Resolution  Determines the amount of pixels displayable and the # of colors that can be used 1024*768*24-bit color  ~2 MBytes 1600*1200*24-bit color  ~6 Mbytes 1600*1200*(16 colors)  ~1 Mbytes  Usually double-buffered  Data rate  Determines refresh rate  Monitor must be greater than what the video card is trying to display

X-terminals

 Long past  X-terminals were great because of limited pixel depth  Good way to share expensive resources  Future  Great way to limit maintenance costs  Great for basic applications  X-terminals are getting killed by multimedia applications DVD  740*480*24-bit color  255 Mbps!!

Summary  Mismash of I/O topics  Readings:  5.1 – 5.1.4, 5.2, 5.4 – 5.4.3,  Homework #4 – Due Wed. Dec. 1  Chapter 4: Problem # 23, 29  Chapter 5: Problem # 24