You are on page 1of 6

College of Sciences

Department of Computer Science


14 11352: Op era tin g S y st em s
F al l 2018- 19
F in al Exam
1 5 t h of Decem ber, 2018 (11: 00 - 1 3: 00)

Name: ID: Sign:

INSTRUCTIONS:
• Attempt ALL questions using the space provided after each question
• This is closed book exam
• No break during the exam
• No E-Dictionaries and mobiles are allowed

Course Outcomes
A. Understand the internals of the machine and how the OS and the hardware cooperate to present a
convenient (and efficient) system to the user.
B. Identify the major types and components of OS
C. Identify the different design problems related to OS.
D. Master OS concepts like resource management, virtualization, processes and their interaction, and file
systems.
E. Understand, implement and evaluate the major algorithms needed in modern OS such as scheduling
and deadlock algorithms.
F. Understand, implement and evaluate the main algorithms of main memory and file management
used in modern OS.

Outcomes Weight Questions Score

A 10 Q1

B 8 Q2

C 9 Q3

D 6 Q4

E 6 Q5

F 6 Q6

Total 45

1 41 135 2: O pe r ati ng S ys te m s Page 1 of 6


Question 1: [10 Marks] [Outcome A]
Indicate whether each of the following statements is True or False, in case of false justify:

TRUE/FALSE Statement
In Ubuntu, the return value for the fork system call is non-zero for the child
process and zero for the parent process.

The state of a process is defined as the activity that will be executed next by the
process.

Multithreading an interactive program will increase responsiveness to the user


by continuing to run the program even if a part of it is blocked.

Asynchronous cancellation allows the target thread to periodically check if it


should be cancelled (using a flag), also known as safe cancellation.

If a system has HT (Hyper Threading) technology support available, the HT will


be enabled when the number of active threads increase than the number of
cores.

The threads of a multithreaded process share heap memory and global


variables. Each thread has its separate set of register values and a separate
stack.

In the many-to-one threading model, if a thread makes a blocking system call,


the entire process will be blocked.

The turnaround time is the total waiting time for a process to finish execution.

In paging system, the logical memory is divided into frames and the physical
memory is divided into pages.

The segment of code in which the process may change common variables,
update tables, or write into files is known as critical section.

1 41 135 2: O pe r ati ng S ys te m s Page 2 of 6


Question 2: [8.0 Marks] [Outcome B]
[2 marks] i. Consider the following segment table, what are the physical addresses for the following logical
addresses?

a. 4, 48 Segment Base Length


0 219 600
1 2300 14
2 90 100
b. 2, 102 3 1327 580
4 1952 96

c. 1, 5

d. 0, 111

[2 marks] ii. Describe a situation when the mechanisms of pure paging and demand paging systems have no
difference. Explain

[4 marks] iii. Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order), how would each
of the first-fit, best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB (in order)? Which algorithm makes
the most efficient use of memory?

1 41 135 2: O pe r ati ng S ys te m s Page 3 of 6


Question 3: [9.0 Marks] [Outcome C]
[3 marks] i. Spinlocks are not considered as appropriate for single-processor or single-core systems; however, they
are commonly used in multiprocessor systems, why? Explain.

[3 marks] ii. In the operating systems, there are two main approaches to kernel design: preemptive kernels and
nonpreemptive kernels. Describe two advantages of preemptive kernels over nonpreemptive ones.

[3 marks] iii. Consider the following code in which P and Q are two processes sharing a common semaphore, called
sem initialized to 0. Describe the outcome and the advantage of the following use of semaphore.

P:
cout<<”Hello Sharjah”;
signal(sem);
Q:
wait(sem);
cout<<”Hello Abu Dhabi”;

Question 4: [6.0 Marks] [Outcome D]


[2 marks] i. Disks are formatted into different size sectors, depending on the file system in use. If there are two sizes
available, generally speaking, small and large sectors, which one is preferred? Explain.

1 41 135 2: O pe r ati ng S ys te m s Page 4 of 6


[4 marks] ii. Given the disk requests in a queue for cylinders: 10, 22, 20, 2, 40, 6, 38 in the order given. The disk has
60 total cylinders and the disk head is currently positioned over cylinder 20. A seek takes 2 milliseconds per cylinder
moved. What is the sequence of reads and total seek time using each of the following algorithms?

a) First Come First Serve (FCFS) b) Shortest Seek Time First (SSTF)

Question 5: [6.0 Marks] [Outcome E]


Consider the following set of processes, with the length of the CPU-burst time given in milliseconds, using
preemptive version of Priority based Scheduling algorithm to find out the average waiting time and average
turnaround time (in milliseconds) for each process given in the following table.
Note: a smaller number implies a higher priority.

Process Burst Time in Priority Arrival Time in


milliseconds milliseconds
P1 8 5 0
P2 4 3 1
1 41 135 2: O pe r ati ng S ys te m s Page 5 of 6
P3 5 1 2
P4 7 2 3
P5 3 4 5
P6 1 4 4

Question 6: [6.0 Marks] [Outcome F]


Suppose a program references pages in the following sequence: ACBDBAEFBFAGEFA
Use Optimal Page Replacement algorithm to compare performance (in terms of page faults) if the following number
of free frames are available in memory.
(a) 3 free frames
(b) 4 free frames.

1 41 135 2: O pe r ati ng S ys te m s Page 6 of 6

You might also like