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

August 2020

5004CEM 

Operating Systems and Security

1      a)     i) Identify three of the major services provided by a         modern operating system and indicate the impact on the computer system if these are not available.

ii) Draw the five-state process model. Describe what transitions are valid between the five states.

Choose any two of states that are connected and give two reasons why the process moves from the first state to the second state.

b)     i) What is an interrupt?  Describe the role of interrupts in an operating system.

ii) Describe the series of steps that occur when an IO interrupt occurs.

2.     a)   Your colleague has invented a new scheduling algorithm and is seeking your advice on the algorithm. The scheduling          algorithm uses two queues: queue one is for new processes   and queue two is for old processes.  When a process enters   the system, the operating system allocates it to the end of      queue one. If any new process is on queue one longer than    50ms, it is transferred to the end of queue two.  The operating system will only deal with processes on queue two once there are no longer processes on queue one.

i) Does this algorithm give higher priority to one queue over another?

ii) Is it likely that any processes will suffer starvation?

iii) Discuss whether this algorithm is fair to all processes.

b)   What are the differences between multitasking and multiprogramming?

c)    Given the following processes and burst times.

Process Number

Burst time

P1

12

P2

4

P3

11

P4

6

Calculate the average waiting time and average turnaround time for the First-Come-First-Served Scheduling approach   and the Round-Robin approach with a quantum of 3.  Which approach gives the lowest average waiting time?

3       a)   Write a small piece of c-code to create the following process forking behaviour?  Each process should print “This is multi- processing” and its process id.

 

Process P1

 

 

 

Process C1

 

 

 

Process C1

 

b)     Examine the following code:

//Program to print date and

// then to ping www.coventry.ac.uk.

int main(){

int pid=fork();

if(pid!=0){

printf("Wait on child proc \n");

wait();

printf("Done.\n");

}else{

sleep(1);

execl("/bin/date", "date", 0, (char*) NULL); execl ("/bin/ping","ping","-c", "5",

"www.coventry.ac.uk", (char*) NULL);

}

return 0;

}

i) The code compiles and executes, but it does not do what was intended.  What does it actually do?

ii) Adapt the code so it performs as intended.

c)     What is a thread?

How does it differ from a process?

4.     a)

How does virtual memory differ from physical memory? Describe how the operating system maps the virtual

memory to the physical memory.

b)     A computer has 3-page frame spaces in RAM.  A process makes the following page references 1, 2, 6, 8, 1, 2, 3, 1, 3, 5, 4, 5, 8.

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

c)      In memory management what is the role of cache memory?

How  do  cache  misses  influence  the  performance  of the computer system? Describe an approach to reduce cache

misses.

5.   a)   Describe the possible impact of not checking the length of the data that is being put in a buffer.  How can not             checking the length of data being put into the buffer be

exploited?                                                                                          (6 Marks)

b)   i) Describe the common access control method of access control lists (ACL). Give an example how it is applied in a Linux environment.

ii) I have created a webpage and I am about to make it    accessible to the world.  My friend says I need to set the  file permissions.  Explain what file permissions are?  Why they are important in the context of my webpage?  How I set the permissions and what they should be.

c)   Give two pieces of information found in a File Control       Block (FCB). Explain the reason for this information being

stored?

6.   a)   i) Why is it important for application programmers to know the system calls offered by the operating system?

ii) A kill system call is sent to a process.  Describe the steps that the operating system follows to kill the process.

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

Compare how this is achieved using shared memory and pipes. Describe which of the two approaches you would use and why.

c)   What is the race condition?  How does this differ from deadlock? Consider which has the most negative impact on the computer

systems?