Sei sulla pagina 1di 5

EKT 333 Operating System

Assignment 1
Semester 2 2014/2015 (30th March 2015)
[C3, CO1, PO2]
1.

Suppose the hypothetical processor as shown in the following figure has


two I/O operations: [6 Marks]

AC: Accumulator
0011 = Load AC from I/O
0111 = Store AC to I/O
In these cases, the 12-bit address identifies a particular external device. Show
the program execution (using format from Figure 1.4) for the
following program.
1. Load AC from device 5
2. Add contents of memory location 940
3. Store AC to device 6.
Also assume that the next value retrieved from device 5 is 3 and that location
940 contains value of 2.

[C2, CO1, PO2, PO11]


2.

Explain the distinction between a real address and a virtual address. [4


Marks]
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____

[C4, CO1, PO2]


3.

In a CPU, cache access time is 500ns and main memory access time is 2
s. If a block is found, on average, 90% of the time in cache, calculate the
average access time. [5 Marks]

[C2, CO3, PO2]


4. The following state-transition table is a simplified model of process
management, with labels representing transitions between states of READY,
RUN, BLOCKED and NONRESIDENT. Assume that at time 5, no system resources
are being used except for the processor and memory. [15 Marks]

Now consider the following events:


At time 5: P1 executes a command to read from disk unit 3
At time 15: P5's time slice expires
At time 18: P7 executes a command to write to disk unit 3
At time 20: P3 executes a command to read from disk unit 2
At time 24: P5 executes a command to write to disk unit 3
At time 28: P5 is swapped out
At time 33: An interrupt occurs at disk unit 2: P3's read is complete
At time 36: An interrupt occurs at disk unit 3: P1's read is complete
At time 38: P8 terminates
At time 40: An interrupt occurs at disk unit 3: P5's read is complete
At time 44: P5 is swapped back in
At time 48: An interrupt occurs at disk unit 3: P7's read is complete
For each time 22, 37 and 47, identify which state each process is in. If a
process is blocked, further identify the event on which it is blocked.
T = 22: P5, P8 ready/running
P1, P3, P7: blocked for I/O
T = 37: P1, P3, P8: ready/running
P5: blocked suspend (swapped out)
P7: blocked for I/O
T = 47: P1, P3, P5 ready/running

P7: blocked for I/O


P8: exit

[C2, CO1, PO11]


5.

Explain why a process needs to issue a SemWait(s) and SemSignal(s)


when entering a critical section. [5 Marks]
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
______

[C4, CO3, PO2]


6.

Compare the THREE (3) basic steps of counting and binary semaphore. [5
Marks]
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
_________

[C6, CO3, PO2, PO11]


7.

Justify TWO (2) reasons why ULTs are better than the KLTs. [5 Marks]

____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
_______
[C2, C6, CO2, PO3, PO11]
8. Consider the following codes:

a) Identify the main problem in this code. [2 Marks]


b) Justify why the identified problem in (b) can lead to a serious issue that can
jeopardize the entire performance? [3 Marks]

Potrebbero piacerti anche