The file system consists of two parts:
- A collection of files
- A directory structure
The file management system can be implemented as one or more layers of the operating system.
The common responsibilities of the file management system include the following
- Mapping of access requests from logical to physical file address space.
- Transmission of file elements between main and secondary storage.
- Management of the secondary storage such as keeping track of the status allocation and deallocation of space.
- Support for protection and sharing of files and the recovery and possible restoration of the files after system crashes.
Each file is referred to by its name. The file is named for the convenience of the users and when a file is named, it becomes independent of the user and the process. Below are file attributes
- Time and date
One of the responsibilities of the OS is to use the hardware efficiently. For the disk drives, meeting this responsibility entails having fast access time and large disk bandwidth.
Access time has two major components
- Seek time is the time for the disk arm to move the heads to the cylinder containing the desired sector.
- The rotational latency is the additional time for the disk to rotate the desired sector to the disk head. It is not fixed, so we can take average value.
Disk bandwidth is the total number of bytes transferred, divided by the total time between the first for service and the completion of last transfer.
FCFS Scheduling: This is also known as First In First Out (FIFO) simply queues processes in the order that they arrive in the ready queue.
The following features which FIFO scheduling have.
- First come first served scheduling.
- Processes request sequentially.
- Fair to all processes, but it generally does not provide the fastest service.
Shortest Seek Time First (SSTF) Scheduling: It selects the request with the minimum seek time from the current head position. SSTF scheduling is a form of SJF scheduling may cause starvation of some requests. It is not an optimal algorithm but its improvement over FCFS.
SCAN Scheduling: In the SCAN algorithm, the disk arm starts at one end of the disk and moves toward the other end, servicing requests as it reaches each cylinder until it gets to the other end of the disk. At the other end, the direction of head movement is reversed and servicing continues. The head continuously scans back and forth across the disk. The SCAN algorithm is sometimes called the elevator algorithm, since the disk arm behaves just like an elevator in a building, first servicing all the request going up and then reversing to service requests the other way.
C-SCAN Scheduling: Circular SCAN is a variant of SCAN, which is designed to provide a more uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the other, servicing requests along the way. When the head reaches the other end, however it immediately returns to the beginning of the disk without servicing any requests on the return trip. The C-SCAN scheduling algorithm essentially treats the cylinders as a circular list that wraps around from the final cylinder to the first one.
C-LOOK Scheduling: This is just an enhanced version of C-SCAN. In this the scanning doesn't go past the last request in the direction that it is moving. It too jumps to the other end but not all the way to the end. Just to the furthest request.
You can follow the detailed champion study plan for GATE CS 2021 from the following link:
Candidates can also practice 110+ Mock tests for exams like GATE, NIELIT with BYJU's Exam Prep, Test Series check the following link:
Get unlimited access to 21+ structured Live Courses all 112+ mock tests with BYJU's Exam Prep Super for GATE CS & PSU Exams: