0% found this document useful (0 votes)
76 views

CE-303 Operating Systems Final Spring 2021

1. The document describes the instructions for an online end semester examination for the Operating Systems course taken by Computer Engineering students. It provides details of the exam such as date, time, submission deadline, instructions, and 5 questions to be answered. 2. The questions assess different cognitive levels including understanding, analyzing, and applying concepts. They cover topics like page replacement algorithms, file access methods, process synchronization using semaphores, differences between multithreading and multiprocessing, and process synchronization. 3. Students are expected to show their work, cite references properly, and avoid plagiarism. They must submit their answers in MS Word or PDF format before the given deadline.

Uploaded by

nawal 109
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

CE-303 Operating Systems Final Spring 2021

1. The document describes the instructions for an online end semester examination for the Operating Systems course taken by Computer Engineering students. It provides details of the exam such as date, time, submission deadline, instructions, and 5 questions to be answered. 2. The questions assess different cognitive levels including understanding, analyzing, and applying concepts. They cover topics like page replacement algorithms, file access methods, process synchronization using semaphores, differences between multithreading and multiprocessing, and process synchronization. 3. Students are expected to show their work, cite references properly, and avoid plagiarism. They must submit their answers in MS Word or PDF format before the given deadline.

Uploaded by

nawal 109
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Online End Semester Examinations: Spring 2021

Sir Syed University of Engineering & Technology


Faculty of Electrical and Computer Engineering
Department of Computer Engineering

Online End Semester Examinations (Spring 2021)


BS (Computer
Subject CE-303 Operating Systems Program
Engineering)
Engr. Huma Hasan Rizvi, Engr. Khaliq Ahmed
Instructor Semester 5th
Engr. M. Najmul Islam Farooqui
Maximum Marks 50
Start date & Time June 9th, 2021 Submission June 9th, 2021
at 12:00 PM Deadline at 5:00 PM
Students must meet their submission deadline as there is no re-take or re-attempt after the deadline.

IMPORTANT INSTRUCTIONS:

Read the following Instructions carefully:

• All Questions carry equal marks


• Attempt All Questions on MS-Word. Font theme and size must be Times New Roman and 12 points
respectively. Use line spacing 1.5.
• You may provide answers HANDWRITTEN. The scanned solution must be submitted in PDF file
format (Use any suitable Mobile Application for Scanning)
• For Diagrams, you can use paper and share a clear visible snapshot in the same Answer Sheet.
• Arrange questions and their subsequent parts in sequence.
• Make sure that your answers are not plagiarized or copied from any other sources. In case of
plagiarism, ZERO marks will be awarded.
• Provide relevant, original and conceptual answers, as this exam aims to test your ability to examine,
explain, modify or develop concepts discussed during the course.
• Recheck your answer before the submission on VLE to correct any content or language related
errors.
• You must upload your answers via the VLE platform ONLY.

You must follow general guideline for students before online examination and during online
examination which had already shared by email and WhatsApp.

This paper has a total of 03 pages including this title page

SSUET Page 1 of 3
Online End Semester Examinations: Spring 2021

Sir Syed University of Engineering & Technology


Faculty of Electrical and Computer Engineering
Department of Computer Engineering
Q.No.1 (CLO_2): (Cognitive Level C4, i.e., Analyzing) (PLO_2: Problem Analysis) (10 Marks)

(a) Given the following stream of page references by an application, compare the performance of
the algorithms by calculating the number of page faults the application would incur with the
FIFO, LRU and Optimal page replacement algorithms. Assume that there are 3 frames, and all
are initially empty. (05 Marks)
Reference Stream: F E G B X1 D E G A X1 F B E X1 H E B G
(Where X1 is the first vowel of your name, e.g. ‘X1’=O if your name is OSAMA AHMED

(b) Analyze the given paging system with the page table stored in memory and answer the following:
i. If a memory reference takes 50 nanoseconds, how long does a paged memory reference take?
ii. If we add TLBs, and Y percent of all page-table references are found in the TLBs, identify
the effective memory reference time. Assume that finding a page-table entry in the TLBs takes
2 nanoseconds, if the entry is present. (05 Marks)
(Where Y=100-(3 digit roll number), if your roll number is 2019-CE-030, then Y=100-30=70)

Q.No.2 (CLO_1): (Cognitive Level C2, i.e., Understanding)(PLO_1: Engineering Knowledge)


(10 Marks)
(a) Consider a system that supports sequential and direct access methods. Explain what criteria
should be used in deciding which strategy is best utilized for a file? (05 Marks)
(Your answer should not be copied from other students. It will result in 0 marks)

(b) Given a disk with 250 tracks, where track requests are received in the following order 55, 58,
39, 18, 90, Y, 160, 150, 38, 184. The starting position for the arm is track 30 and previously it
was on track 25. Estimate the total number of tracks crossed when the following algorithms are
used: FCFS, SSTF, C-SCAN and LOOK. (05 Marks)
(Use Y=50+(Z*11), where Z=0+2+5=7, for roll number 025, means Y=50+(7*11)=127

Q.No.3 (CLO_2):(Cognitive Level C4 i.e., Analyzing)(PLO_2: Problem Analysis) (10 Marks)


(a) This problem was originally based on the student’s bus at Adamjee College. Students come to
a bus stop and wait for a bus. When the bus arrives, all the waiting riders invoke boardBus(),
but anyone who arrives while the bus is boarding must wait for the next bus. The capacity of
the bus is 30 people; if there are more than 30 people waiting, some will have to wait for the
next bus. When all the waiting riders have boarded, the bus can invoke depart(). If the bus
arrives when there are no riders, it should depart immediately. Write the code using Semaphore
and illustrate how your solution can provide synchronization correctly. (6 Marks)
(Your answer should not be copied from other students. It will result in 0 marks)

(b) Compare the methods used by processes P1 and P2 for accessing their critical sections whenever
needed, as given below. The initial values of shared Boolean variables S1 and S2 are randomly
assigned.
Method Used by P1 Method Used by P2
while (S1 == S2) ; while (S1 != S2) ;
Critica1 Section Critica1 Section
S1 = S2; S2 = not (S1);

Which one of the properties of the critical section is achieved? (4 Marks)

Q.No.4 (CLO_1):(Cognitive Level C2, i.e., Understanding)(PLO_1: Engineering Knowledge)


(10 Marks)
(a) Answer the following questions and defend your arguments with suitable examples.
i. Why might we prefer multithreading over multiprocessing if both are reasonably good options?
ii. Why might we prefer multiprocessing over multithreading if both are reasonably good options?
iii. Threads are often called lightweight processes. In what sense are they processes?
iv. What happens if a thread within a larger process calls fork() or execvp()?
v. Consider a counting semaphore was set to 12. And 6 wait operations and 4 signal operations
were concluded on this semaphore. What will be the resulting value of the semaphore?
(05 arks)

SSUET Page 2 of 3
Online End Semester Examinations: Spring 2021

Sir Syed University of Engineering & Technology


Faculty of Electrical and Computer Engineering
Department of Computer Engineering

(b) Suppose the following snapshot of the system has five processes (P1, P2, P3, P4 and P5)
and four types of resources (A, B, C and D). There are multiple resources of each type. Is
the following state safe or not? Calculate the Need matrix and estimate the sequence in
which processes can complete execution. If not, show how deadlock may occur.
(05 Marks)

Processes Allocation Maximum Resource


Available
A B C D A B C D A B C D
P1 1 0 2 0 3 2 4 2 3 4 0 1
P2 0 3 1 2 3 5 1 2
P3 2 4 5 1 2 7 7 5
P4 3 0 0 6 5 5 0 8
P5 4 2 1 3 6 2 1 4
Q.No.5 (CLO_3):(Cognitive Level C3, i.e., Applying)(PLO_5: Modern Tool Usage) (10 Marks)

(a) Show the output of the following program (05 Marks)


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>

int main () {
int n, status;
pid_t child;
n = 0;
if (!(child = fork())) {
n = 1;
fprintf (stderr, "n = %d\n", n);
n = 2;
} else {
n = 3;
fprintf (stderr, "n = %d\n", n);
n = 4;
exit (0);
fprintf (stderr, "n = %d\n", n);
}
waitpid (child, &status, 0);
n = 5;
fprintf (stderr, "n = %d\n", n);
return 0;
}

(b) With the help of appropriate programming examples and system calls, demonstrate how Inter-
process Communication is performed using pipe() in Linux Operating System. (05 Marks)
(Your answer should not be copied from other students. It will result in 0 marks)

(END)

SSUET Page 3 of 3

You might also like