Device Mgmt © 2004, D. J. Foreman.

Slides:



Advertisements
Similar presentations
Chapter 6 I/O Systems.
Advertisements

I/O Management and Disk Scheduling
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Input/Output Management and Disk Scheduling
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
© 2009, D. J. Foreman 1 Computer Organization. © 2009, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Disk and I/O Management
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Device Management. Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
OSes: 11. FS Impl. 1 Operating Systems v Objectives –discuss file storage and access on secondary storage (a hard disk) Certificate Program in Software.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
© 2005 Pearson Addison-Wesley. All rights reserved Figure 2.1 This chapter focuses on key hardware layer components.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
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.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
Device Management Mark Stanovich Operating Systems COP 4610.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
File organization Secondary Storage Devices Lec#7 Presenter: Dr Emad Nabil.
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
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Sarah Diesburg Operating Systems CS 3430
Multiple Platters.
Input/Output Devices ENCE 360
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 12: Mass-Storage Structure
CS703 - Advanced Operating Systems
I/O Resource Management: Software
Operating System I/O System Monday, August 11, 2008.
Mass-Storage Structure
Lecture 45 Syed Mansoor Sarwar
Computer Architecture
Chapter 14 Based on the slides supporting the text
Chapter 12: Mass-Storage Systems
Operating Systems (CS 340 D)
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
CPSC 457 Operating Systems
Operating Systems Chapter 5: Input/Output Management
Operating System Concepts
Selecting a Disk-Scheduling Algorithm
Overview Continuation from Monday (File system implementation)
Secondary Storage Management Brian Bershad
Persistence: hard disk drive
Computer Organization
CSE 451: Operating Systems Spring 2007 Module 15 I/O
File Storage and Indexing
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Outline Device Management Device Manager Design Buffering
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
Device Mgmt © 2004, D. J. Foreman.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Process and Thread State Diagrams
Process and Thread State Diagrams
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Device Mgmt © 2004, D. J. Foreman

Device Management Organization Multiple layers Application Operating System Driver Controller Device Tradeoffs of layering Loss of efficiency Increased generalization and flexibility Reduced cost of maintenance and development for all (driver writers, O/S writers, app writers and users) © 2004, D. J. Foreman

Device Management Organization-2 read, write read, write read, write Applications API Device independent O/S Device Driver Device Driver Device Driver Device dependent Controller Firmware Devices © 2004, D. J. Foreman

The API Simple set of abstract operations Direct vs Sequential read, write, seek, control Direct vs Sequential Disks vs tapes, printers, etc Block vs Character Disk vs keyboard Blocking vs Non-blocking © 2004, D. J. Foreman

Handling I/O Polling Interrupt driven Program loops until device signals completion No other program can run CPU runs, but no work gets done! Interrupt driven Program starts I/O Program decides to wait or not O/S switches to another thread or process © 2004, D. J. Foreman

Key concepts CPU cycles are wasted during a wait Devices are independent Multitasking (or threading) is possible Why not overlap I/O with CPU Threads can decide when to wait Non-thread programs can also decide System throughput is increased © 2004, D. J. Foreman

Driver/Kernel Interface Drivers merged with kernel Kernel makes function calls to drivers Kernel functions used by drivers: Device allocation Resource (e.g., memory) allocation Scheduling Others: depends on O/S © 2004, D. J. Foreman

System bottlenecks Compute bound processes I/O bound processes no devices get started until time-slice used up Only one process/thread gets service I/O bound processes CPU under-utilized Solution: "Good" mix of applications Pre-emptive scheduling (more later) © 2004, D. J. Foreman

Overlapped I/O Apps t1 t2 t3 t4 t5 t6 t7 t8 t9 P1 th1 th1 th1 th1 th1 Device t1 t2 t3 t4 t5 t6 t7 t8 t9 Non-Blocking I/O Blocking I/O © 2004, D. J. Foreman

Buffering Provides a means for speed-matching Many methods Problems Lists 1 way, 2 way, circular Arrays Fixed size Variable size Circular Problems Overflow Protected access Synchronization – more in another chapter © 2004, D. J. Foreman

Example of using buffers Customer Office Water Company Returning the Empties Water Producer Water Consumers Production qty? Delivering Water Consumption qty? Inventory Classic "Producer-Consumer" © 2004, D. J. Foreman

Hardware Buffering In the Device controller In the Device itself = "double-buffering" Reduces system overhead from: Buffer mgmt Buffer content Synchronizing © 2004, D. J. Foreman

Disk I/O Goal – minimize access time = (X + Y*K) + latency + transfer Mixed solution: h/w & s/w = (X + Y*K) + latency + transfer Seek time: head movement delay for 1 cylinder (X) ≈ 10 ms (device dependent) For Y cylinders = Y * K (K is device dependent) Latency: rotational delay 5400R/M*1M/60s= 90R/s  .01 s/R = 10ms/R 7200 R/M*1M/60s=120R/s  .008 s/R= 8ms/R Transfer time: delay between disk and RAM Bus speed (currently) 400 Mhz or 800 Mhz Access Time = seek + latency + transfer © 2004, D. J. Foreman

Access Algorithms FCFS SSTF – min seek from current position Scan/Look No optimization SSTF – min seek from current position Starvation can occur (from local minimization) Scan/Look No starvation Requests may wait a full scan (0-n-0) Circular Scan/Look Requires fast-reposition to 0 © 2004, D. J. Foreman

Serial I/O Must convert And back again at the other end Parallel (bytes) to serial (bit-by-bit) Digital (1/0) to analog (+/- voltages) And back again at the other end Protocol: RS-232 © 2004, D. J. Foreman

MS-bootable disk layout 0x00-0x02 jump inst to 0x1e 0x03-0x0a PC manufacturer name 0x0b-0x0c sectors/cluster 0x0d-0x0f reserved for boot record 0x10-0x10 # of FAT's 0x11-0x12 # root directory entries 0x13-0x14 # logical sectors 0x15-0x15 media descriptor 0x16-0x17 sectors/FAT 0x18-0x19 sectors/track 0x1a-0x10b # surfaces (heads) 0x1c-0x1d # hidden sectors 0x1e-… boot program © 2004, D. J. Foreman

Mainframe Device Mgmt CPU Channel Controller Hardware Devices © 2004, D. J. Foreman

Channel programming SIO devaddr Channel Program Seek Search Read/write Channel Address Word Device © 2004, D. J. Foreman