(Are you looking at a stale web page? Try refreshing your browser.)

( Latest Revision -- Tue Nov 12 23:50 PST 2013 )
[2013/11/12: Gave detail for first problem for chapter 8 ]
[2013/09/14: Correction to last problem in first homework set ]
[2013/08/23: Updates regarding ed 8 vs ed 9 of Silberschatz ]
[2013/08/17: Initial updates]

Homework Problems for CS 3750




If you do a good job on the homework, you'll do better on tests. It's likely to raise your course grade by one full letter grade or more (e.g. from C to B, or from B to A).

Directions for homework submissions

When you do the homework, show mastery of the material. Leave no doubt that you know what you are talking about. Give thoughtful and complete answers. Explain your answers so as to demonstrate and prove to a skeptical reader that they are correct.

Put things into your own words. Do not copy, quote, or closely paraphrase the textbook or other people's writings.

Write so as to be understandable to a certain intended readership -- an intelligent person who has completed the prerequisites for CS 3750 but who has not yet taken CS 3750.

Keep an extra copy of everything you turn in. Homework will typically be due on the class day just prior to a test day. I will discuss answers to the homework immediately after collecting it. You will not receive back the homework paper you give me until sometime after you take the test.

Form and Format

Send e-mail to: john@ishi.csustan.edu


DUE DATES

For all homework due dates, see: the class schedule.



WARNING ABOUT PROBLEM NUMBERS

If you have a different edition of the textbook, or even a foreign version of the current edition, then the problem numbers in your book may not correspond exactly to those in the official course text. It is your responsibility to make sure you work the right problems.


Homework Assignment #1

Chapter #01 -- Introduction
  1. Write 250 words or more describing the interplay between operating system software and the interrupt mechanism. In your writing show that you understand A) how interrupts "drive" the actions of the operating system, and B) how the interrupt mechanism in a modern computing system actually works (what hardware devices do to cause an interrupt and the sequence of events that take place between the time that the currently running program is interrupted and the time that program resumes execution).
Chapter #02 -- Operating System Structures
  1. Using information gleaned from chapters one and two, write 500 words or more describing the important functions and responsibilities of a modern multi-user, time-sharing operating system.

  2. Using information from section 2.7 write 250 words or more describing several different approaches to designing operating system structure. Discuss the advantages and disadvantages of each approach.
Chapter #03 -- Processes
  1. Write 250 words on the topic of programs and processes. Define what a program is and what a process is. Explain what the differences and similarities are between the two concepts. Explain and/or speculate on what operating system data structures must be employed in order to maintain and preserve a program. Answer the same question for a process. Give attention to similarities and differences regarding the data structures too. Use information distilled from your readings of chapter 3 to help you answer this question, and add whatever else you know that you think will be helpful. (Keep in mind the "intended readership" described in the directions above.)
Chapter #04 -- Threads
  1. Rewrite the essay you wrote in answer to the question for chapter #03. The directions are the same except that this time you must cover three concepts: program, process, and thread. In addition to adding information about threads, since you know more now you should be able to improve on what you said before about programs and processes.
Chapter #05 -- Scheduling (If you are using Edition 9, this is Chapter #06.)
  1. Do the following problem. (It is problem 5.12 on page 220 of edition #8.)
         Consider the following set of processes, with the length of the 
         CPU burst given in milliseconds:
    
                Process    Burst Time    Priority
                  P1           10           3
                  P2            1           1
                  P3            2           3
                  P4            1           4
                  P5            5           2
    
         The processes are assumed to have arrived in the order P1, P2, P3, P4, P5,
         all at time 0.
    
         a. Draw four Gantt charts that illustrate the execution of these 
            processes using the following scheduling algorithms: FCFS, SJF, 
            nonpreemptive priority (a smaller priority number implies a higher 
            priority), and RR (quantum = 1).
    
         b. What is the turnaround time of each process for each of the 
            scheduling algorithms in part a?
    
         c. What is the waiting time of each process for each of these schedul-
            ing algorithms?
    
         d. Which of the algorithms results in the minimum average waiting 
            time (over all processes)?
    
    

WARNING ABOUT PROBLEM NUMBERS

If you have a different edition of the textbook, or even a foreign version of the current edition, then the problem numbers in your book may not correspond exactly to those in the official course text. It is your responsibility to make sure you work the right problems.


Homework Assignment #2

Chapter #06 -- Process Synchronization (If you are using Edition 9, this is Chapter #05.)
  1. Do the problem in the file hymanProb.html in this directory. Please take note of the example "scenario" described in the problem statement. Make sure that the solution you construct is the same kind of specific and detailed scenario.

  2. A version of the "readers-writers problem" is described in the text in section 6.6.2 (if you are using Edition 9, it's in section 5.7.2.) Propose a solution to the following variation on that readers-writers problem: readers and writers must be given access to the [database] resource in the order in which they request it. Readers share the resource to the greatest extent possible. Each writer accesses the resource exclusively.

    Write up your proposed solution using a format like the one used in figures 6.12 and 6.13 (and the explanation in the text preceding figure 6.12 of the meaning of the variables). In other words write pseudo code that shows what the shared variables are, pseudo code for writer processes, and pseudo code for reader processes. Also, like the solution shown in figures 6.11 to 6.12, use only semaphores for synchronization. However, note that the problem I am posing for you is different from the one in the text, so naturally you need to try to think of a solution that is different from what's in figures 6.12 and 6.13. (If you are using Edition 9, the figures are 5.11 and 5.12.)

    Assumptions:

    • The total number of readers and writers does not exceed some fixed bound N.
    • You can declare and use as many semaphore variables as you need.
    • The semaphores work as defined in 6.5.2 (in Edition 9, it is section 5.6.2)
    • The list S in each semaphore is a FIFO queue.

    In addition to enforcing exclusive writes and allowing shared reads, your solution should be starvation free, and satisfy the progress & bounded waiting requirements for solutions to critical section problems. (See section 6.2, or section 5.2 of Edition 9.)

    Note: The degree of difficulty of this problem may be high for you, but give it a try anyway. It's a good problem to think about.
Chapter #07 -- Deadlocks
  1. Do problem #7.20 on page 310 (it's #7.3 on page 340 of Edition 9). (The problem starts with: "Consider the following snapshot of a system ...") Show all your work (in detail). Use the same kind of format you see here.
Chapter #08 -- Memory Management
  1. Do problem 8.11 on page 352 of the eighth edition. Here is the statement of the problem:

    Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB, and 426 KB (in order)? Which algorithm makes the most efficient use of memory?

    • The chapter contains information you will need to know in order to solve this exercise correctly. Read it.
    • Remember the possibility of using holes created by previous allocations,
    • Assume that for each allocation, the first-fit algorithm starts its search again at the beginning of the list.

  2. Do problem 8.13 on page 352 (page 391 in Edition 9) (It starts: "Compare the main memory organization ..."

  3. Do problem 8.20 on page 353 of Edition 8. Here it is:

    Consider a paging system with the page table stored in memory.

    a. If a memory reference takes 200 nanoseconds, how long does a paged memory reference take?

    b. If we add TLBs, and 75 percent of all page-table references are found in the TLBs, what is the effective memory reference time? (Assume that finding a page-table entry in the TLBs takes zero time, if the entry is there.)

  4. Do problem 8.23 on page 353 (It starts: "Consider the following segment table" (It is problem 8.28 in Edition 9.) The table is supposed to read like this:
            Segment         Base            Length
               0             219              600
               1            2300               14
               2              90              100
               3            1327              580
               4            1952               96
Chapter #09 -- Virtual Memory
  1. Do the following problem. Show all work in detail.

    A virtual address of 76543656 (hex) appears in a program that is being run on a computer that does demand paging. The computer has 24-bit physical addresses, 32-bit virtual addresses, and a 1K-word page-size. How many physical frames are there? How many virtual pages are there? What are the page number and the offset corresponding to the virtual address? (Give the last two both in hex notation and decimal notation.)

  2. Do problem 9.21 on pages 412-413 (It starts: "Assume that we have a demand-paged memory. The page table is held in registers. ..."). (The problem number is 9.19 in Edition 9.)

WARNING ABOUT PROBLEM NUMBERS

If you have a different edition of the textbook, or even a foreign version of the current edition, then the problem numbers in your book may not correspond exactly to those in the official course text. It is your responsiblity to make sure you work the right problems.


Homework Assignment #3

Chapter #10 -- File-System Interface (In Edition 9, this is Chapter 11)
  1. Do problem 10.10 on page 458 ("Consider a file system in which a file can be ...") (It is problem 11.9 in Edition 9.)

  2. Do problem 10.18 on page 459 ("Some systems provide file sharing by ...") (It is problem 11.17 in Edition 9.)
Chapter #11 -- File-System Implementation (In Edition 9, this is Chapter 12)
  1. Do problem 11.10 on page 500 ("What are the advantages of the variant ...") (It is problem 12.11 in Edition 9.)

  2. Do problem 11.14 on page 501 ("Consider a file system on a disk that has ...") (It is problem 12.15 in Edition 9.)
Chapter #12 -- Mass-Storage Structure (In Edition 9, this is Chapter 10)
  1. Describe each of the following disk-scheduling algorithms: FCFS, SSTF, SCAN, LOOK, C-SCAN, and C-LOOK.
Chapter #13 -- I/O Systems
  1. Do problem 13.1 on page 586 (p. 619 in Edition 9) ("State three advantages of placing ...")

  2. Do problem 13.5 on page 586 (p. 619 in Edition 9) ("How does DMA increase ...")

  3. Do problem 13.6 on page 586 (p. 619 in Edition 9) ("Why is it important to scale up ...")