Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Device Management
Process management,
Memory management, and
file management
Computing is not interesting without I/Os
Device management: the OS component that
manages hardware devices
Provides a uniform interface to access devices
with different physical characteristics
Optimize the performance of individual devices
Sateesh IITR EC-353 2011 2
Device Management Device Management
Hardware Organization
Device Scheduling Policies
Device Drivers
Output Device
Accommodate disparity of
speeds between CPU and I/O
Handled by buffering devices.
records & queueing
requests
Sateesh IITR EC-353 2011 4
Hardware Organization
Categories of I/O Devices
Human readable
Device Management
Primary Primary
memory memory Memory
addresses
Device Device 1
addresses Device 2
Separate device Sateesh IITR EC-353 2011 Memory-mapped I/Os 10
addresses
Hardware Organization
Techniques for Performing I/O
Programmed I/O (Polling)
Device Management
Zone-bit recording: zones near the edge of a disk store more information
(higher bandwidth)
Track skew: starting position of each track is slightly skewed
Minimize rotational delay when sequentially transferring bytes across
tracks
Thermo-calibrations: periodically performed to account for changes of disk
radius due to temperature changes
Typically 100 to 1,000 bits are inserted between sectors to account for minor
inaccuracies Disk heads
Disk
platters
Sector
Disk arm
Cylinder
Track
Sateesh IITR EC-353 2011 13
Zones
Device Driver
Disk Controller
Few popular standards (Exercise : Read in More detail)
Device Management
Performance
Parallelism
position
+ Good at reducing seeks
- May result in starvation
Request queue: 3, 6, 1, 0, 7
Head start position: 2
Total seek distance: 1 + 2 + 1 + 6 + 1 = 10
7
6
5
4
Tracks
3
2
1
Sateesh IITR EC-353 2011 Time 17
0
Disk Arm Scheduling Policies
SCAN
takes the closest request in the direction of travel (an example
Device Management
of elevator algorithm)
+ no starvation
- a new request can wait for almost two full scans of the disk
Request queue: 3, 6, 1, 0, 7
Head start position: 2
Total seek distance: 1 + 1 + 3 + 3 + 1 = 9
7
6
5
4
Tracks
3
2
1
Sateesh IITR EC-353 2011 Time 18
0
Disk Arm Scheduling Policies
Circular SCAN (C-SCAN)
disk arm always serves requests by scanning in one direction.
Device Management
Interface
Interface
Hence, Protected
Interface:
Functions available to application
programs
Abstract all devices (and files) to a few
interfaces
Make interfaces as similar as possible
Block vs character
Sequential vs direct access
Device driver implements functions
(one entry point per API function)
Flow of an
Buffer?
I/O Request
Device Management
Performance improvements
Reduce context switches
Minimize data copying
Minimize interrupts by using
large transfers, smart
controllers, DMA
Balance CPU, memory, bus,
and I/O contention for highest
throughput
THANK YOU