0 ratings0% found this document useful (0 votes) 16 views6 pagesUecs2403 September2019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
UNIVERSITI TUNKU ABDUL RAHMAN
ACADEMIC YEAR 2019/2020
SEPTEMBER EXAMINATION
SATURDAY, 14 SEPTEMBER 2019 TIME : 2.00 PM — 4.00 PM (2 HOl
S)
BACHELOR OF SCIENCE (HONS) APPLIED MATHEMATICS WITH COMPUTING.
BACHELOR OF ENGINEERING (HONOURS) ELECTRONICS (COMPUTER
NETWORKING)
BACHELOR OF SCIENCE (HONS) SOFTWARE ENGINEERING
Instructions to Candidates:
This question paper consists of FOUR (4) questions in Section A and TWO (2) questions in
Section B.
Answer ALL questions in Section A and ONLY ONE (1) question in Seetion B.
Should a candidate answer more than ONE (1) question in Section B, marks will only be
awarded for the FIRST question in that section in the order the candidate submits the answers.
Each question carries 20 marks.
Candidates are allowed to use calculator.
Answer questions only in the answer booklet provided.
This question paper consists of 6 questions on 6 printed pagu
103)
Section A: Answer ALL questions.
Ql. @
()
©
Process Y contains two threads. The current states of the process and its threads
are as follow:
Process Y: Running
Thread 1: Running
Thread 2: Ready
Determine the state transitions of process Y and threads 1 and 2 when Thread
1 issues a system call if,
())_—_ Kernel-level threads were implemented. (3 marks)
(ii) User-level threads were implemented. G marks)
An analysis shows that a program contains 12% of sequential section,
Determine the speedup that can be achieved if the program could be executed
on 4 processors based on Amdahl’s law. Round up your answer to 3 decimal
places. (4 marks)
Apply the Round Robin (q = 3) scheduling algorithm to schedule the execution
of the processes in Table 1. Show the execution of the processes in a time line.
(10 marks)
Process | Arrival Time | Service Time
[lA 2 4 |
a, 0 | 6
c_ | 10 4 4
i) 6 5
E 9 4
Table I
[Total : 20 marks]
This question paper consists of 6 questions on 6 printed pages.UECS2103/U)
@ @
(b)
@. a)
()
“$2403/UECS2423 OPERATING SYSTE!
A virtual hard disk in a virtual machine is a file that simulates the physical hard
disk.
(i) Discuss the impact of the contiguous block allocation to the virtual
machine performance in terms of seeking time during the start-up of a
virtual machine. (6 marks)
(ii) Discuss the impact of the individual block allocation to the virtual
machine performance in terms of data storing time and seeking time
while user is downloading huge amount of data in the virtual machine.
(6 marks)
A disk is divided into tracks, and tracks are divided into blocks. Discuss the
effect of block size on
(i) waste per track. (4 marks)
(4 marks)
{Total : 20 marks}
(ii) seeking
A process is allocated THREE (3) empty page frames and the page requests are
in the following order:
2,10.
4,2,3,5,6,5,2.1
Apply the Least Recently Used replacement policy in fetching the requested
pages and show the successive pages residing in the page frames. (10 marks)
Given that IMB (1024KB) of memory is available, allocate the memory to the
requests in Table 2 by applying the buddy system approach. (10 marks)
[ Process | Request
[A [100 KB
|B __| 120 KB]
Cc | S0KB/
(p_[200kB |
E 16 KB
F__| 60KB|
Table 2
[Total : 20 marks]
This question paper consists of 6 questions on 6 printed pages.Adam is a salesperson who needs to meet clients at different locations. He carries a
laptop that contains all necessary information and data. In order to protect the
information and data in his laptop, he has configured a strong password for his account
He is travelling most of the time and usually has a tight schedule to meet with his clients.
‘Thus, his laptop must be ready to be used in the shortest time and for that reason he has
disabled all the application auto update features and the hard disk encryption feature.
He also uses free Wi-Fi provided by restaurants, malls or cafes while meeting with
clients. Occasionally, he needs to copy files from clients through external storage,
(a) Identify TWO (2) possible security threats in the above scenario and briefly
discuss FOUR (4) relevant consequences in | or 2 sentences. (10 marks)
(b) Propose FIVE (5) strategies to improve the protection or reduce the security
threats. (10 marks)
[Total : 20 marks]
This question paper consists of 6 questions on 6 printed pages.(b)
5
$2423 OPERATING SYSTEMS
1
Table 3 shows the total resources required by each process and the current
allocated resources at a particular time, Available units of resources R1, R2, R3
and R4 in the system are 7, 8, 6 and 6 respectively. Apply the Banker’s
algorithm to determine the state of the system. State the resources needed by
cach process and the resources available in every stage of calculations.
(12 marks)
Total Required] {Currently Allocated]
Process RT| |
Pi [ala
p2_ [1 [ol |
p3_[els[4 |
pa [3 [4[3
ps_[6[7[7
Table 3
‘Table 4 shows the current allocation of resources to each process, the resources
that are still needed by each process to proceed with their execution; and the
number of lines of output produced so far.
All the processes are deadlocked as the resources available are R1 = 1, R2 = 0,
R3 = 1 and R4 = 1. Resolve the deadlock by using the following strategy.
Successively abort deadlocked processes with the least number of lines of
output produced until the deadlock no longer exists. Show the resources
available after each abortion in your workings. (8 marks)
Allocated Needed Lines of
Process /R1/R2/R3|R4) [RI[R2/R3[R4) | output
A _jo[tf2{r] [3/2]2/4] [ #2
B [tft 2[5} [100
efit fayz} [3538]
D i1i3 3[3] (74
{Total : 20 marks}
‘This question paper consists of 6 qu
stions on 6 printed pages.(b)
6
ATING SYST]
Partial pseudo codes of two processes are given in Table 5.
[ Semaphore
Pl —CO«dS CR
ei]: A -
@2| semait(a); [semvait(a);
@3| // critical section semWait(n);
(@4|_semSignal(n); - // critical section
@5| semSignal(a); | semSignal (a); |
a6]: :
@
(i)
Table 5
Briefly explain how a problem could occur if process P2 was executed
before process PI. (3 marks)
Given that P2 must perform wait operation on semaphores a and n in
the appropriate sequence before its critical section, rewrite the pseudo
code for P2 (line 02 — 05) to avoid the problem stated in your answer in
part Q6(ay(i). (2 marks)
Figure 1 shows the operation of an application, The Parser will read from an
input file and store the content to the Buffer if it is empty. Otherwise the
Parser has to wait until the Buffer is empty. When Buffer is full, the
Translator will read the content stored in Buffer and then empty it. It will
then translate the content and store the translation to an output file. The
Translator must not read from Buffer if it is empty, it has to wait until
Parser has written the content to Buffer.
@
(ii)
Gi)
vy
Parser }-+{Bufer jo Transiator | »{Output Fi
Figure |
Determine the number of semaphores need to control the access to
Buffer, prevent reading from empty Buffer, and writing to full
Buffer, (2 marks)
Initialise the necessary semaphores, based on answer in part Q6(b)(i),
with appropriate values, You should use meaningful names for the
semaphores. (3 marks)
Write the pseudo code for Parser. Assume that read_file() will
read the input file and write_buffer() will write the content from
input file to Buffer. (5 marks)
Write the pseudo code for Translator. Assume that read_buffer()
will read from Buffer and write_output() will write the translation
to the output file (5 marks)
{Total : 20 marks}
This question paper consists of 6 questions on 6 printed pages.