Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

December 2020


5004CEM 

Operating Systems and Security


1

 

a)

 

 

Describe three main applications that are performed by the operating system.  

(6 Marks)

 

 


 

 

 

Explain why you feel these functions are important.  

  (3 Marks)

 

 

 b)


List the states that the processes can be in.  

(5 Marks)

 

 

 

Select two of the states and give two reason indicating why a process would move from one state to the other.  

(4 Marks)

 

 

c)

 

 

 

Multi-programming enables multiple processes to appear to run at the same time.  How is this achieved on a single CPU?

(3 Marks)

 

 

 

How does multi-programming differ from multi-tasking?

(4 Marks)

 

2.

a)

Consider a single CPU system supporting two running processes, P1 and P2, with the following multi-programming execution behaviour:

P1: [CPU 8ms; IO 3ms; CPU 8ms; IO 3ms; CPU 8ms]

P2: [CPU 4ms; IO 4ms; CPU 3ms; IO 2ms; CPU 3ms]

 

i) What is the CPU IO burst cycle?  

Explain what it means when a process is said to be CPU bound.  

Describe what you could do to improve the performance of a CPU bound process.

 

 

 

 

 

 

 

(3 Marks)

(3 Marks)

 

(2 marks)

 

 

 

 

 

b)

ii) Calculate the elapsed time for the two processes to run to completion.

 

What is a preemptive process?  For preemptive processes, how does the operating system determine when a process should be removed from the CPU.

 

 

(4 marks)

 

 

 

(4 marks)

 

c)

Given the following processes and burst times.

Process Number

Burst time

P1

11

P2

12

P3

5

P4

7

P5

9

 

Calculate the average waiting time and average turnaround time for the Shortest-Job-First Scheduling approach and the Round-Robin approach with a quantum of 3.  

Which approach gives the lowest average waiting time?


 

 

 

 

 

 

 

 

 

 

 

(9 Marks)

 

3.

a)

What is the role of the fork() function in the Linux operating system?  

Describe how the return values of the fork() allow the child and parent processes to perform different activities.  

 

 

(2 Marks)

 

(4 Marks)

 

b)

i) What is the possible output of the following fork code written in C?

 

#include <stdio.h>

#include <sys/types.h>

#include <unistd.h>

int main(){

char ch;

int pid;

printf("%d\n", value);

for(ch='z'; ch>='x'; ch--){

pid=fork();

        if(pid == 0){

          printf("%c\n", ch);

}

          if(pid != 0){   

printf("%c\n", ch);

}

}

}

 

 

(7 Marks)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

c)

ii) Why is it not possible to say exactly the order of the output  above.

 

Describe what is involved when a C-program makes a system call from the point when the C function is call to when the function returns.  

 

(4 Marks)

 

 

 

(8 marks)

 

4.

a)

 

Why does the memory management component of the operating system make use of pages to run processes?  

 

(4 Marks)

 

 

Describe what happens when a process requests a page and it is not in RAM memory.

   (6 Marks)

 

 

b)

 

A computer has 3-page frame spaces in RAM.  

A process makes the following page references

1, 2, 4, 1, 2, 4, 3, 1, 4, 5, 8, 2, 8, 5, 6, 2.  

 

Create the page frame tables for the first-in-first-out replacement approach and least-recently-used replacement approach, and the calculate the number of page faults.  Which approach gives the best performance?  

 

 

 

 

 

 

 

 

 

 

(9 Marks)

 

 

c)

What is page thrashing and what can the operating system do to prevent it from happening?

 

(6 marks)

 



5.

a)

i) List three items of metadata that you might find in an inode.  Explain why this information is stored.  

 (6 Marks)

 

 

 

ii) Describe why the inode stores data in direct blocks.

(5 Marks)

 

 

b)

 

 Examine the role of the private and public keys in cryptography?  

(2 Marks)

 

 

You should indicate how their use can ensure that the data is sent in a secure manner.

(6 Marks)

 

 

c)

 

Describe the CIA triad model for maintaining security.

(6 Marks)

 

 


6.

a)

 

Inter-Process Communication (IPC) requires that two processes share information directly. Compare signals and shared memory in terms of how they aid IPC.   

(6 Marks)

 

 

When would you recommend using these different approaches?

(3 Marks)

 

 

b)

 

Discuss the main differences between threads and processes.

(6 Marks)

 

 

c)

 

Define the race condition in multi-processes.  How does this differ from deadlock?

(4 Marks)

 

 

d)

 

What is the consumer/producer problem?  

(3 Marks)

 

 

Outline a mechanism that can be used to aid the solution to this problem.

(3 Marks)