操作系统分页分析代写 CS3104代写 Operating Systems代写
403CS3104 – Operating Systems 操作系统分页分析代写 Aim / Learning objectives The purpose of this assignment is three-fold: to provide insight into a real paging architecture; Assignment: P2 –...
View detailsSearch the whole station
操作系统期末代考 Duration: 3 hours Do not turn this page until you have received the signal to start. In the meantime, please read carefully every reminder
Duration: 3 hours
Do not turn this page until you have received the signal to start. In the meantime, please read carefully every reminder on this page.
TRUE FALSE A context switch from one process to another can be accomplished without executing OS code in kernel mode.
TRUE FALSE In round robin scheduling, it is advantageous to give each I/O bound process a longer quantum than each CPU-bound process (since this has the effect of giving the I/O bound process a higher priority).
TRUE FALSE Code that uses semaphores for synchronization can correctly be rewritten using semaphores and code that uses condition variables for synchronization can correctly be rewritten to use semaphores.
TRUE FALSE A TLB miss always results in a page being swapped in from disk.
TRUE FALSE A major fault results in a page being swapped in from disk.
TRUE FALSE Paged memory suffers from internal fragmentation.
TRUE FALSE A page that has just been brought into physical memory from the swap should have its dirty bit set.
TRUE FALSE In the ext2 file system, we could use a binary search to find a directory entry within a directory if the entries were sorted.
TRUE FALSE A hard link is just an entry in a directory
TRUE FALSE If a system is using a Journaling File System, that means that when a program returns from a write statement, we are guaranteed that the file is updated on disk.
1.Which of the following components are shared between threads in a multithreaded process? (Check all that apply)
2.The program xxd outputs the byte sequencei eca1 0455. This sequence represents an integer in little-endian byte order. Which of the following shows the integer in “normaln order (big-endian)? (Check one)
xxd outputs the following sequence of bytes: 6566 5768. What string does it represent? (Check one) (Relevant ASCII values: i8i = 56i igi = 57i iAi = 65i iBi = 66i ini = 68i iKi = 75i iv = 76i iyi = 86)
4.The copy-on-write mechanism provides: (Check all that apply)
5.Implementing LRU precisely in an OS is expensivei so practical implementations use an algorithm that approximates LRU called: (Check one)
For two processes accessing a shared variable, Peterson’s algorithm provides (Check all that apply):
7.In assignment 4, ext2 _rm was implemented to minimize changes to the inode and deleted directory entry. This allowed you to write a program to recover deleted files or directories. Check all the boxes below that are true statements.
8.Which of the following are stored in an ext2 inode? (Check all that apply)
When adding a new block to a file, which of the following data structures need to be written to disk to complete the operation. (Check all that apply)
10.When adding a new block to a file, which of the following data structures should be written to disk last to minimize file system inconsistency in the event of a crash? (Check one)
Part (a) [2 MARKS]
Why must the operating system be more careful when accessing input to a system call when the data is in memory instead of registers?
Part (b) [l MARK]
What crucial piece of information does the banker’s algorithm need to be able to avoid deadlock?
Part (c) [1 MARK]
In the traffic intersection problem in A2, what strategy was used to prevent deadlock? Be specific.
Part (d) [3 MARKS]
CLOCK is an approximation of LRU. Describe a scenario where the accuracy of CLOCK would suffer.
Part (e) [4 MARKS]
One of the themes of the course was virtualization. Identify three contexts in which virtualization was used as a solution technique. Briefly discuss the technical issues involved, and the benefits of the virtualization approach to the problem.
Part (a) [1 MARK]
What are the three main states that a process can be in?
Part {b) [4 MARKS]
December 2018 Assume you have a single CPU and three processes (X, Y, and Z). Process X has the highest priority, process Z has the lowest, and Y is in the middle. Assume a priority-based pre-emptive scheduler. Given the following cumulative timeline of process behavior, indicate the state the specified process is in after that step, and all preceding steps, have taken place. Assume the scheduler has reacted to the specified workload change.
Consider a multi-level feedback queue scheduler where the first two rules are specified below. (A and Bare processes.)
Part (a) [6 MARKS]
For each of the questions below, define a new rule that will address the question.
i- [2 MARKS] In which queue should a job start when it enters the system?
ii- [2 MARKS] What event causes a job to move to a lower-priority queue?
iii- [2 MARKS] How does the algorithm prevent starvation?
Part (b) [2 MARKS]
What type of processes are given priority? Explain why.
Imagine a help centre with 4 seats. If you arrive while there is an empty seat, you can take a seat immediately. But if you arrive when all 4 seats are full, that means that all of students there are getting help for the same problem, and you will have to wait for all 4 to leave before you sit down.
Part (a) [3 MARKS]
Explain clearly why the code on the next page does not solve the problem. Use a concrete example to aid your explanation.
Part (b) [7 MARKS J
Without using any more semaphores or adding any more variables, rewrite the code below to provide a correct solution to the help centre. You may assume that the variables and semaphores are declared and initialized as in the provided code.
// INCORRECT SOLUTION //Global variables static struct semaphore *mutex; static struct semaphore *waiting_to_sit; int num_working = O; int num_waiting - O; sem_create(mutex, 1); sem_create(waiting_to_sit, O) // Code executed by each person //(recall that P ==wait, and V ==signal) P(mutex); if (num_working == 4 ) { num_waiting += 1; V(mutex); P(waiting_to_sit); P(mutex); //reacquire mutex num_waiting -= 1; } num_working += 1; V(mutex); // get help from instructor P(mutex); num_working -= 1 if (num_working == 0 k& num_waiting > 0) { // set n to the minimum of 4 and num_waiting int n = min(4, num_waiting); for(int i = O; i < n; i++) { V(waiting_to_sit); } } V(mutex);
In this question, we will perform address translation using the physical memory dump on page 17. (You may tear off the page to avoid flipping back and forth.) Note that the physical memory dump may be bigger or smaller than the actual physical memory in one or both of the questions.
Remember: Each hexadecimal digit is 4 bits in binary.
Considering the linear page table configuration below.
8 7 6 5 4 3 2 1 0
VPN | Offset |
7 6 5 4 3 2 1 0
v | s | D | R | PFN |
i- [2 MARKS] Fill in the values in the table below assuming all the bits are used in the virtual address and page frame numbers. Use decimal (base 10) in your answers. Sizes should be expressed in bytes.
Page size (virtual and physical) | |
Virtual address space size | |
Physical memory size | |
Number of pages needed for page table |
ii- [4 MARKS] Find the data stored at virtual address Ox05a by filling in the following table. Fill irrelevant fields with “N /A”, for example if it is a page fault.
Virtual Address (in hex) | Ox050a |
Content of PTE (in hex) | |
PFN of data (in decimal) | |
Offset (in decimal) | |
Content of data byte ( 1 byte in hex) |
Consider the two-level page table configuration below:
9 8 7 6 5 4 3 2 1 0
PD Index | PT Index | Offset |
7 6 5 4 3 2 1 0
v | s | D | PFN |
Find the data stored at virtual address Ox14f by filling in the following table. Fill irrelevant fields with “N /A”, for example i£ it is a page fault.
Virtual Address (in hex) | Ox14f |
Content of PDE (in hex) | |
PFN of 2nd level table (in decimal) | |
Content of PTE (in hex) | |
PFN of data (in decimal) | |
Offset (in decimal) | |
Content 0£ data byte (1 byte in hex) |
A defragmentation program reorganizes the blocks on a disk to maximize the contiguous free space on the disk. You can think of the blocks on the disk as an array, where the block number is an index into the array.
Consider the following two algorithms:
Part (a) [1 MARK]
Which of the two algorithms would complete faster on average? Explain your thinking.
Part (b) [2 MARKS)
Which of the two algorithms would lead to better performance in terms of time to access blocks during normal operation? Assume we are using a magnetic disk. Explain clearly.
Part (c) [2 MARKS]
Consider an inode based-file system like ext2. What changes, if any, are made to the inodes? Explain your answer.
Part (d) [2 MARKS)
Consider an inode based-file system like ext2. What changes, if any, would need to be made to the directory metadata by the defragmentation algorithm? Explain your answer.
Part ( e) [2 MARKS]
Consider a linked file system structure like FAT. What changes, if any, are made to the FAT (File Allocation Table) by the defragmentation algorithm? Explain your answer.
Part (f) (2 MARKS]
Consider a linked file system structure like FAT. What changes, if any, are made to the directory metadata by the defragmentation algorithm? Explain your answer.
Part (g) [4 MARKS]
Solid-state hard drives have uniform access time to all parts of the drive.
i- [2 MARKS] Explain one reason why you might not want to move blocks around so that they are close to other blocks from the same file.
ii- [2 MARKS] Explain one reason why you might still want blocks from the same file to be close together on the drive.
更多代写:单精度代写 ielts indicator代考 英国高中代写 分析类论文代写 翻译research proposal范文 英文读后感怎么写
合作平台:essay代写 论文代写 写手招聘 英国留学生代写
CS3104 – Operating Systems 操作系统分页分析代写 Aim / Learning objectives The purpose of this assignment is three-fold: to provide insight into a real paging architecture; Assignment: P2 –...
View detailsUG OS (202) Practice Midterm Exam 操作系统期中练习代考 This practice midterm is DEFINITELY MUCH TOO LONG. The real midterm will be shorter. Homework problems are also possible. This pr...
View details