0% found this document useful (0 votes)
9 views21 pages

Device Management

Device management in operating systems involves controlling various input/output devices and managing resource allocation. Disk management is critical for organizing and optimizing data on secondary storage devices, while disk scheduling algorithms determine the order of I/O requests to enhance performance. Key disk scheduling methods include FCFS, SSTF, SCAN, C-SCAN, LOOK, and C-LOOK, each with specific advantages in minimizing seek time and improving efficiency.

Uploaded by

mohmohan64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views21 pages

Device Management

Device management in operating systems involves controlling various input/output devices and managing resource allocation. Disk management is critical for organizing and optimizing data on secondary storage devices, while disk scheduling algorithms determine the order of I/O requests to enhance performance. Key disk scheduling methods include FCFS, SSTF, SCAN, C-SCAN, LOOK, and C-LOOK, each with specific advantages in minimizing seek time and improving efficiency.

Uploaded by

mohmohan64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Device Management

Device Management

• Device management in an operating system means controlling


the Input/Output devices like disk, microphone, keyboard,
printer, magnetic tape, USB ports, camcorder, scanner, other
accessories, and supporting units like supporting units control
channels.
• A process may require various resources, including main
memory, file access, and access to disk drives, and others.
• If resources are available, they could be allocated, and control
returned to the CPU. Otherwise, the procedure would have to
be postponed until adequate resources become available.
• The system has multiple devices, and in order to handle these
physical or virtual devices, the operating system requires a
separate program known as an device controller. It also
determines whether the requested device is available.
Functions of Device
Management

• It keeps track of data, status, location, uses,


etc.
• It enforces the pre-determined policies and
decides which process receives the device
when and for how long.
• It improves the performance of specific
devices.
• It monitors the status of every device,
including printers, storage drivers, and other
devices.
• It allocates and effectively deallocates the
device.
Disk Management

• Disk management is one of the critical


operations carried out by the operating system.
• It deals with organizing the data stored on
the secondary storage devices which includes
the hard disk drives and the solid-state drives.
• It also carries out the function of optimizing the
data and making sure that the data is safe by
implementing various disk management
techniques.
Disk Structure

 The disk structure refers to the organization and layout of data


on a physical disk.
 It involves several layers and components that work together to
store and retrieve data efficiently.
 Understanding the disk structure is crucial for optimizing disk
usage and improving overall system performance.
 An efficient disk structure is essential for fast and reliable data
storage.
 It enables effective data organization, easy data retrieval, and
optimal disk allocation.
 A well-designed disk structure can significantly enhance system
performance and reduce the chances of data corruption or loss.
Disk Components
1. Platters
The platters are circular discs coated with a magnetic
material on which data is physically stored. A disk
typically consists of multiple platters, and each platter
has two surfaces where data can be stored.

2. Read/Write Heads
The read/write heads are mechanical arms that move
across the surface of the platters to read or write data.
These heads are responsible for the actual data transfer
between the disk and the computer’s memory.

3. Sectors
Sectors are the smallest units of data storage on a disk.
Each sector can hold a fixed amount of data, typically 512
bytes. All data on a disk is divided into sectors, and each
sector is assigned a unique address for easy retrieval.
4. Disk Structure Layers
The disk structure consists of multiple layers that help
organize and manage the data stored on the disk. Let’s
delve into these layers.

4.1 Physical Layer


The physical layer is the lowest layer of the disk structure. It
includes the actual physical components of the disk, such as
the platters, read/write heads, and motor. This layer is
responsible for the physical storage and retrieval of data.

4.2 File System Layer


The file system layer sits on top of the physical layer and
handles the logical organization of data on the disk. It
manages the file structure, allocation of disk space, and
tracks the location of files and directories.

4.3 Operating System Layer


The operating system layer interacts with the file system
layer to provide disk access and management. It controls the
overall disk operations, including file input/output (I/O), disk
Disk Scheduling
• Disk scheduling is a technique operating systems use to
manage the order in which disk I/O (input/output) requests
are processed.
• Disk scheduling is also known as I/O Scheduling.
• The main goals of disk scheduling are to optimize the
performance of disk operations, reduce the time it takes to
access data and improve overall system efficiency.
• Disk scheduling algorithms are crucial in managing how
data is read from and written to a computer’s hard disk.
• These algorithms help determine the order in which disk
read and write requests are processed, significantly
impacting the speed and efficiency of data access.
• Common disk scheduling methods include First-Come, First-
Served (FCFS), Shortest Seek Time First (SSTF), SCAN, C-
SCAN, LOOK, and C-LOOK.
Key Terms Associated with Disk
Scheduling
Seek Time: Seek time is the time taken to locate the disk arm to a specified track where the
data is to be read or written. So the disk scheduling algorithm that gives a minimum average
seek time is better.

Rotational Latency: Rotational Latency is the time taken by the desired sector of the disk to
rotate into a position so that it can access the read/write heads. So the disk scheduling
algorithm that gives minimum rotational latency is better.

Transfer Time: Transfer time is the time to transfer the data. It depends on the rotating speed
of the disk and the number of bytes to be transferred.

Disk Access Time = Seek Time + Rotational Latency + Transfer Time

Total Seek Time = Total head Movement * Seek Time

Disk Response Time: Response Time is the average time spent by a request waiting to
perform its I/O operation. The average Response time is the response time of all
requests. Variance Response Time is the measure of how individual requests are serviced with
respect to average response time. So the disk scheduling algorithm that gives minimum
variance response time is better.
Goal of Disk Scheduling Algorithms :

• Minimize Seek Time


• Maximize Throughput
• Minimize Latency
• Fairness
• Efficiency in Resource Utilization

Disk Scheduling Algorithms :

• FCFS (First Come First Serve)


• SSTF (Shortest Seek Time First)
• SCAN
• C-SCAN
• LOOK
• C-LOOK
1. FCFS (First Come First Serve)
FCFS is the simplest of all Disk Scheduling Algorithms. In FCFS,
the requests are addressed in the order they arrive in the disk
queue

Suppose the order of request is-


(82,170,43,140,24,16,190)
And current position of Read/Write head is: 50
Total overhead movement (total distance covered by the disk arm) or Total
Seek Time =
(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16) = 642
2. SSTF (Shortest Seek Time First)
In SSTF (Shortest Seek Time First), requests having the shortest
seek time are executed first. So, the seek time of every request is
calculated in advance in the queue and then they are scheduled
according to their calculated seek time.

Suppose the order of request is-


(82,170,43,140,24,16,190)
And current position of Read/Write head is: 50
Total overhead movement (total distance covered by the disk arm) or Total
Seek Time =
(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-140)+(190-170) =208
3. SCAN
In the SCAN algorithm the disk arm moves in a particular direction
and services the requests coming in its path and after reaching
the end of the disk, it reverses its direction and again services the
request arriving in its path. So, this algorithm works as an elevator
and is hence also known as an elevator algorithm.

Suppose the requests to be addressed are -


82,170,43,142,24,16,190.
And the Read/Write arm is at 50, and it is also given that the disk
arm should move “towards the larger value”.
Suppose we have an order of disk access requests: 20 150 90
70 30 60. The disk head is at 50
4. C-SCAN
In the SCAN algorithm, the disk arm again scans the path that has
been scanned, after reversing its direction. So, it may be possible
that too many requests are waiting at the other end or there may
be zero or few requests pending at the scanned area.
These situations are avoided in the CSCAN algorithm in which the
disk arm instead of reversing its direction goes to the other end of
the disk and starts servicing the requests from there. So, the disk
arm moves in a circular fashion and this algorithm is also similar
to the SCAN algorithm hence it is known as C-SCAN (Circular
SCAN).
The total seek time = (60-50) + (70-60) + (90-70) + (150-90) +
(199-150) + (199-0) + (20-0) + (30-20) = 378
5. LOOK
LOOK Algorithm is similar to the SCAN disk scheduling algorithm except
for the difference that the disk arm in spite of going to the end of the disk
goes only to the last request to be serviced in front of the head and then
reverses its direction from there only. Thus it prevents the extra delay
which occurred due to unnecessary traversal to the end of the disk.

Suppose the requests to be addressed are -


82,170,43,142,24,16,190. And the Read/Write arm is at 50,
and it is also given that the disk arm should move “towards
the larger value”.
Considering the head direction is right, in this case, the total
seek time = (60-50) + (70-60) + (90-70) + (150-90) + (150-
30) + (30-20) = 230
6. C-LOOK
As LOOK is similar to the SCAN algorithm, in a similar way, C-
LOOK is similar to the CSCAN disk scheduling algorithm. In CLOOK,
the disk arm in spite of going to the end goes only to the last
request to be serviced in front of the head and then from there
goes to the other end’s last request. Thus, it also prevents the
extra delay which occurred due to unnecessary traversal to the
end of the disk.
The total seek time = (60-50) + (70-60) + (90-70) + (150-90)
+ (150-20) + (30-20) = 240

You might also like