IO Management
IO Management
File Systems
Security
Networking
Input & Output
A computer’s job is to process data
Computation (CPU, cache, and memory)
Move data into and out of a system (between I/O devices and
memory)
Challenges with I/O devices
Categories: storage, networking, interface
Massive number of device drivers to support
Goals of the OS
Provide a generic, consistent, convenient and reliable way to
access I/O devices
Achieve acceptable I/O performance in a system
Elements of the I/O Subsystem
Device: the thing that stores data or transfers data in and
out of the system
4
Elements of the I/O Subsystem
I/O Hardware Components:
Devices
Types of I/O Devices
Communication
Transfer
data in and out of the system
Communicate with humans or other machines
Examples:
keyboard, display, network interfaces
Storage
Maintain
persistent data
Examples:
disks, tapes, CD-ROMs
7
Types of I/O Devices (cont.)
Block
Reads, writes and transfers data in multi-byte
blocks
Usually randomly accessible
Stream (character)
Datatransfer one byte at a time
Sequentially accessible.
8
An Example of Block Storage I/O device
The disk Drive
Block Devices: Disk Drives
Head: for reading and
writing data
Arm: assembly of heads
(one per surface)
Track: circle under a
single head
Cylinder: group of tracks
for a fixed arm position
Sector: division of a track;
smallest unit of reading
and writing
10
Block Devices:
Disk Drives
11
Disk Access Time
Seek time ts: time to move the arm to the
desired cylinder
12
Example
Disk drive
Rotates at 10,000 RPM
ts = 10 ms
Time for full rotation = 6 ms
tr = 3 ms
ta = 13 ms (average access time)
15
Controller Interface Programming
Access:
Special I/O instructions
each control register is assigned an I/O port
number
Memory-Mapped
Memory-Mapped I/O
Addresses
20
No interleaving Single interleaving Double interleaving
I/O Software Components:
Device Drivers
Device Drivers
Provides an
interface between a device controller and
the rest of system software.
Accepts requests from user processes &
other kernel software:
translates
them into parameters and
commands to drive the controller.
Handles interrupts from device controller
A Typical Device Driver
Operations
Initialize devices
Interpreting commands from OS
Schedule multiple outstanding requests
Manage data transfers
Accept and process interrupts
Data Transfer
Polling: CPU periodically checks the controller
(Status bits) to see if additional data needs to be
transferred
Polling not acceptable except for v. small dedicated
systems not running multiple processes
24