Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook.
-
Upload
kiara-hansel -
Category
Documents
-
view
231 -
download
1
Transcript of Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook.
Device Management
Ankur SaggarNitin GolaitJason FoosAdam Estabrook
Chapter 5 Outline
I/O Subsystem – [Covered] I/O Strategies – [Covered] Device Manager Design – [Covered] Buffering Device Class Characteristics
Summary of topics Undertaken
What is device Manager?
Major Aims of Device Manager.
I/O Strategies.
Device Manager Design
Direct Memory Access
Its also another way to increase the CPU utilization by offloading the processor from the burden of watching the status bits and feeding data to a device controller as is done in Programmed I/O. Its used with the devices that does large transfers.
Under this a special purpose processor called DMA Controller performs the direct transfer between the device controller and main memory without help from CPU.
Prim ary Mem ory
CPU
Controller
Device
Direct Mem ory Access
Memory mapped I/O
To initiate the DMA transfer, the host writes a DMA command block into memory. This block contains a pointer to the source of transfer, a pointer to destination and the count of number of bytes.
CPU writes the address of this command block to the DMA controller, then goes on with other work.
DMA Controller proceeds to operate the memory bus directally without help from CPU.
When the entire transfer is finished, the DMA controller interrupts the CPU.
Buffering
Buffering is a technique that’s employed by DM to keep I/O devices busy in times when Process doesn’t requires I/O operations. Thus, it overlaps the device and CPU operation.
Input Buffering – Technique of having the input device copy information into the primary memory before the process requests it.
Output Buffering – Technique of Saving information in memory and then writing it to the device while the process continues execution.
Hardware Buffering
Process
Data
Device
Controller
Process Process
Controller Controller
Device Device
A BA B
Unbuffered Process Reads b( j-1)Controller reads b( j)
HARDW ARE BUFFERI NG
Process Reads b(j)Controller reads b(j+1)
Double Buffering
Process Process
DeviceDevice
Device Device
A BA B
DOUBLE BUFFERI NG
A B A B
Controller Controller
Circular Buffering
From Data Producer
To Data Consum er
Buffer i
Buffer j
CI RCULAR BUFFERI NG
Prerequisites for Buffering
Device Driver must know enough about the way information is read from the device so that it can predict what data will be read in the near future.
Thread behavior be conducive to buffering.
Device Class Characteristics
Operating system distinguishes devices as being:
1) Block-oriented device
2) Character-oriented device
Communication Devices
Communication devices are character oriented devices
They transmit bytes of information between a computer and remote device
Communication Devices
GenericController
Local Devices
Communications Controller
Device
PrinterModemNetwork
Cable connecting the controller to the device
BUS
Asynchronous Serial Devices
These are character oriented devices. They exchange characters with the computer using explicit signals to control the transfer of each character.
Asynchronous Serial Device controllers are typically implemented on a single chip (an UART) having computational power of a small microprocessor.
Storage Devices
There are two types of storage devices: Sequentially accessed storage device Randomly accessed storage device Both are usually block-oriented; The data
is read / written to device as a block of bytes.
Sequentially accessed Storage Device
They physically store the blocks on a recording medium in a linear sequence.
Bytes may or may not be stored linearly within the blocks.
Randomly accessed storage devices
Allow the drivers to access the blocks on the device in an arbitrary order.
Employ a block read/write interface between the controller and the device.
The software intending to access information stored on a RASD should determine the order in which blocks should be read/ written on the device.
Magnetic Disk
Information can be read from or written to the track of the disk by radial alignment of heads over the desired track.
The number of physical records (blocks) stored on the disk is determined by the number of tracks, number of sectors and number of surfaces present in the disk.
Multi-surface Disk
Track (cylinder)
Sector
Disk Surface Cylinders(Set Of Tracks)
Optimizing Algorithms for access on magnetic disk
This is done in four ways: First Come First Serve (FCFS) This is a simple approach but does not
give good performance.
Shortest Seek Time First (SSTF) This gives good performance but is not
optimal. It is also subject to starvation.
Scan and Look Disk Optimization
All requests for each track is served. Both, scan and look serve every request in one complete pass through the disk. Thus, starvation is avoided.
Circular Scan and Look Disk Optimizations
Newly arrived requests will be serviced in a single scan of the disk, unlike Scan/Look algorithm where new request is not serviced for two full disk scans.
FCFS Disk Optimization algorithm
300
200
100
200 400 600 800 1000Steps
7617 29 12
137
269 201
124
Track
SSTF Disk Optimization algorithm
300
200
100
100 200 300 400
29
7617
12
124137
201
269
Steps
Track
Scan and Look Disk Optimization algorithm
Scan
Look
100 200 300 400 500
100
200
300
76
124137
201
269
Track
Steps
76
Circular Scan and Look Optimization algorithm
300
200
100
100 200 300 400 500
Track
Steps
Circular LookCircular Scan
137
124
201
269
29
1217
Data Storage Media
CD-ROM (Compact Disk-Read Only Memory) Graphic data can be interspersed with audio
information. It delivers 75 sectors per second. It consists of 2
modes:
MODE 1-> 2048 bytes contains stored information and data
MODE2->2324 bytes it is the usable storage size.
Rewritable CD Low power lasers are used to read the
surface of the CD. High power lasers are used to write the
surface of the CD. Mid-powered laser settings will remove
logical pits from the surface, erasing the data previously written to the disk.
SUMMARY: Device Management is implemented across
resource managers, device drivers and device handlers.
System administrator can add devices and drivers without having to change the OS due to open systems.
Optimizations increase device throughput and reduces an individual process’s waiting time for I/O
Storage technology increases with the development of the higher density disks, new storage media and faster access time.
Resources
Nutt, Gary “Operating Systems”, Third Edition.