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

Disk Structure: Blocks, Where The Logical Block Is The Smallest Unit of Transfer. The

Disks provide secondary storage and are organized into logical blocks of 512 bytes each, which are sequentially mapped to disk sectors. Disk I/O requests are queued by the operating system and scheduled for processing using algorithms like SSTF, SCAN, or C-SCAN to minimize disk head movement. The OS manages disk formatting, partitioning, file systems, and bad sectors to efficiently utilize disk hardware.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views

Disk Structure: Blocks, Where The Logical Block Is The Smallest Unit of Transfer. The

Disks provide secondary storage and are organized into logical blocks of 512 bytes each, which are sequentially mapped to disk sectors. Disk I/O requests are queued by the operating system and scheduled for processing using algorithms like SSTF, SCAN, or C-SCAN to minimize disk head movement. The OS manages disk formatting, partitioning, file systems, and bad sectors to efficiently utilize disk hardware.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Disk Structure

 Disks provide the bulk of secondary storage.


 Disk drives are addressed as large 1-dimensional arrays of logical
blocks, where the logical block is the smallest unit of transfer. The
size of logical block is generally 512 bytes.
 The 1-dimensional array of logical blocks is mapped into the sectors
of the disk sequentially.
 Sector 0 is the first sector of the first track on the outermost
cylinder.
 Mapping proceeds in order through that track, then the rest of
the tracks in that cylinder, and then through the rest of the
cylinders from outermost to innermost.
 The number of sectors per tack is not a constant. Therefore, modern
disks are organized in zones of cylinders. The number of sectors per
track is constant within a zone.
Disk I/O
 Whenever a process needs I/O to or from a disk, it issues a system
call to the operating system.
 If the desired disk drive and controller is available, the request
can be serviced immediately other wise the request is placed in
a queue.
 Once an I/O completes, the OS can choose a pending request to
serve next.

Disk performance Parameters

 The operating system is responsible for using hardware efficiently -


for the disk drives, this means having a fast access time and disk
bandwidth.
 Disk bandwidth is the total number of bytes transferred, divided by
the total time between the first request for service and the
completion of the last transfer.

 Access time has two major components


 Seek time is the time for the disk are to move the heads to the
cylinder containing the desired sector.
 Rotational latency is the additional time waiting for the disk to
rotate the desired sector to the disk head.

 Seek time is the reason for differences in performance


 Minimize seek time
 Seek time  seek distance
Disk Scheduling

 For a single disk there will be a number of I/O requests


 If requests are selected randomly, we will get the worst possible
performance
 Several algorithms exist to schedule the servicing of disk I/O
requests.
 We illustrate them with a request queue (0-199).

98, 183, 37, 122, 14, 124, 65, 67


Head pointer 53

First Come First Serve (FCFS)

 The I/O requests are served in the order in which they reach. See
below (total head movement=640 cylinders)
 FCFS is a fair scheduling algorithm but not an optimal one.
Shortest-Seek-Time-First (SSTF)

 Selects the request with the minimum seek time from the current
head position.
 SSTF scheduling is a form of SJF CPU scheduling
 May cause starvation of some requests
 Is not optimal.
 Illustration shows total head movement of 236 cylinders.

SCAN Scheduling

 The disk arm starts at one end of the disk, and moves toward the
other end, servicing requests until it gets to the other end of the disk,
where the head movement is reversed and servicing continues.
 Sometimes called the elevator algorithm.
 Illustration shows total head movement of 208 cylinders
(head is moving towards cylinder 0).
C-SCAN Scheduling

 Provides a more uniform wait time than SCAN.


 The head moves from one end of the disk to the other, servicing
requests as it goes. When it reaches the other end, however, it
immediately returns to the beginning of the disk, without servicing
any requests on the return trip.
 Treats the cylinders as a circular list that wraps around from the last
cylinder to the first one.
C-Look Scheduling

 Version of C-SCAN
 Arm only goes as far as the last request in each direction, then
reverses direction immediately, without first going all the way to the
end of the disk.

Selecting a Disk Scheduling Algorithm

 SSTF is common and has a natural appeal


 SCAN and C-SCAN perform better for systems that place a heavy load
on the disk.
 Performance depends on the number and types of requests.
 Requests for disk service can be influenced by the file-allocation
method.
 The disk-scheduling algorithm should be written as a separate
module of the operating system, allowing it to be replaced with a
different algorithm if necessary.
 Either SSTF or C-LOOK is a reasonable choice for the default
algorithm
Disk Management
 Low-level formatting, or physical formatting - Dividing a disk into
sectors that the disk controller can read and write.
 To use a disk to hold files, the operating system still needs to record
its own data structures on the disk.
 Partition the disk into one or more groups of cylinders.
 Logical formatting or “making a file system”.
 Boot block initializes system.
 The bootstrap is stored in ROM.
 Bootstrap loader program.
 Bad sectors may be managed manually. For example MS-DOS format
command does a logical format and if it finds any bad sector, it writes
a special value into FAT.
 Sector sparing method may also used to handle bad blocks (as used
in SCSI disks). The controller maintains a list of bad sectors which is
updated regularly. Low level formatting also sets aside some spare
sectors. The controller can be asked to replace each bad sector
logically with one of the spare sectors.

You might also like