0% found this document useful (0 votes)
14 views10 pages

Department of Information Science and Engineering: Jss Academy of Technical Education

Uploaded by

nishanthmbshetty
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)
14 views10 pages

Department of Information Science and Engineering: Jss Academy of Technical Education

Uploaded by

nishanthmbshetty
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/ 10

USN:

JSS ACADEMY OF TECHNICAL EDUCATION


JSS Campus, Dr. Vishnuvardhana Road, Bengaluru -60
Department of Information Science and Engineering
Preparatory Exam
---------------------------------------------------------------------------------------------------------------------------------------------------

COURSE OUTCOMES COVERED IN THIS CIE

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.3 Identify causes of deadlocks and solutions for eliminating deadlock. 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.

CO Q. No Questions Marks BLL


Q1 Explain operating system services for the user and system with a neat diagram. 10 L3

C203.1 OR

Q2 Explain the different types of system calls. 10 L3

C203.2 a) Define thread. Explain multithreading models.


Q3 5+5=10 L3
b) Define process. Construct a process state diagram neatly and explain

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

a. Define deadlock. What are the necessary conditions for deadlock.


Q6 b. Explain different methods to recovery from deadlock.
5+5=10 L3

Q7 With a neat diagram, explain paging hardware with TLB. 10 L4


OR

C203.4 Consider the following page reference string.


70120304230321201701
Q8 Assuming there are 3 memory frames, how many page faults would occur in 10 L4
case of i) LRU and ii) Optimal algorithm. Note that initially all frames are
empty.

Q9 Discuss various file allocation methods. 10 L4

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)

• As a process executes, it changes state as described below:


3b) • new: The process is being created
• running: Instructions are being executed
• waiting: The process is waiting for some event to occur
• ready: The process is waiting to be assigned to a processor
• terminated: The process has finished execution

(Process Definition-1 mark, Diagram – 2 Marks and Explanation 2 Marks)


OR
4 FCFS 10
P1 P2 P3 P4 P5
0 10 11 13 14 19
Average waiting time=9.6ms
Average turnaround time=13.4ms (2 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.

(critical-section problem explanation: 3 marks)

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)

Peterson’s Solution: (Code : 2marks + Explanation: 2 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

(Diagram: 5 marks, Explanation of paging hardware with TLB: 5 marks)


OR
8 LRU Page fault: 12 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)

iii) Indexed 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)

You might also like