Model Paper-02
Model Paper-02
PART-A
Ex:
macOS.
Microsoft Defender.
Linux.
Windows 11
3. What do you mean by booting?
6. What is spooling?
SPOOL is an acronym for simultaneous peripheral operations on-line. It is a
kind of buffering mechanism or a process in which data is temporarily held
to be used and executed by a device, program or the system.
Ex:
In printer, the documents/files that are sent to the printer are first stored in
the memory or the printer spooler. Once the printer is ready, it fetches the
data from the spool and prints it.
b) Identifier: Along with the name, Each File has its own extension which
identifies the type of the file. For example, a text file has the extension .txt,
A video file can have the extension .mp4.
c) Type: In a File System, the Files are classified in different types such as
video files, audio files, text files, executable files, etc.,
d) Location: In the File System, there are several locations on which, the
files can be stored. Each file carries its location as its attribute.
PART-B
Initially, all slots are empty, so when 1, 3, 0 came they are allocated
to the empty slots —> 3 Page Faults.
when 3 comes, it is already in memory so —> 0 Page Faults. Then 5
comes, it is not available in memory so it replaces the oldest page
slot i.e 1. —>1 Page Fault. 6 comes, it is also not available in memory
so it replaces the oldest page slot i.e 3 —>1 Page Fault. Finally, when
3 come it is not available so it replaces 0 1 page fault.
Least Recently Used: In this algorithm, page will be replaced which is
least recently used.
Single-level directory –
The single-level directory is the simplest directory structure. In it, all
files are contained in the same directory which makes it easy to support
and understand.
A single level directory has a significant limitation, however, when the
number of files increases or when the system has more than one user.
Since all the files are in the same directory, they must have a unique
name. If two users call their dataset test, then the unique name rule
violated.
Two-level directory –
As we have seen, a single level directory often leads to confusion of
files names among different users. The solution to this problem is to
create a separate directory for each user.
In the two-level directory structure, each user has their own user files
directory (UFD). The UFDs have similar structures, but each lists only
the files of a single user.
Tree-structured directory –
Once we have seen a two-level directory as a tree of height 2, the
natural generalization is to extend the directory structure to a tree of
arbitrary height.
This generalization allows the user to create their own subdirectories
and to organize their files accordingly.
12. With a common example compare FCFS algorithm with SJF algorithm and
justify which algorithm is advantageous to use.
First Come First Served (FCFS) Shortest Job First (SJF) executes the
executes the processes in the order in processes based upon their burst
which they arrive i.e. the process that time i.e. in ascending order of their
arrives first is executed first. burst times.
FCFS leads to the convoy effect. It does not lead to the convoy effect.
FCFS lead to lower device and CPU SJF leads to higher effectiveness of
utilization thereby decreasing the the system due to lower average
efficiency of the system. waiting time.
FCFS does not suffers from starvation SJF suffers from starvation.
In the above diagram, resource 1 and resource 2 have single instances. There is a
cycle R1 → P1 → R2 → P2. So, Deadlock is Confirmed.
2. If there are multiple instances of resources –
Detection of the cycle is necessary but not sufficient condition for deadlock
detection, in this case, the system may or may not be in deadlock varies according
to different situations.
The wait-for graph can't be used for a resource allocation system containing
multiple instances of each resource type. Hence, a different algorithm is
employed which carries certain data structures. The data structures in the
algorithm are,
Available: It is an array of length m. It represents the number of available
resources of each type
Allocation: It is an n x m matrix which represents the number of resources of each
type currently allocated to each process.
Request: It is an n*m matrix that is used to indicate the request of each process:
if Request[i][j] equals to k, then process Pi is requesting k more instances of
resource type Ri
Allocation and request are taken as vectors and referred to as Allocation and
Request.
The given detection algorithm is simply used to investigate every possible
allocation sequence for the process that remain to be completed.
Step1: Let Work and Finish be vectors of length m and a, respectively. Initialize
Work Available
Finish(i) false for 1-0, 1-1.
If Allocationi is not equal to 0,then Finish[i]=false; else Finish(i)=true
Step 2: Find an index i such that both
Finish[i]==false
Request<= Work
If no such exist then go to step 4.
Step 3: Perform the following:
Work= Work+ Allocationi
Finish[i]=true
Go to step 2.
Step 4: If Finish[i]== false for some 1,0<=i<n, then it means the system is in a
deadlocked state Moreover, if Finish[i]==false, then process Pi is deadlocked
This algorithm may require an order of mxn2 operations in order to determine
whether the system is in a deadlocked state.
PART-C
III. Answer any Three questions each question carries 8 marks
16. Explain in detail the role of operating system in process management, and file
management. Input-output management.
Process Management:
Control access to shared resources like file, memory, I/O and CPU.
Control execution of applications.
The creation, execution and deletion of both user and system processes.
Cancel or resume a process.
Schedule a process
The provision of mechanisms for process synchronization &
communication.
The provision of mechanisms for deadlock handling.
File Management:
File and directory creation and deletion.
Manipulating files and directories.
Provide access to files.
Mapping files onto secondary storage.
Backup files on stable storage media. 6. Protection and security of the
files.
Input-Output Management:
Open, close and write device drivers
Communicate, control and monitor the device driver.
It offers a buffer caching system
It provides drivers for particular hardware devices.
To run the device driver software for specific hardware devices as and
when required
17. Explain inter-process communication in detail.
Inter-process communication is the mechanism provided by the
operating system that allows processes to communicate with each
other. This communication could involve a process letting another
process know that some event has occurred or the transferring of data
from one process to another.
Working:
When the CPU requests access to any page, the page table is used to find
the page in the main memory. If the page is found on the main memory, it
is good, and if it is not, then a page fault occurs.
Page fault is when the CPU wants to access the page from the main
memory, but it is not present in the main memory. Then, how to overcome
this?
For this swapped-in is used, the swapped-in is used to swap from the
secondary memory. Swapped-in refers to moving a program back to the
hard drive from the main memory, or RAM. However, if the page is already
in the main memory, it is retrieved from there. The secondary memory is
loaded with other pages. There are also valid and invalid bits, which are
used to check whether the page is present in the main memory. Valid bits
mean that the page is legal and present in the memory, and invalid bits
mean the page is not valid or it is not present in the memory.
Two-level directory –
As we have seen, a single level directory often leads to confusion of
files names among different users. The solution to this problem is to
create a separate directory for each user.
In the two-level directory structure, each user has their own user files
directory (UFD). The UFDs have similar structures, but each lists only
the files of a single user.
Tree-structured directory –
Once we have seen a two-level directory as a tree of height 2, the
natural generalization is to extend the directory structure to a tree of
arbitrary height.
This generalization allows the user to create their own subdirectories
and to organize their files accordingly.