Os-Activity 2.3-MTBS

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

OPERATING SYSTEM

ACTIVITY 2.3
1. Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request
at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO
order, is: 2, 069, 1, 212, 2, 296, 2, 800, 544, 1, 618, 356, 1, 523, 4, 965, 3, 681
Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to
satisfy all the pending requests for each of the following disk-scheduling algorithms?
a. FCFS

● Head moves to 2,069: 2,069 - 2,150 = 81

● Head moves to 1,212: 1,212 - 2,069 = 857

● Head moves to 2,296: 2,296 - 1,212 = 1,084

Total: Total 20,653 cylinders.


b. SSTF

● 1,805 to 1,618 is the shortest, followed by 2,150 to 2,069, and so on.

Total distance: 6,841 cylinders.


c. SCAN

● Head moves towards the end (4,999), then reverses direction when reaching the end or start

Total distance: 10,284 cylinders.


d. C-SCAN

● Comparable to SCAN, but only able to scan in one direction at a time.

There are 6,765 cylinders in all.

2. Why do some systems keep track of the type of a file, while others leave it to the user and others simply do
not implement multiple file types? Which system is “better”?
The option to track file types, leave it to users, or forego numerous file kinds entirely is determined by the
design philosophy and priorities of the system. Users can specify file types in systems that prioritize user
control and flexibility, giving them a high degree of customisation. Simpler models may choose for
automatic file type determination based on content or extensions to simplify the user experience and reduce
complexity. File types may be tracked by security-focused systems to improve safety and consistency,
prohibiting the execution of potentially hazardous files. Interoperability considerations, adherence to
standards, resource limits, and user experience goals all play a part in determining a system's strategy. The
"better" system is determined by the unique use case and the balance of system-relevant criteria.

3. Consider a file system in which a file can be deleted and its disk space reclaimed while links to that file still
exist. What problems may occur if a new file is created in the same storage area or with the same absolute
path name? How can these problems be avoided?
In a file system where a file can be deleted and its disk space reclaimed while links to the file still persist,
establishing a new file in the same storage area or with the same absolute path name may cause problems. If
a new file is created in the reclaimed space, it may overwrite the data remnants of the deleted file,
potentially leading to data corruption or unexpected information in the new file. To avoid these issues, the
file system could use mechanisms such as delayed allocation, in which the actual disk space is not
immediately released upon deletion, or it could use unique identifiers for files that persist even after
deletion, preventing the inadvertent reuse of the same storage space or path name. Proper file deletion and
creation, as well as cautious disk space management, are required to ensure data integrity and prevent
unexpected file system conflicts.

You might also like