CSE 410 Homework 4: Processes and Virtual Memory

Assigned Tuesday, November 26, 2013
Due Date Thursday, December 5 at 11:00 pm No late assignments will be accepted so we can hand out solutions on the last day of class.

Introduction

The purpose of written homework assignments is to get you thinking about the topics being covered in lecture and in readings in the textbook which are not represented in the hands-on, programming lab assignments. These written assignments also better prepare you for course examinations. It is worth noting that the book contains many practice problems similar to the problems we ask on these written assignments. The solutions for those practice problems are located at the end of each chapter and should give you a feel for the kind of answers we expect you to turn in for these kind of assignments.

Logistics

Please write up your answers and submit them as a PDF file in the online dropbox. This simplifies our grading and ensures we read your answers clearly. If you don't know how to create a PDF, a quick internet search should help, or ask us. You may submit a scanned file with a hand-written solution as long as the file is legible and is not too large (a few MB max, please).

We will provide solutions to all of the problems in the written homework assignments in a timely fashion after the assignment is due.

Questions

Answer the following problems from the textbook. If a practice problem is listed, try to solve the problem on your own first, then check your answer at the end of the chapter. Make sure you understand the solution provided, then complete the additional questions below. Your write-up only needs to contain the information necessary to understand your answer to the additional questions - you do NOT need to turn in the answer to the practice problem in its entirety.

  1. Homework Problem 8.12
  2. Homework Problem 8.13. Answer the following questions about the program given in the problem:
    1. What output does the parent process produce?
    2. What output does the child process produce?
    3. Both processes are printing to the same place. Give two possible sequences of output produced by the program when it is executed.
    Note: If x has the value 3, then ++x increments x before returning its value, which is 4. If x has the value 3, x++ returns the value 3 and then increments x, leaving its final value as 4. The -- operator works similarly, except it decrements the variable either before or after returning its value.
  3. Homework Problem 8.16.
  4. Practice Problem 9.2. Note 1KB = 1024 bytes. Repeat for: n = 64 and P = 4 KB (e.g. an x86-64 system with standard pages); n = 64 and P = 4096 KB (e.g. an x86-64 system with "huge pages"). Give your answer as a power of 2.
  5. Practice Problem 9.3. Consider a 64-bit virtual address space and a 36-bit physical address; repeat this problem for P = 4 KB and P = 4096 KB using these address spaces. (You do not need to show answers for any of the other page sizes.)
  6. Homework Problem 9.11. Do practice problem 9.4 and read and understand the solution before working on this problem. You can write out the virtual address bits without drawing the boxes or labeling them with their bit indexes.
  7. Homework Problem 9.12.

Notes

Be sure you are using the 2nd edition of Computer Systems: A Programmer's Perspective. If you're not using the right book, you might be doing the wrong problems!

Submitting Your Work

Please submit a PDF file with your solutions using the Catalyst drop box linked from the CSE 410 main web page.