input and output management chapter 4 (3).pptx

natyesu 32 views 10 slides May 28, 2024
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

input and output management


Slide Content

Chapter four Input/output Management I/O management is important for communication between the user and computer . I/O devices concerns with the way data are handled by the I/O device. I/O devices have two major components – Electronic Component - Adapter/device controller Mechanical Component - the moving parts Basic functions of the operating system as I/O manager are: Control all the computer I/O devices detect interrupts and handle errors Provide an interface between the device and the rest of the system

Cont… There are two types of I/O devices:– Blocked devices : means a device that able to store information in Fixed-size blocks (such as disks). Common block size range from 512 bytes to 32,768 bytes. Character devices:- a device able to process or accepts a stream of character, without regard to any block structure. (such as printers, mouse and NIC).

I ssues that an I/O software should fulfilled are: Device Independence : It should be possible to write/modified programs that can read files on a floppy disk, on hard disk, or on a CD-ROM, without having to modify the program for each different device types. Uniform Naming: the name of a file or a device shouldn't dependent on the device in any way. Error handling: the ability of recovering   error conditions when it is occurred. I t helps to handling both hardware and software errors. Device types: Sharable and dedicated/ single user device

Layers of I/O software The following are the I/O software layers Interrupt handler (bottom) Device driver Device independent OS software User-level software (top )

Cont… Basic Functions of the device-independent I/O software:- Uniform interfacing for device drivers – Perform I/O function common to all drives. Device Naming – Responsible for mapping symbolic devices names onto the proper driver. Device protection – Prevent users from accessing devices that they are not entitled to access. Providing device -independent block size – Provide uniform block size to higher layers hiding differences in block sizes. Buffering: buffering the data/inputs that arrive before it is needed until the rest of the data are written. Storage allocation on block devices: When a file is created and filled with data, new disk blocks have to be allocated to the file. Allocating and releasing dedicated devices: It is up to the OS to examine requests for devices usage and accept or reject them. Error reporting: Errors handling, by and large, is done by drivers.

Disk Access Time The time required to read or write a disk block is determined mainly by the following three parameters: Seek time:- The time to move the arm/request to the proper cylinder. Rotational delay:- The time to rotate/ swap the disk and position the required sector under the read/write head ). Transfer time:- The actual data transfer time. Disk scheduling:- is done by Os to schedule I/O requests arriving for disk.  It used to reduce the average seek time. First-Come, First-Served (FCFS) : Accept a request one at a time and carries them in the order they arrive. Advantage:- Fair scheduling Disadvantage:- Does not try to optimize seek time. Disk Access Time = Seek Time + Rotational Latency + Transfer Time

Cont… Shortest Seek First (SSF) :   R equests having shortest seek time are executed first. So , the seek time of every request is calculated in advance in queue and then they are scheduled according to their calculated seek time . As a result, the request near the disk arm will get executed first . Advantage :- Throughput increase and minimized response time Disadvantage: Seek time calculation is difficult

Cont… Elevator Algorithm ( SCAN ):-used  to determine the motion of the disk's arm and head in servicing read and write requests. In SCAN algorithm the disk arm moves into a particular direction and services the requests coming in its path and after reaching the end of disk, it reverses its direction and again services the request arriving in its path. So , this algorithm works like an elevator and hence also known as  elevator algorithm. Advantage:- better fairness . Disadvantage:- long waiting/seek time

E xamples of Disk Scheduling Algorithms Work Queue : 23, 89, 132, 42, 187  there are 200 cylinders numbered from 0 - 199  the disk head stars at number 100 FCFS total time is estimated by total arm motion  SSF Elevator algorithm

Thank You!!!