CMSC 421, Spring 2006
Principles of Operating Systems
 

Homeworks

This page will be updated during the semester.


NEW Homework 2:

Posted May 1, 2006. Due Date: May 17, 11:45 PM by online submit. Please submit EITHER PDF or TXT files ONLY.

On GL machines, use: submit cs421 hwk2 file.pdf (or file.txt)

Homework 2 Solutions Posted on May 18

  1. Consider a process that is allocated 4 frames in memory. Pages are replaced using a local page replacement policy. Show the sequence of logical pages stored in memory and then determine the page fault rate for the following string using (a) LRU and (b) FIFO: 4 0 1 7 3 0 2 5 4 3 0 3 2 4
  2. Problem 11.4 on page 448. Starting text: "Some file systems allow disk storage to be allocated at different levels of granularity".
  3. Problem 12.2 on page 489. Starting text: "Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999."
  4. Problem 14.5 on page 556. Starting text: "Discuss the strengths and weaknesses of implementing an access matrix using access lists that are associated with objects."


Note: The following questions are additional sample problems and ARE NOT REQUIRED for submission. Submitting answers to these WILL NOT result in extra credit.
  1. Assume a process has 5 pages in its address space and is assigned 4 physical frames in memory. The reference string below is missing every other page reference. The reference to page 5 causes the first page fault.
         1 _ 2 _ 3 _ 4 5
    

    Fill in the blanks to create a reference string that satisfies each of the criteria listed below. Explain your answer briefly.
    Sample:
    Complete the reference string so that when the page fault occurs, both
    LFU and FIFO would choose the SAME page to replace.  Answer: 12233445.
    (Both replace page 1).
    
    (a) When the page fault occurs, LFU and FIFO would choose DIFFERENT pages to replace. Indicate which page would be selected by each algorithm.
    (b) When the page fault occurs, LRU and FIFO would choose DIFFERENT pages to replace. Indicate which page would be selected by each algorithm.
  2. Problem 9.14
  3. Problem 9.15
  4. Problem 11.2
  5. Problem 11.6
  6. Problem 12.1
  7. Problem 14.2

Homework 1: Chapters 5 and 7

Due Date: April 9, 9 PM by online submit. Please submit EITHER PDF or TXT files ONLY. Note: This deadline is extended from the original date of April 5th.

On GL machines, use: submit cs421 hwk1 file.pdf (or file.txt)

Homework 1 Solution

  1. Consider a ready queue with four processes and their corresponding information as below:
    Process    Arrival_Time     Burst_Time (ms)
    
    P1         0                   25
    P2         0                   14
    P3         4                   12
    P4         5                   18
    
    Assume that each context switching takes 1 ms. Determine the average waiting time per process (including context switching times) for a round robin system with time quantum values of: (a) 4 ms and (b) 8 ms.

  2. This question was clarified on March 30, 2006. Please note that t_0/Tau_0 are not needed.

    Consider a process with burst time (t_i) values of: t_1 = 14, t_2 = 23, t_3 = 15, t_4 = 19, t_5 = 24, t_6 = 36. Assume that Tau_1 = t_1. For alpha = 0.4 and alpha = 0.6, what is the value of Tau_7?

  3. Problem 5.6

  4. Problem 5.9

  5. Problem 7.2

  6. Problem 7.5

  7. Problem 7.11

  8. Problem 7.14