0% found this document useful (0 votes)
24 views

Lecturer 4 Device Management

This document discusses device management functions in operating systems. It covers characteristics of parallel and serial devices, types of devices including dedicated, shared, and virtual devices. It also discusses sequential access storage media like magnetic tapes and direct access storage devices including magnetic disks, optical discs, and flash memory. Seek strategies for device handlers like first come first served, shortest seek time first, and SCAN are also covered.

Uploaded by

Girma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lecturer 4 Device Management

This document discusses device management functions in operating systems. It covers characteristics of parallel and serial devices, types of devices including dedicated, shared, and virtual devices. It also discusses sequential access storage media like magnetic tapes and direct access storage devices including magnetic disks, optical discs, and flash memory. Seek strategies for device handlers like first come first served, shortest seek time first, and SCAN are also covered.

Uploaded by

Girma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Operating System

Chapter 4: Device Management

CS Program BY: GIRMA A.


Outline
4.1. Characteristics of parallel and serial devices
4.2. Buffering strategies
4.3. Direct memory access
4.4. recovery from failure
Introduction
 A process may need several resources to execute task such as main memory,
disk drives, access to files, and so on.
 If the resources are available, they can be granted, and control can be
returned to the user process.
 Otherwise, the process will have to wait until sufficient resources are
available.
 The various resources controlled by the operating system can be thought

of as devices.
 Some of these devices are physical devices (for example, disk drives), while
others can be thought of as abstract or virtual devices (for example, files).
Device management Function
 Keep tracks of all the devices and the programs
 Monitoring the status of each device

 Take the decision that which process gets the device when and

for how long.


 Efficiently allocates and deallocates the devices

 Optimize the performance of individual devices


Types of Devices
✓ Peripheral devices are categorized as follows:
✓ Characteristics of the devices

✓ How they're managed by the Device Manager

✓ Different categories:
✓ Dedicated, shared, and virtual

✓ Most important differences among devices


✓ Speed

✓ Degree of shareability
Characteristics of parallel and serial devices
 Parallel Devices: Transfer data multiple bits at a time, resulting in
faster speed. 20
 Examples: printers, some older CPUs.
 Advantages: faster transmission, simpler hardware.
 Disadvantages: expensive cabling, limited transmission distance,
susceptibility to interference.
 Serial Devices: Transfer data one bit at a time, often slower but more
economical.
 Examples: keyboards, mice, most modern CPUs.
 Advantages: cheaper cabling, longer transmission distance, less susceptible
to interference.
 Disadvantages: slower transmission, requires more complex hardware.
Cont…
Dedicated Devices
 Assigned to only one job at a time and serves that job for entire time it's
active
 e.g., tape drives, printers, and plotters

 Disadvantage:
 Mustbe allocated to a single user for duration of a job's execution
 Can be quite inefficient, especially when device isn’t used 100% of the time
Cont…
Shared Devices
 Assigned to several processes
 e.g., disk pack or other DASDs can be shared by several processes at same
time by interleaving their requests
 Interleaving must be carefully controlled by Device Manager

 All conflicts must be resolved based on pre-determined policies


Cont..
Virtual Devices
 Dedicated devices that have been transformed into shared devices

 e.g.,
printers (dedicated devices) converted into sharable devices through a
spooling program
 Spooling is used to speed up slow dedicated I/O devices
 e.g.,USB controller, a virtual device that acts as an interface between OS,
device drivers, and applications and the devices that are attached via the
USB host
Sequential Access Storage Media

 Storage media are divided into two groups:


 Sequential access media
◼ Store records sequentially
 Direct access storage devices (DASD)
◼ Store either sequential or direct access files
◼ There are vast differences in their speed and shareability
Cont…

 Paper: First storage medium: printouts, punch cards


 Magnetic tape: Used for secondary storage on early computer systems;
now used for routine archiving & storing back-up data.
 Records on magnetic tapes are stored serially
 Record length determined by the application program
 Each record identified by its position on the tape
 Tape is mounted and fast-forwarded to access a single record
◼ Time-consuming process
Cont…
Cont…
 Data is recorded on 8 parallel tracks that run the length of tape
 Ninth track holds parity bit for routine error checking
 Density of tape determines number of characters that can be
recorded per inch.
 Records can be stored individually or in blocks
 Blocking provides efficient way of storing records
Cont…
 Interrecord gap (IRG) : Gap between records about 1/2 inch long
regardless of the sizes of the records it separates
 Interblock gap (IBG) : Gap between blocks of records; still 1/2 inch
long
 Transfer rate = Tape density x tape transport speed
Cont…
Cont…
 Advantages of blocking:
 Fewer I/O operations needed
 Less tape is wasted

 Disadvantages of blocking:
 Overhead and software routines are needed for blocking, deblocking, and
record keeping
 Buffer space wasted if only one logical record is needed
Cont…
 Advantages of magnetic tapes:
 Lowcost
 Compact storage capabilities
◼ Good medium for backing up magnetic disks and for long-term archival file storage
 Disadvantages of magnetic tapes:
 Accesstime variability
 Poor medium for routine secondary storage
◼ Not good for interactive applications
Direct Access Storage Devices
 DASDs, any devices that can directly read or write to a specific place
on a disk
 Categories:
◼ Magnetic disks
◼ Fixed-Head Magnetic Disk Storage
◼ Movable-Head Magnetic Disk Storage
◼ Optical discs
◼ Flash memory
◼ Magneto-optical disks

 Location of a record directly affects access time


Fixed-Head Magnetic Disk Storage
 Looks like a large CD or DVD covered with magnetic film.
 Formatted, usually on both sides, into concentric circles called
tracks.
 Data is recorded serially on each track by the fixed read/write

head positioned over it.


 Applications: Spacecraft monitoring or aircraft applications

(where speed is of utmost importance)


 Disadvantages: High cost and reduced storage
Cont….
Movable-Head Magnetic Disk Storage
 Have one read/write head that floats over the surface of each disk,
e.g., PC hard drives
 Can be a single platter
 Can be a part of a disk pack (stack of platters)

 Disk Pack:
 Each platter has two surfaces for recording (except those at the top and
bottom of the stack)
 Each surface is formatted with concentric tracks
 Number of tracks ranges from 100 on a floppy disk to a thousand or more
on a high-capacity hard disk
Cont…
Optical Disc Storage
 Optical disc vs. Magnetic disk:
 Magnetic disk
◼ Consists of concentric tracks of sectors
◼ Spins at a constant angular velocity (CAV)
◼ Wastes storage space but data retrieval is fast
 Optical disc
◼ Consists of a single spiraling track of same-sized sectors running
from center to rim of disc
◼ Spins at a constant linear velocity (CLV)
◼ Allows more sectors and more data to fit on a disc
Cont…

Magnetic disk
Optical Disc
Flash Memory Storage
 Flash memory is a removable medium that emulates RAM, but
stores data securely even when removed from power source
 Allows users to store data on a microchip card or "key" and
move it from device to device.
 Configurations include compact flash, smart cards, and memory
sticks; often connected to the computer through the USB port
 To write data to the chip, an electric charge is sent through
floating gate; to erase, a strong electrical field (flash) is
applied
DASD Access Times
 Time required to access a file depends on:
 Seek time: Time to position read/write head
◼ Slowest of the three factors
◼ Doesn't apply to devices with fixed read/write heads

 Search time (rotational delay): Time to rotate DASD until desired record is
under read/write head
 Transfer time: Time to transfer data from secondary storage to main memory
◼ Fastest
Communication Among Devices

 For efficient system, Device Manager must:


 Know which components are busy/free.
◼ Solved by structuring the interaction between units
 Accommodate requests during heavy I/O traffic
◼ Handled by buffering records and queuing requests
 Accommodate speed disparity between CPU and I/O devices
◼ Handled by buffering records and queuing requests
Management of I/O Requests
 Device Manager divides task into three parts, each
handled by specific software component of I/O
subsystem:
 I/O traffic controller watches status of all devices, control
units, and channels
 I/O scheduler implements policies that determine allocation
of, and access to, devices, control units, and channels
 I/O device handler performs actual transfer of data and
processes the device interrupts
Device Handler Seek Strategies
 Predetermined policy used by device handler to determine
order in which processes get the device.
 Goal is to keep seek time to a minimum
 Types of seek strategies:
 First come, first served (FCFS), shortest seek time first (SSTF), SCAN
(including LOOK, N-Step SCAN, C-SCAN, & C-LOOK)
 Every scheduling algorithm should:
 Minimize arm movement
 Minimize mean response time
 Minimize variance in response time
Cont…
 FCFS: On average, it doesn't meet any of the three goals of a seek
strategy.
 Disadvantage: Extreme arm movement
 Shortest Seek Time First (SSTF):
 Request with track closest to one being served is satisfied next
 Minimizes overall seek time

 Postpones traveling to those that are out of way


cont…

 SCAN:
 Uses a directional bit to indicate whether the arm is moving
toward center of the disk or away from it.
 Algorithm moves arm methodically from outer to inner track
servicing every request in its path.
 When it reaches innermost track it reverses direction and
moves toward outer tracks, again servicing every request in its
path.
 LOOK:
 Arm doesn't necessarily go all the way to either edge unless there are
requests
 Eliminates possibility of indefinite postponement
Cont…
 N-Step SCAN: Holds all requests until arm starts on way back
 New requests are grouped together for next sweep
 C-SCAN (Circular SCAN) : Arm picks up requests on its path
during inward sweep
 Provides a more uniform wait time
 C-LOOK: Inward sweep stops at last high- numbered track
request
 Arm doesn't move to last track unless required to
Which strategy is the best?
 FCFS works well with light loads, but service time becomes
unacceptably long under high loads
 SSTF works well with moderate loads but has problem of localization
under heavy loads
 SCAN works well with light to moderate loads and eliminates problem
of indefinite postponement. Similar to SSTF in throughput and mean
service times
 C-SCAN works well with moderate to heavy loads and has a very
small variance in service times
Search Strategies: Rotational Ordering

 Rotational ordering : Optimizes search times by ordering


requests once read/write heads have been positioned
 Time
spent on moving read/write head is hardware
dependent
 Amount of time wasted due to rotational delay can be
reduced
 Arrange requests so that first sector requested on second
track is next number higher than one just served
End!!

You might also like