0% found this document useful (0 votes)
540 views11 pages

Set:-1 Tribhuvan University: Group A Attempt All The Questions. (10 1 10) Circle The Correct Answer

This document provides a sample exam for the 4th semester Operating Systems course for the Bachelor of Computer Applications program at Tribhuvan University. It contains two sections - Group A with 10 multiple choice questions testing core OS concepts, and Group B with 6 short answer questions requiring explanations. Some of the concepts covered include process states, critical sections, kernels, thread models, and more. The exam is out of a total of 60 marks and requires students to demonstrate their understanding of key operating system principles.

Uploaded by

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

Set:-1 Tribhuvan University: Group A Attempt All The Questions. (10 1 10) Circle The Correct Answer

This document provides a sample exam for the 4th semester Operating Systems course for the Bachelor of Computer Applications program at Tribhuvan University. It contains two sections - Group A with 10 multiple choice questions testing core OS concepts, and Group B with 6 short answer questions requiring explanations. Some of the concepts covered include process states, critical sections, kernels, thread models, and more. The exam is out of a total of 60 marks and requires students to demonstrate their understanding of key operating system principles.

Uploaded by

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

OS Solution For BCA 4th Semester

Set:- 1
Tribhuvan University
Bachelor in Computer Applications (BCA) Full Marks: 60
Course Title: Operating System Pass Marks: 24
Code No: CACS251 Time: 3 hours
Semester: 4th

Group A
Attempt all the questions. [101 = 10]

Circle (O) the correct answer.

1. To access the services of operating system, the interface is provided by the


a. System calls c. Library
b. API d. Assembly instruction
2. Which of the following does not contain process control block (PCB)?
a. Code c. Stack
b. Bootstrap program d. Data
3. Which of the following is not the process state?
a. Running b. Old
c. New d. Waiting
4. Which process can be affected by other processes executing in the system?
a. Cooperating process c. Parent process
b. Init Process d. Child Process
5. When several processes access the same data concurrently and the outcome of the execution
depends on the particular order in which the access takes place, is called
a. Dynamic condition c. Race Condition
b. Critical condition d. Static Condition
6. Which one of the following is synchronization tool?
a. Thread c. Pipe
b. Semaphore d. Socket
7. When high priority task is indirectly preempted by medium priority task effectively inverting the
relative priority of the two tasks, the scenario is called.
a. Priority inversion c. Priority removal
b. Priority exchange d. priority modification
8. Which of the following do not belong to queues for process?
a. Job queue c. PCB queue
b. Device queue d. Ready queue
9. Which module gives control of the CPU to the process selected by the short-term scheduler?
a. Dispatcher c. interrupt
b. Scheduler d. processor
10. The interval from the time of submission of a process to the time of completion is termed as……....
a. Waiting time c. Turnaround time
b. Response time d. Throughput

1|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
Group – 'B'
Candidates are required to answer the questions in their own words as far as possible.
Attempt any SIX questions. [6 x 5 = 30]
1. What is process? Explain different state of process with suitable block diagram.
Ans:- A process is an active program. It can also be said as a program that is under execution. It is more than the
program code as it includes the program counter, process stack, registers, program code etc. A process passes through
different states as it executes.
These states may be different in different operating systems. However, the common process states are
explained below with the help of a diagram -

New:- This is the state when the process has


just been created. It is the initial state in the
process life cycle.
Ready:- In the ready state, the process is
waiting to be assigned the processor by the
short term scheduler, so it can run. This state
is immediately after the new state for the
process.
Ready Suspended:- The processes in ready
suspended state are in secondary memory.
They were initially in the ready state in main
memory but lack of memory forced them to
be suspended and gets placed in the
secondary memory.
Running:- The process is said to be in
running state when the process instructions
are being executed by the processor. This is
done once the process is assigned to the
processor using the short-term scheduler.
Blocked:- The process is in blocked state if it is waiting for some event to occur. This event may be I/O as the I/O
events are executed in the main memory and don't require the processor. After the event is complete, the process again
goes to ready state.
Blocked Suspended:- This is similar to ready suspended. The processes in blocked suspended state are in secondary
memory. They were initially in the blocked state in main memory waiting for some event but lack of memory forced
them to be suspended and gets placed in the secondary memory. A process may go from blocked suspended to ready
suspended if its work is done.
Terminated:- The process is terminated once it finishes its execution. In the terminated state, the process is removed
from main memory and its process control block is also deleted.

2. What is critical section? How strict alternations solve the Critical section problem?
Ans:- The critical section is a code segment where the shared variables can be accessed. An atomic action
is required in a critical section i.e. only one process can execute in its critical section at a time. All the other
processes have to wait to execute in their critical sections.
The solution to the critical section problem must satisfy the following conditions-
Mutual Exclusion:- Mutual exclusion implies that only one process can be inside the critical section at any
time. If any other processes require the critical section, they must wait until it is free.
Progress:- Progress means that if a process is not using the critical section, then it should not stop any other
process from accessing it. In other words, any process can enter a critical section if it is free.
Bounded Waiting There must be some limit to the number of times a process can go into the critical
section i.e. there must be some upper bound. If no upper bound is there then the same process will be
allowed to go into the critical section again and again and other processes will never get a chance to get
into the critical section.
So, in order to remove the problem of race condition, there must be synchronization between
various processes present in the system for its execution otherwise, it may lead to data inconsistency i.e.
a proper order should be defined in which the processes can execute.

2|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
3. What is kernel? How macro kernel is differing from micro kernel?
Ans;- A Kernel is a computer program that is the heart and core of an OS. Since the OS has control over the system
so, the Kernel also has control over everything in the system. It is the most important part of an OS. Whenever a
system starts, the Kernel is the first program that is loaded after the boot loader because the Kernel has to handle
the rest of the thing of the system for the Operating System. The Kernel remains in the memory until the Operating
System is shut-down. The Kernel is responsible for low-level tasks such as disk management, memory
management, task management, etc. It provides an interface between the user and the hardware components of the
system.
Macro kernel is differing from Micro kernel on following phase
Parameters macro kernel micro kernel

Basic In microkernel user services and kernel, In monolithic kernel, both user services and kernel services
services are kept in separate address space. are kept in the same address space.

Size Microkernel are smaller in size. Monolithic kernel is larger than microkernel.

Execution Slow execution. Fast execution.

Extendible The microkernel is easily extendible. The monolithic kernel is hard to extend.

Security If a service crashes, it does effect on working If a service crashes, the whole system crashes in monolithic
of microkernel. kernel.

Code To write a microkernel, more code is required. To write a monolithic kernel, less code is required.

Example QNX, Symbian, L4Linux, Singularity, K42, Linux, BSDs (FreeBSD, OpenBSD, NetBSD), Microsoft
Mac OS X, Integrity, PikeOS, HURD, Minix, Windows (95,98,Me), Solaris, OS-9, AIX, HP-UX, DOS,
and Coyotos. OpenVMS, XTS-400 etc.

4. What is thread? Explain different type of thread model.


Ans:- A thread is an execution unit that has its own program counter, a stack and a set of registers that reside in
a process. Threads can’t exist outside any process. Also, each thread belongs to exactly one process. The
information like code segment, files, and data segment can be shared by the different threads.
Threads are popularly used to improve the application through parallelism. Actually only one thread is executed
at a time by the CPU, but the CPU switches rapidly between the threads to give an illusion that the threads are
running parallelly.
Threads are also known as light-weight processes.

The diagram above shows the single-threaded process and the multi-threaded process. A single-threaded
process is a process with a single thread. A multi-threaded process is a process with multiple threads. As the
diagram clearly shows that the multiple threads in it have its own registers, stack, and counter but they share the
code and data segment.

3|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
5. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed
here:
Process Arrival time Burst time
P1 0 80
P2 10 20
P3 10 10
P4 80 20
P5 85 50
a) Suppose a system uses RR scheduling with a quantum of 15. Create a Gantt chart illustrating the execution
of these processes?
b) What is the turnaround time for process p3?
c) What is the average wait time for the processes?
Ans:- Solve your self.

6. Suppose a new process in a system arrives at an average of six processes per minute and each such process
requires an average of 8 seconds of service time. Estimate the fraction of time the CPU is busy in a system
with a single processor.
Ans:- Solve your self.

7. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed
here:
Process Arrival time Burst time
A 0 3
B 2 5
C 4 4
D 6 1
E 8 2
a. Suppose a system uses HRNN scheduling .Create a Gantt chart illustrating the execution of these
processes?
b. What is the average wait time for the processes?
c. What is the average turnaround time for the processes?
Ans:- Test your self.

Group C
Long Questions
Attempt any two questions. (10*2=20)
1. “Operating system is resource manager” Justify this statement with suitable functionality of OS.
Ans:- An Operating System is a collection of programs and utilities. It acts as an interface
between user and computer. It creates the user-friendly environment.
The operating system acts as the manager of these resources and allocates them to specific programs and users as
necessary for their tasks. Therefore we can say an operating system is a resource manager/allocator. This is the
main features of an operating system.
When a number of computers connected through a network more than one computers trying for a computer
print or a common resource, then the operating system follow same order and manage the resources in an efficient
manner.
Generally, resources sharing in two ways "in time" and "in space". When a resource is a time-sharing resource, first
one of the tasks get the resource for some time, then another and so on.
For example, a CPU in the time-sharing system. In the time-sharing system, OS fixes the time slot for the
CPU. First one of the processes gets the CPU, when the time slot expires, the CPU switch to the next process in the
ready queue. In this example, the CPU is a time resource. CPU Scheduling in Operating System
The other kind of sharing is the "space sharing". In this method, the users share the space of resource. For example,
the main memory consisting of several processes at a time, so the process of sharing the resources.
The main difference between "in time" sharing resources and "in space" sharing resources is "in time" resources
are not divided into units, whereas "in space" sharing resources are divided into units.

4|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
2. What is process synchronization? Write and explain the solution for classical Reader-writer
synchronization problem.
Ans:- In the Operating System, there are a number of processes present in a particular state. At the same
time, we have a limited amount of resources present, so those resources need to be shared among various
processes. But we should make sure that no two processes are using the same resource at the same time
because this may lead to data inconsistency. So, synchronization of process should be there in the
Operating System. These processes that are sharing resources between each other are called Cooperative
Processes and the processes whose execution does not affect the execution of other processes are
called Independent Processes.
The Reader-Writer problem in Operating System which is used for process synchronization. In an
Operating System, we deal with various processes and these processes may use files that are present in
the system. Basically, we perform two operations on a file i.e. read and write. All these processes can
perform these two operations.
 If a process is writing something on a file and another process also starts writing on the same file at the
same time, then the system will go into the inconsistent state. Only one process should be allowed to
change the value of the data present in the file at a particular instant of time.
 Another problem is that if a process is reading the file and another process is writing on the same file at
the same time, then this may lead to dirty-read because the process writing on the file will change the
value of the file, but the process reading that file will read the old value present in the file. So, this should
be avoided.
The solution which We can solve the above two problems by using the semaphore variable. The
following is the proposed solution:
 If a process is performing some write operation, then no other process should be allowed to perform the
read or the write operation i.e. no other process should be allowed to enter into the critical section.
 If a process is performing some read operation only, then another process that is demanding for reading
operation should be allowed to read the file and get into the critical section because the read operation
doesn't change anything in the file. So, more than one reads are allowed. But if a process is reading a file
and another process is demanding for the write operation, then it should not be allowed.
So, we will use the above two concepts and solve the reader-writer problem with the help of
semaphore variables. The following semaphore variables will be used in our solution:
 Semaphore "writer": This semaphore is used to achieve the mutual exclusion property. It is used by
the process that is writing in the file and it ensures that no other process should enter the critical section
at that instant of time. Initially, it will be set to "1".
 Semaphore "mutex": This semaphore is used to achieve mutual exclusion during changing the variable
that is storing the count of the processes that are reading a particular file. Initially, it will be set to "1".

3. Does preemptive scheduling give same performance as non-preemptive scheduling algorithm?


Compare their performance by assuming at least 5 process arrived at different time intervals

Ans:- Solve yourself.

***********Best of Luck! ***********

5|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester

Set:- 2
Tribhuvan University
Bachelor in Computer Applications (BCA) Full Marks: 60
Course Title: Operating System Pass Marks: 24
Code No: CACS251 Time: 3 hours
Semester: 4th

Group A
Attempt all the questions. [101 = 10]

Circle (O) the correct answer.

1. In UNIX, which system call creates the new process?


a. Fork c. new
b. create d. none of the mentione
2. Which of the following is not an operating System?
a. Windows c. Linux
b. Oracle d. DOS
3. What else is a command interpreter called?
a. Prompt c. kernel
b. Shell d. Command
4. How circular wait condition can be prevented :
a. By defining linear ordering of resource type c. By using pipes
b. By resource grant on all or none basis d. By using threads
5. If the process is executing in its critical section, then no other process can be executing in their
critical section. What is this condition called?
a. Mutual exclusion c. Race condition
b. Deadlock d. Starvation
6. Which one of the following is synchronization tool?
a. Thread c. Pipe
b. Semaphore d. Socket
7. The processes that are residing in main memory and are ready and waiting to execute are kept on a
list called?
a. Job queue c. Ready queue
b. Execution queue d. Process queue
8. If process fail, most operating system write the error information to a
a. Log file c. PCB
b. New file d. Another running Process
9. A collection of instruction of instructions that performs a single logical function is called……..
a. Transaction c. Operation
b. Execution d. Function
10. The interval from the time of submission of a process to the time of completion is termed
as………………………..
a. Waiting time c. Turnaround time
b. Response time d. Throughput

6|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
Group – 'B'
Candidates are required to answer the questions in their own words as far as possible.
Attempt any SIX questions. [6 x 5 = 30]
1. Define the concept of Multiprogramming and Time Sharing System. Write at least three dis/advantage
of time sharing system and Multiprogramming?
Ans:- Multiprogramming operating system allows to execute multiple processes by monitoring their
process states and switching in between processes. In this processor and memory underutilization problem
is resolved and multiple programs runs on CPU that’s why it is called multiprogramming. It has no fixed
time slice for processes. Its main purpose is resource utilization.
Advantage of Multiprogramming OS : Disadvantages of Multiprogramming OS :
 No CPU idle time.  Sometimes long time jobs have to wait
 Tasks runs in parallel. long time.
 Shorter response time.  Tracking of all processes sometimes
 Maximizes total job throughput of a difficult.
computer.  Requires CPU scheduling.
 Increases resource utilization.  Requires efficient memory management.
 No user interaction with any program
during execution.

Time Sharing is the logical extension of multiprogramming, in this time sharing Operating system many
users/processes are allocated with computer resources in respective time slots. In this the processors
time is shared with multiple users that’s why it is called as time sharing operating system. It has a fixed
time slice for the different processes. Its main purpose is interactive response time.
Advantage of Time Sharing OS : Disadvantages of Time Sharing OS :
 Quick response.  It consumes much resources.
 Reduces CPU idle time.  Requires high specification of hardware.
 All the tasks are given specific time.  It has a problem of reliability.
 Less probability of duplication of software.  Security and Integrity concerns.
 Improves response time.  Probability of data communication problem.

2. Define the term semaphore.


Ans:- A semaphore is a variable that controls access to one or more resources. It is a tool developers use to
ensure functions only access valid data and run at the right time. A semaphore can prevent a deadlock or race
condition by disallowing access to a resource when it is not available.
There are two main types of semaphores in computer programming: binary and counting.
Binary Semaphores Counting Semaphores
A binary semaphore is a boolean variable that can A counting semaphore can be any non-
have only two possible values (0 or 1). It is often negative integer, also known as a whole number. Its
used as a lock to restrict access to a function or value may increase or decrease based on the results of
resource. For example, semaphore A controls one or more functions. For example, a counting
function getData(). If A = 0, getData() will not semaphore may keep track of the number of available
excute. If A = 1, getData() will run. A binary resources in a resource pool. If the semaphore
semaphore is also considered a flag or a switch decrements more than it increments, it will eventually
that is either on or off. reach 0. A zero value indicates there are no more
resources left.
NOTE: A "semaphore" in the real world is a flag or other object used to signal from a distance.

7|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
3. How does semaphore help in dining philosopher problem?
Ans:- A solution of the Dining Philosophers Problem is to use a semaphore to represent a chopstick. A
chopstick can be picked up by executing a wait operation on the semaphore and released by executing a
signal semaphore.
The structure of the chopstick is shown below −
semaphore chopstick [5];
Initially the elements of the chopstick are initialized to 1 as the chopsticks are on the table and not picked
up by a philosopher.
The structure of a random philosopher i is given as follows –
do {
wait( chopstick[i] );
wait( chopstick[ (i+1) % 5] );
..
. EATING THE RICE
.
signal( chopstick[i] );
signal( chopstick[ (i+1) % 5] );
.
. THINKING
.
} while(1);
In the above structure, first wait operation is performed on chopstick[i] and chopstick[ (i+1) % 5]. This
means that the philosopher i has picked up the chopsticks on his sides. Then the eating function is performed.
After that, signal operation is performed on chopstick[i] and chopstick[ (i+1) % 5]. This means that the
philosopher i has eaten and put down the chopsticks on his sides. Then the philosopher goes back to thinking.

4. What is scheduler? How many types of scheduler exist in OS? Explain.


Ans:- Schedulers in OS are the process which decides which task and process should be accessed and run
at what time by the system resources. It is required to maintain the multi tasking capabilities of a computer
and to keep its performance at the highest level by scheduling the process according to their preferences and
need. The Schedulers in OS are the algorithms which help in the system optimisation for maximum
performance. There are three types of scheduler exit in OS. They are:- 1. Long Term Scheduler 2. Middle
Term Scheduler 3. Short Term Scheduler
1. Long term scheduler are responsible for transferring a process to the ready queue and making it ready for
CPU assignment. Since processes are not rapidly created therefore long term scheduler operate less
frequently.
2. Middle term scheduler Sometimes when a process is waiting for CPU assignment and a process of higher
priority arrives then the process in the ready queue is swapped out in a backing store and the higher priority
process is swapped in and is assigned a CPU immediately.
3. Short time scheduler selects a process from the ready queue according to the type of scheduling
implemented by the operating system. After selecting a process from the queue it assigns it to the CPU.
Since CPU rapidly switches from one process to another therefore short term scheduler operates more
frequently.

8|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester
5. Explain Round-Robin (RR) scheduling.
Ans:- Round Robin is the preemptive process scheduling algorithm. Each process is provided a fix time to execute, it is called
a quantum. Once a process is executed for a given time period, it is preempted and other process executes for a given time
period. Context switching is used to save states of preempted processes.
Wait time of each process is as follows −

Process Wait Time : Service Time - Arrival Time

P0 (0 - 0) + (12 - 3) = 9

P1 (3 - 1) = 2

P2 (6 - 2) + (14 - 9) + (20 - 17) = 12

P3 (9 - 3) + (17 - 12) = 11

Average Wait Time: (9+2+12+11) / 4 = 8.5


6. What would happen if quantum time used in round robin scheduling is too large?
Ans:- In Round Robin Scheduling, the time quantum is fixed and then processes are scheduled such that no process get CPU
time more than one time quantum in one go. If time quantum is too large, the response time of the processes is too much
which may not be tolerated in interactive environment.
7. What is Deadlock?
Ans:- Deadlock is a situation where two or more processes are waiting for each other. For example, let us assume, we have
two processes P1 and P2. Now, process P1 is holding the resource R1 and is
waiting for the resource R2. At the same time, the process P2 is having the
resource R2 and is waiting for the resource R1. So, the process P1 is waiting for
process P2 to release its resource and at the same time, the process P2 is waiting
for process P1 to release its resource. And no one is releasing any resource. So,
both are waiting for each other to release the resource. This leads to infinite
waiting and no work is done here. This is called Deadlock.

8. How deadlock is differing from starvation. Explain necessary condition for deadlock?
Ans:- The main differing from deadlock and starvation is that deadlock occurs when each process holds a resource and waits to
obtain a resource held by another process while starvation occurs when a process waits for an indefinite period of time to obtain
a required resource.
There are four different conditions that result in Deadlock. These four conditions are also known as Coffman conditions and
these conditions are not mutually exclusive. Let's look at them one by one.
 Mutual Exclusion: A resource can be held by only one process at a time. In other words, if a process P1 is using some
resource R at a particular instant of time, then some other process P2
can't hold or use the same resource R at that particular instant of time.
The process P2 can make a request for that resource R but it can't use
that resource simultaneously with process P1.
 Hold and Wait: A process can hold a number of resources at a time
and at the same time, it can request for other resources that are being held by some other process. For example, a process
P1 can hold two resources R1 and R2 and at the
same time, it can request some resource R3 that is
currently held by process P2.
 No preemption: A resource can't be preempted
from the process by another process, forcefully. For
example, if a process P1 is using some resource R,
then some other process P2 can't forcefully take that resource. If it is so, then what's the need for various scheduling
algorithm. The process P2 can request for the resource R and can wait for that resource to be freed by the process P1.
 Circular Wait: Circular wait is a condition when the first process is waiting for the resource held by the second
process, the second process is waiting for the resource held by the
third process, and so on. At last, the last process is waiting for the
resource held by the first process. So, every process is waiting for
each other to release the resource and no one is releasing their own
resource. Everyone is waiting here for getting the resource. This is
called a circular wait.
Deadlock will happen if all the above four conditions happen
simultaneously.

9|P a g e Ghanashyam Dhungana


OS Solution For BCA 4th Semester

9. What is an operating System? Explain the function of operating system?


Ans:- An Operating System (OS) is an interface between a computer user and computer hardware. An
operating system is a software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral devices such as
disk drives and printers.Some popular Operating Systems include Linux Operating System, Windows
Operating System, VMS, OS/400, AIX, z/OS, etc.
There are various type of functions of operating system some of them are.
• Memory management :- Its function of an operating system takes care of allocation and de-allocation
of memory space to the programs, data or information.
• Processor management:- An operating system takes care of creation and deletion of processes,
scheduling of system resources to different processes requesting them and providing mechanism for
communicating between the processes.
• Device management :- An operating system keeps track of I/O devices connected to the computers
system.
• File Management :- The file management of function of operating system takes care of files such
organization. Storage, retrieval, naming, sharing and protection of files from unauthorized excess.
• Security Management :- An operating system that protects the resources and information of computer
against distraction and unauthorized excess

10. What does file mean? Explain how access control matrix provides resources protection that may access
process?
Ans:- A file is a container in a computer system for storing information. Files used in computers are similar
in features to that of paper documents used in library and office files. There are different types of files such
as text files, data files, directory files, binary and graphic files, and these different types of files store
different types of information. In a computer operating system, files can be stored on optical drives, hard
drives or other types of storage devices.
Access Matrix is a security model of protection state in computer system. It is represented as a matrix.
Access matrix is used to define the rights of each process executing in the domain with respect to each
object. The rows of matrix represent domains and columns represent objects.

11. What do you mean by one time password in authentication? How worms are differing from virus?
Ans:- A one-time password (OTP) is an automatically generated numeric or alphanumeric string of
characters that authenticates the user for a single transaction or login session. An OTP is more secure than
a static password, especially a user-created password, which can be weak and/or reused across multiple
accounts. OTPs may replace authentication login information or may be used in addition to it in order to
add another layer of security.
Worms : is similar to virus but it does not modify the program. It replicate itself more and more to
cause slow down the computer system. Worms can be controlled by remote. The main objective of
worms to eat the system resources.
Virus : is a malicious executable code attached to another executable file which can be harmless or can
modify or delete data. When the computer program runs attached with virus it perform some action such
as deleting a file from the computer system. Virus can’t be controlled by remote.

12. Suppose a new process in a system arrives at an average of six processes per minute and each such
process requires an average of 8 seconds of service time. Estimate the fraction of time the CPU is busy
in a system with a single processor
Ans:- Solve yourself.

10 | P a g e Ghanashyam Dhungana
OS Solution For BCA 4th Semester

13. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order
listed here:
Process Arrival time Burst time
A 0 3
B 2 5
C 4 4
D 6 1
E 8 2
d. Suppose a system uses HRNN scheduling .Create a Gantt chart illustrating the execution of these
processes?
e. What is the average wait time for the processes?
f. What is the average turnaround time for the processes?
Ans:- Solve yourself.

Group-C
Attempt any two questions [10X2=20]
1. What is process? Explain different States of process with diagram. Also explain in details the
contents of PCB of a process.
2. What is process synchronization? Write and explain the solution for classical Reader-writer
synchronization problem.
3. Consider the following System:

Answer the following questions using Banker's algorithm:


a. What will be the contents of matrix need?
b. Draw the safe sequence?
c. If the request from P! arrives for (0,4,2,0) can the request be granted immediately?
Ans:- Solve yourself.

***********Best of Luck! ***********

11 | P a g e Ghanashyam Dhungana

You might also like