操作系统代写|CS代写|编程代写

Operating System - Final Exam


1. OS Concepts

(a) A lab has one server with 64 processor cores and 256GB RAM for researchers to run experiments that may require up to 8 cores and 64GB RAM. The lab manager has scheduled individual researchers to use the machine exclusively for a fixed period. Is this the best approach? Justify your answer and explain alternate approaches that could be used. Prepare a case to persuade the lab manager that your approach is better. 

(b) Which type of virtualized services available on the cloud would you recommend for the following two scenarios and why?

(i) A company hosts an e-commerce website on its internal servers. However, there is insufficient capacity to handle the number of user requests during certain times of the year, and the company needs to hire servers during this time. 

(ii) A start-up company must process millions of transactions for a software product they are developing. They do not have the budget to make upfront investments for setting up their in-house scalable database to process the transactions. 

(c) Three protection mechanisms discussed in class are:

• dual-mode operation

• hardware interrupts

• memory protection

Briefly summarize the benefits of these protection mechanisms in a modern mobile OS like Android or iOS.

For each of the three protection mechanisms, explain which part of the process is performed by the OS, and which by the hardware.

Show (using an example) for each of the three protection mechanisms how absence of that mechanism could result in a malicious program disrupting the operation of the kernel. Please note that this question is not about disrupting other user-space processes but about disrupting the OS.


2. Filesystems

(a) A hard disk has the following queue of disk cylinders to be accessed:

[129, 94, 69, 55, 162, 52, 74]

Assume a disk cylinder range of 0-199, with the head starting at 60. Give the order of access under both a Shortest Seek Time First (SSTF) and LOOK schedule (assume the disk head is currently moving up). Which of the above disk scheduling methods provides the least disk head movement?

(b) Explain the linked allocation and indexed allocation schemes for file data blocks.

(c) Assume there are 64 data blocks in a disk and each block is 512 bytes. Answer the following and explain any assumptions made:

(i) What is the total disk size required by the pointers in the linked allocation scheme? 

(ii) A file is stored using the linked allocation scheme in the following sequence of block addresses 12, 17, 45, 9, 55, 3. Data from block address 55 needs to be read. What is the time overhead in reading this data if 4ms is required for the disk head to access a block? Provide justification for your answer. 

(iii) What is the size of the index block for the above sequence of block addresses? Provide justification for your answer. 

(iv) How many blocks can be addressed by an index block? Based on your answer, explain whether your file system has a good design. 

(d) A RAID system has 5 disks, each with 100 GiB of storage.

(i) How much disk space is available to the user for storing data on both the entire system and each disk in both RAID 4 and RAID 5? Provide any justification for your answers. 

(ii) Describe scenarios in which RAID 6 would be preferable to RAID 5 and provide any justification. 


3. Virtual Memory

(a) A PC has three storage devices that can be used for swap space. Due to the difference in their speeds, servicing a page fault will take a different amount of time depending on which device is used. The devices are:

(i) A magnetic hard disk with a page fault service time of 8ms;

(ii) A solid-state drive with a page fault service time of 2ms; and

(iii) A USB memory stick with a page fault service time of 20ms.

Memory access time (MA) for accessing RAM on this machine is 250ns. For each of the three cases above, calculate the page fault rate required to keep the slowdown caused by swapping to less than 80%. Make sure to include your calculation and reasoning in your answers.


咨询 Alpha 小助手,获取更多课业帮助。