Simplistically, the operating system kernel is just a computer program, one that manages the hardware and allows the user to perform tasks on a computerised device. When considering other computer programs such as word processors, text/code editors, and so on, it is possible to substitute one program with another of the same type to achieve the same task, e.g., you could substitute Microsoft Word with Apple Pages or LibreOffice Writer. Identify whether or not it is possible to substitute the operating system kernel in the same way. Explain why this was / was not possible. b) Consider the following table of processes:
Process Arrival Duration A 0 6 B 1 3 C 2 2 D 3 5 E 4 4
Draw diagrams to illustrate the execution of these processes using the following CPU scheduling algorithms: FCFS, SJF, SRTN, and RR. Calculate the wait time and turnaround time for each process. For Round Robin, use a timeslice of two and if a process arrives at a time index when a context switch occurs the arriving process is added to the ready queue after the running process. Note: wait time is the total time spent by the process waiting in the ready queue, i.e., the process is ready to run but the CPU is being used by another process. c) CPU scheduling algorithms tend to favour I/O bound processes instead of CPU bound processes. The main reason for this is because it results in better utilisation of the computer’s hardware. i) Given that the main work done by a computer is done by the processor, explain why favouring CPU bound processes (which primarily use the processor) does not result in better utilisation of the computer’s hardware. ii) The Round Robin algorithm does not favour I/O bound processes. Explain why, and what changes could be made to fix this problem.
Question 2 (12 + 8 + 10 = 30 marks)
a) The use of a memory abstraction provides several benefits, however also introduces overheads that are not incurred when using physical memory addressing. Such overheads can occur (1) when the process is reading or writing to memory; and (2) for operations performed on the process itself (such as a system call). For each category, explain why these overheads occur and how it is possible to reduce and/or eliminate the overheads entirely. If it is not possible to reduce or eliminate the overheads, explain why. For (2), consider the system call to terminate a process. b) Operating systems can perform memory management using either variable sized allocations, e.g., contiguous memory allocation, which allows the operating system to see and manage free regions of memory, or fixed size allocations, e.g., pages, where the operating system is unable to see the free regions of memory. For an operating system’s perspective of these two approaches, identify which of these approaches will be the most efficient in terms of (i) minimum computation (when allocating/de-allocating memory), and (ii) minimum wastage of memory. For each case, explain why. c) In modern paging-based memory management systems, it would be possible for a process to access a page in its virtual address space that is loaded into a physical page frame, however a page fault could still occur. Explain the basics of how paging works and how page faults work as the foundation to your answer, then explain why it would be possible for a page fault to occur for a page already loaded in memory (see marking scheme for further information).
Question 3 (40 marks)
Consider the following scenario. You are working for a company attempting to develop the next generation of mobile phone. Recently, the project lead indicated their disappointment with the performance/responsiveness of the device and proposed to use static relocation to allow processes to access memory directly, improving performance. To minimise the overhead of static reloading, the project manager suggested writing the modified executables to storage for reuse the next time the program is loaded. When the project lead proposed this during the last project meeting, you indicated that this was not a viable solution. You also highlighted how one process would have the ability to read and write the memory of other processes on the system. The project lead has now sent you an email asking for your input on how to proceed:
From: [email protected] To: <your name here> Subject: Mobile OSes and Static Relocation
Hi <your name here>,
I wanted to follow-up on the discussions we had at the last project meeting, where you recommended against proceeding with my proposal to use static relocation for memory management on our new mobile platform. Given the limited time we had during the meeting I’m not convinced I understood what you were saying properly
After further investigation, I am still convinced this would be the best approach. Whilst I understand that using protected memory approaches are commonplace in computing today, I also recognise that using static relocation and the performance benefits achievable using that approach could represent a significant competitive advantage for us. I understand the security concerns you raised, however I believe we can develop our app certification program to ensure this would not be an issue.
Can you please explain your concerns to me again and provide your recommendation on how we should proceed?
Hint: From the information above, in your response you will need to explain how static relocation works, how processes use physical memory addressing, how one process can read/write the memory of the other processes, and why this represents a security problem. Given that this will be a more detailed response than comments you supposedly made at the meeting, you should expand on these issues and may introduce any additional additional issues you feel are relevant. Your response should be approximately two pages in length.
Question 1 (6 + 12 + 12 = 30 marks)
ï‚· Part (a) o (2 marks) Correctly identifies that it is OR it is not possible. o