Candidate Number
THE UNIVERSITY OF SUSSEX
BSc and MComp SECOND YEAR EXAMINATION May/June 2019 (A2)
Operating Systems Assessment Period: May/June 2019 (A2)
G6059
DO NOT TURN OVER UNTIL INSTRUCTED TO BY THE LEAD INVIGILATOR
Candidates should answer TWO questions out of THREE.
If all three questions are attempted only the first two answers will be marked.
The time allowed is TWO hours. Each question is worth 50 marks.
At the end of the examination the question paper and any answer books/answer sheets, used or unused, will be collected from you before you leave the examination room.
G6059 Operating Systems
1. Files and file systems
a) Describe the basic characteristics of the file abstraction that is provided by many operating systems and name the general duties that operating
systems usually have with respect to handling files.
b) Many operating systems maintain a data structure that is called the open
file table (OFT). Explain its purpose and basic functionality.
[5 marks]
[10 marks]
c) Describeanythreedifferentsystemcallsthatanoperatingsystemmust provide to perform operations on files. For each, explain what the operating system actually does when performing those operations.
[20 marks]
d) Consider an i-node with 12 direct block pointers and one (single-) indirect block pointer. Each block pointer has 8 bytes and the data block size is 512 KB.
i. What is the maximum file size supported by this i-node?
ii. How would the maximum file size change if the same i-node had one
additional double-indirect block pointer?
[15 marks]
2
G6059 Operating Systems
2. Memory management
a) Consider a logical address space of 64 pages of 1024 words each, mapped onto a physical memory of 32 frames.
i. How many bits are there in the logical address?
ii. How many bits are there in the physical address?
[10 marks]
b) What is the main advantage of a multi-level page table over a single-level
page table? Explain.
[10 marks]
c) Inonesentence,describethebasiceventthatcausesapagefault.
[6 marks]
d) Consider the following page reference string:
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.
How many page faults would occur for the following replacement algorithms in a system with four frames? Remember all frames are initially empty, so your first unique pages will all cost one fault each.
i. LRU replacement
ii. FIFO replacement
iii. Optimal replacement
[24 marks]
/ Turn over
3
G6059 Operating Systems
3. Processes and threads
a) Explainthebasiccharacteristicsofprocessesandthreads.Whydoesit
make sense to have both?
b) What resources are needed when a thread is created? How do these
resources differ from those used when a process is created?
[6 marks]
[8 marks]
c) Explainthedifferencebetweenuserthreadsandkernelthreads. [8marks]
d) Consider the following snapshot of a system with multiple processes (P0 to
P4) and resources (A, B, C, D):
Applying the banker¡¯s algorithm, answer the following questions:
i. What does the current Need matrix look like for this system?
ii. Is this system in a safe state?
iii. If a request from process P1 arrives for (0,4,2,0), can this request
be serviced straightaway? If yes, state the order in which processes
can execute. If no, explain why not.
[20 marks]
e) Namethefourdifferentreasonswhyaprocessmightterminateandgive
an example for each.
[8 marks]
End of paper
4