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


July 2021 Resit Exam

5004CEM

Operating Systems and Security


1

a)

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

(6 Marks)

Explain why you feel these roles are important.

(3 Marks)

b)

i) Given the file directory structure below.  If you are in the Flu subdirectory where there is a file called infections_levels.txt, what Linux command would you use to move the infections_levels.txt to the Vaccine subdirectory.

(3 Marks)


ii) How many pipes and processes are used as a result of the following Linux command?  What does the command do?

ps aux | grep ab0487 | wc -l

(5 marks)

c)

Describe the overall steps the operating system takes to handle an interrupt.

(8 Marks)

2.

a)

Operating system schedulers are said to be either preemptive or non-preemptive. Describe the main differences between preemptive and non-preemptive schedulers.

(4 marks)

State the main problem with non-preemptive scheduling and how preemptive scheduling overcomes this.

(4 Marks)

b)

What is a time slice?

(2 marks)

Describe how the size of the time slice can influence the performance of a computer system.

(6 Marks)

c)

Given the following processes and burst times.

Process Number

Burst time

P1

12

P2

4

P3

5

P4

6

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 4.  Which approach gives the lowest average waiting time?

(9 marks)


3.

a)

Describe what the assembly code below does.  You should say what the output is and how this output is achieved. Outline how the interrupt (int 80h) works in assembly code.

section .bss

num resb 1

section .text

global _start

_start

mov ecx,9

mov eax, '9'

mov [num], eax

call print

looping:

mov eax, [num]

sub eax,'0'

dec  eax

add eax,'0'

mov [num],eax

call print

mov eax, [num]

sub eax,'0'

cmp eax,0

jne looping

call quit

print:

mov eax, 4

mov ebx, 1

mov ecx,num

mov edx,1

int 80h

ret

quit:

mov eax,1

mov ebx,0

int 80h

(9 marks)

b)

Consider the following C-code statement:

readfile = read(fd, buffer, size);

Describe what is stored in fd, buffer and size.

(4 marks)

c)

Outline what are microkernels and macrokernels.

Consider what can be learned from microkernel and macrokernel, so we can create an operating system kernel that overcomes their weakness but benefits from their strengths.

(4 Marks)

(8 marks)


4.

a)

How does virtual memory differ from physical memory?

(3 Marks)

Examine how the operating system is able to map the virtual memory on to the physical memory.

(4 Marks)

b)

A computer has 3-page frame spaces in RAM.

A process makes the following page references

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

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?

(8 Marks)

(1 Mark)

c)

Consider why the operating system makes use of user and kernel modes.

(3 Marks)

Why is it dangerous to allow an application to run in kernel mode?

(2 Marks)

d)

Outline when using a cache would have a negative impact on the performance of a computer system.

(4 Marks)


5.

a)

i) Describe the main similarities and differences between access control lists and capabilities lists.

(2 Marks)

Which of these would you recommend to use to protect your computer system resources?

(6 Marks)

ii) As the security expert at a company, the manager would like you to explain to her about the different categories of authentication to control access to system resources. You should offer real-world examples of these categories.

(8 Marks)

b)

What is a system call?

(2 Marks)

The getid() system call is made from a C-program, outline the steps that occur from the running of this system call to displaying the process ID.

(7 Marks)


6.

a)

i) Explain the meaning of mutex in threads.

(3 Marks)

How does  mutex maintain data integrity?

(3 Marks)

ii) Discuss the main differences between threads and processes.

(6 Marks)

b)

Interprocess communication is critical for the successful running of modern computer system.  Explain what is interprocess communication?

(2 Marks)

Compare how this is achieved using shared memory and signals.

(4 Marks)

Describe which of the two approaches you would use and why.

(2 Marks)

c)

What is the race condition in multi-processing systems?

(3 Marks)

Describe one way in which it can have a negative impact on the application running.

(2 Marks)