device management ankur saggar nitin golait jason foos adam estabrook

30
Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Upload: kiara-hansel

Post on 30-Mar-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Device Management

Ankur SaggarNitin GolaitJason FoosAdam Estabrook

Page 2: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Chapter 5 Outline

I/O Subsystem – [Covered] I/O Strategies – [Covered] Device Manager Design – [Covered] Buffering Device Class Characteristics

Page 3: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Summary of topics Undertaken

What is device Manager?

Major Aims of Device Manager.

I/O Strategies.

Device Manager Design

Page 4: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 5: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Prim ary Mem ory

CPU

Controller

Device

Direct Mem ory Access

Page 6: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 7: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 8: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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)

Page 9: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Double Buffering

Process Process

DeviceDevice

Device Device

A BA B

DOUBLE BUFFERI NG

A B A B

Controller Controller

Page 10: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Circular Buffering

From Data Producer

To Data Consum er

Buffer i

Buffer j

CI RCULAR BUFFERI NG

Page 11: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 12: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Device Class Characteristics

Operating system distinguishes devices as being:

1) Block-oriented device

2) Character-oriented device

Page 13: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Communication Devices

Communication devices are character oriented devices

They transmit bytes of information between a computer and remote device

Page 14: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Communication Devices

GenericController

Local Devices

Communications Controller

Device

PrinterModemNetwork

Cable connecting the controller to the device

BUS

Page 15: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 16: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 17: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 18: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 19: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 20: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Multi-surface Disk

Track (cylinder)

Sector

Disk Surface Cylinders(Set Of Tracks)

Page 21: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 22: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 23: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

FCFS Disk Optimization algorithm

300

200

100

200 400 600 800 1000Steps

7617 29 12

137

269 201

124

Track

Page 24: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

SSTF Disk Optimization algorithm

300

200

100

100 200 300 400

29

7617

12

124137

201

269

Steps

Track

Page 25: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Scan and Look Disk Optimization algorithm

Scan

Look

100 200 300 400 500

100

200

300

76

124137

201

269

Track

Steps

Page 26: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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

Page 27: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 28: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 29: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

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.

Page 30: Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook

Resources

Nutt, Gary “Operating Systems”, Third Edition.