Department of Information Science and Engineering: Jss Academy of Technical Education
Department of Information Science and Engineering: Jss Academy of Technical Education
RBT
COs Description Levels
C203.1 Identify the process concept, structure, and design of the operating system. L3
C203.2 Experiment with the concepts of threads, process synchronization, and CPU scheduling algorithms. L3
C203.4 Analyze the virtual memory management, file system implementation, storage structure, disk scheduling and L4
protection associated with OS.
Answer the following questions.
C203.1 OR
OR
Consider the following set of processes, with the length of the CPU burst given
in milliseconds:
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
Q4 10 L3
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all
at time 0.
a) Draw four Gantt charts that illustrate the execution of these processes using
the following scheduling algorithms: FCFS, SJF, non-preemptive priority (a
smaller priority number implies a higher priority), and RR (quantum= 1).
b) What is the turnaround time of each process for each of the scheduling
algorithms?
c) What is the waiting time of each process for each of these scheduling
algorithms?
d) Which of the algorithms results in the minimum average waiting time (over
all processes)?
Explain the critical-section problem along with the requirements that it must
Q5 satisfy. Explain Peterson's solution for it.
10 L3
C203.3 OR
C203.4 OR
Explain FIFO, SSTF, SCAN and C-SCAN disk scheduling with suitable
Q10 example.
10 L4
JSS ACADEMY OF TECHNICAL EDUCATION
JSS Campus, Dr. Vishnuvaradhan Road, Bengaluru -60
Department of Information Science & Engineering
Scheme of Valuation
---------------------------------------------------------------------------------------------------------------------------------------------------
Q. Answer Marks
No
1 10
One set of operating-system services provides functions that are helpful to the user:
• User interface:
• Program execution:
• File-system manipulation:
• Communications:
• Error detection:
Set of operating-system services provides functions that are helpful to the user:
Resource allocation:
Accounting:
Protection and security: (Diagram – 4 Marks and Explanation 6 Marks)
OR
2 Types of System Calls: 10
1. Process control :
end, abort
load, execute
create process, terminate process
get process attributes, set process attributes
wait for time
wait event, signal event
allocate and free memory
2. File management
create file, delete file
open, close
read, write, reposition
get file attributes, set file attributes
3. Device management
request device, release device
read, write, reposition
get device attributes, set device attributes
logically attach or detach devices
4. Information maintenance
get time or date, set time or date
get system data, set system data
get process, file, or device attributes
set process, file, or device attributes
5. Communications
create, delete communication connection
send, receive messages
transfer status information
attach or detach remote devices
(5*2=10 marks)
3a) A thread is a lightweight, independent unit of execution within a process. It is the smallest sequence of 5+5=
programmed instructions that can be managed by the operating system scheduler.
(1 mark) 10
Multithreading models:
1.Many to one: Many user-level threads mapped to single kernel thread. One thread blocking causes all to
block. Multiple threads may not run in parallel on muticore system because only one may be in kernel at a
time.
2.One to one: Each user-level thread maps to kernel thread. Creating a user-level thread creates a kernel
thread. More concurrency than many-to-one. Number of threads per process sometimes restricted due to
overhead.
3. Many to many: Allows many user-level threads to be mapped to many kernel threads. Allows the
operating system to create enough kernel threads. Two level model allows a user thread to be bound to
kernel thread.
(4 marks)
SJF
P2 P4 P3 P5 P1
0 1 2 4 9 10
Average waiting time=3.2ms
Average turnaround time=7ms (2 marks)
Priority
P2 P5 P1 P3 P4
0 1 6 16 18 19
Average waiting time=8.2ms
Average turn around time=12ms (2 marks)
RR
P1 P2 P3 P4 P5 P1 P3 P5 P1 P5 P1 P5 P1 P5 P1 P1 P1 P1 P1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Average waiting time=5.4ms
Average turnaround time=9.2ms (3 marks)
SJF algorithm results in the minimum average waiting time =3.2ms (1 Mark)
5 Consider a system consisting of n processes {P0, P1, ..., Pn-1}. Each process has a segment of code, called a 10
critical section, in which the process may be changing common variables, updating a table, writing a file,
and so on. The important feature of the system is that, when one process is executing in its critical section,
no other process is to be allowed to execute in its critical section. That is, no two processes are executing in
their critical sections at the same time. The critical-section problem is to design a protocol that the processes
can use to cooperate. Each process must request permission to enter its critical section. The section of code
implementing this request is the entry section. The critical section may be followed by an exit section. The
remaining code is the remainder section. The general structure of a typical process P is shown in Figure.
The entry section and exit section are enclosed in boxes to highlight these important segments of code.
A solution to the critical-section problem must satisfy the following three requirements:
1. Mutual exclusion. If process P; is executing in its critical section, then no other processes can be
executing in their critical sections.
2. Progress. If no process is executing in its critical section and some processes wish to enter their critical
sections, then only those processes that are not executing in their remainder sections can participate in the
decision on which will enter its critical section next, and this selection cannot be postponed indefinitely.
3. Bounded waiting. There exists a bound, or limit, on the number of times that other processes are allowed
to enter their critical sections after a process has made a request to enter its critical section and before that
request is granted.
(Critical Section Requirements: 3 marks)
OR
6a) Deadlock definition. (1 mark) 5+5=
Necessary conditions explanation :Mutual exclusion, hold and wait, No preemption, Circular wait. 10
(4 marks)
6b) Methods to recover from deadlock:
1) Process Termination: Abort all deadlocked processes, Abort one process at a time until the deadlock
cycle is eliminated.
2) Resource Preemption: Selecting a victim, Rollback, Starvation.
(Listing and Explanation: 5 marks)
7 10
(LRU – 5 marks)
Optimal Page fault: 9
(Optimal – 5 marks)
9 File allocation methods: ( Listing all methods: 1 mark) 10
i) Contiguous Allocation (Diagram+Explanation-3 marks)
ii) Linked Allocation (Diagram+Explanation-3 marks)
OR
10 1)FIFO: FCFS is the simplest of all Disk Scheduling Algorithms. In FCFS, the requests are addressed in the 10
order they arrive in the disk queue. Explanation of FIFO with example is as follows:
2)SSTF: Shortest Seek Time First 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. Illustration
shows total head movement of 236 cylinders.
3)SCAN: 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.
SCAN algorithm Sometimes called the elevator algorithm. Illustration shows total head movement of 208
cylinders.
4)CSCAN: 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.
(Diagram: 5 marks, Explanation: 5 marks)