Input/Output Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

Chapter 5 Input/Output 5.1 Principles of I/O hardware
Disks Disk Hardware (1) Disk parameters for the original IBM PC floppy disk and a Western Digital WD hard disk.
Chapter 5 Input/Output 5.4 Disks
Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components.
Mehdi Naghavi Spring 1386 Operating Systems Mehdi Naghavi Spring 1386.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Categories of I/O Devices
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
Chapter 5 Input/Output Clocks User Interfaces: Keyboard, Mouse Power.
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
1 Pertemuan 18 Input / Output (lanjutan) Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
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)
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Input/Output The messiest part of O.S.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Pertemuan 20 Character oriented terminal
Device Management.
Avishai Wool lecture Introduction to Systems Programming Lecture 9 Input-Output Devices.
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.
Chapter 5 Input/Output I/O Hardware I/O Software Software Layers Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights.
Operating Systems Input/Output Devices (Ch 5: )
Copyright ©: Nahrstedt, Angrave, Abdelzaher
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
IO and RAID.
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 & ,
Cpr E 308 Input/Output Recall: OS must abstract out all the details of specific I/O devices Today –Block and Character Devices –Hardware Issues – Programmed.
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)
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
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.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
CS450/550 I/O.1 Adapted from MOS2E UC. Colorado Springs CS450/550 Operating Systems Lecture 5 I/O Palden Lama Department of Computer Science.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 9-2: Disk Scheduling Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
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
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.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 9-1: Disk Scheduling Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
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 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Input/Output Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Introduction to Operating Systems Concepts
I/O Management.
Clocks, I/O devices, Thin Clients, and Power Management
Interrupts and signals
Multiple Platters.
CS703 - Advanced Operating Systems
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Chapter 14 Based on the slides supporting the text
CSE306 Operating Systems Lecture #6 Input / Output
Operating Systems Chapter 5: Input/Output Management
CS703 - Advanced Operating Systems
Chapter 5: I/O Systems.
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Presentation transcript:

Input/Output Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

I/O Devices (1) Block devices – Stores information in fixed-size blocks – Transfers are in units of entire blocks Character devices – Delivers or accepts stream of characters, without regard to block structure – Not addressable, does not have any seek operation Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

I/O Devices (2) Figure 5-1. Some typical device, network, and bus data rates. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Memory-Mapped I/O (1) Figure 5-2. (a) Separate I/O and memory space. (b) Memory-mapped I/O. (c) Hybrid. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Memory-Mapped I/O (2) Figure 5-3. (a) A single-bus architecture. (b) A dual-bus memory architecture. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Direct Memory Access Figure 5-4. Operation of a DMA transfer. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Interrupts Revisited Figure 5-5. How an interrupt happens. The connections between the devices and the interrupt controller actually use interrupt lines on the bus rather than dedicated wires. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Precise Interrupt Four properties of a precise interrupt: 1.The PC saved in a known place. 2.All instructions before that pointed to by PC have fully executed. 3.No instruction beyond that pointed to by PC has been executed. 4.Execution state of instruction pointed to by PC is known. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Precise vs. Imprecise Figure 5-6. (a) A precise interrupt. (b) An imprecise interrupt. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Goals of the I/O Software Issues: Device independence Uniform naming Error handling Synchronous versus asynchronous Buffering. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Programmed I/O (1) Figure 5-7. Steps in printing a string. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Programmed I/O (2) Figure 5-8. Writing a string to the printer using programmed I/O. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Interrupt-Driven I/O Figure 5-9. Writing a string to the printer using interrupt- driven I/O. (a) Code executed at the time the print system call is made. (b) Interrupt service procedure for the printer. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

I/O Using DMA Figure Printing a string using DMA. (a) Code executed when the print system call is made. (b) Interrupt service procedure. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

I/O Software Layers Figure Layers of the I/O software system. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Interrupt Handlers (1) Typical steps after hardware interrupt completes: 1.Save registers (including the PSW) not already saved by interrupt hardware. 2.Set up context for interrupt service procedure. 3.Set up a stack for the interrupt service procedure. 4.Acknowledge interrupt controller. If no centralized interrupt controller, reenable interrupts. 5.Copy registers from where saved to process table. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Interrupt Handlers (2) Typical steps after hardware interrupt completes: 6.Run interrupt service procedure. Extract information from interrupting device controller’s registers. 7.Choose which process to run next. 8.Set up the MMU context for process to run next. 9.Load new process’ registers, including its PSW. 10.Start running the new process. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Device Drivers Figure Logical positioning of device drivers. In reality all communication between drivers and device controllers goes over the bus. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Device-Independent I/O Software Figure Functions of the device-independent I/O software. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Uniform Interfacing for Device Drivers Figure (a) Without a standard driver interface. (b) With a standard driver interface. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Buffering (1) Figure (a) Unbuffered input. (b) Buffering in user space. (c) Buffering in the kernel followed by copying to user space. (d) Double buffering in the kernel. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Buffering (2) Figure Networking may involve many copies of a packet. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

User-Space I/O Software Figure Layers of the I/O system and the main functions of each layer. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Magnetic Disks (1) Figure Disk parameters for the original IBM PC 360-KB floppy disk and a Western Digital WD 3000 HLFS (‘‘Velociraptor’’) hard disk. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Magnetic Disks (2) Figure (a) Physical geometry of a disk with two zones. (b) A possible virtual geometry for this disk. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

RAID (1) Figure RAID levels 0 through 3. Backup and parity drives are shown shaded. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

RAID (2) Figure RAID levels 4 through 6. Backup and parity drives are shown shaded. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disk Formatting (1) Figure A disk sector. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disk Formatting (2) Figure An illustration of cylinder skew. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disk Formatting (3) Figure (a) No interleaving. (b) Single interleaving. (c) Double interleaving. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disk Arm Scheduling Algorithms (1) Factors of a disk block read/write: 1.Seek time (the time to move the arm to the proper cylinder). 2.Rotational delay (how long for the proper sector to come under the head). 3.Actual data transfer time. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disk Arm Scheduling Algorithms (2) Figure Shortest Seek First (SSF) disk scheduling algorithm. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disk Arm Scheduling Algorithms (3) Figure The elevator algorithm for scheduling disk requests. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Error Handling Figure (a) A disk track with a bad sector. (b) Substituting a spare for the bad sector. (c) Shifting all the sectors to bypass the bad one. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Stable Storage (1) Uses pair of identical disks Either can be read to get same results Operations defined to accomplish this: 1.Stable Writes 2.Stable Reads 3.Crash recovery Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Stable Storage (2) Figure Analysis of the influence of crashes on stable writes. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Clock Hardware Figure A programmable clock. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Clock Software (1) Typical duties of a clock driver: 1.Maintaining the time of day. 2.Preventing processes from running longer than allowed. 3.Accounting for CPU usage. 4.Handling alarm system call from user processes. 5.Providing watchdog timers for parts of system itself. 6.Profiling, monitoring, statistics gathering. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Clock Software (2) Figure Three ways to maintain the time of day. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Clock Software (3) Figure Simulating multiple timers with a single clock. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Soft Timers Soft timers stand or fall with the rate at which kernel entries are made for other reasons. These reasons include: 1.System calls. 2.TLB misses. 3.Page faults. 4.I/O interrupts. 5.The CPU going idle. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Keyboard Software Figure Characters that are handled specially in canonical mode. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Output Software – Text Windows Figure The ANSI escape sequences accepted by the terminal driver on output. ESC denotes the ASCII escape character (0x1B), and n, m, and s are optional numeric parameters. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

The X Window System (1) Figure Clients and servers in the M.I.T. X Window System. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

The X Window System (2) Types of messages between client and server: 1.Drawing commands from program to workstation. 2.Replies by workstation to program queries. 3.Keyboard, mouse, and other event announcements. 4.Error messages. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

The X Window System (3) Figure A skeleton of an X Window application program. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

The X Window System (4) Figure A skeleton of an X Window application program. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Graphical User Interfaces (1) Figure A sample window located at (200, 100) on an XGA display. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Graphical User Interfaces (2) Figure A skeleton of a Windows main program. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Graphical User Interfaces (3) Figure A skeleton of a Windows main program. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Graphical User Interfaces (4) Figure An example rectangle drawn using Rectangle. Each box represents one pixel. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Bitmaps Figure Copying bitmaps using BitBlt. (a) Before. (b) After. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Fonts Figure Some examples of character outlines at different point sizes. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Hardware Issues Figure Power consumption of various parts of a notebook computer. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Operating System Issues The Display Figure The use of zones for backlighting the display. (a) When window 2 is selected it is not moved. (b) When window 1 is selected, it moves to reduce the number of zones illuminated. Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Operating System Issues The CPU Figure (a) Running at full clock speed. (b) Cutting voltage by two cuts clock speed by two and power consumption by four Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

End Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.