Homework 4: Processes and Virtual Memory

Assigned Wednesday, November 23, 2016
Due Date Friday, December 02, 2016 at 5:00pm
Submissions Submit a PDF file of your solutions using the course's Assignment Drop Box.

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 exams. 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.

We will provide solutions to all of the problems in the written homework assignments in a timely fashion after the assignment is due. This may be around 4 or 5 days after the due date, because some students may use late days.

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

Questions

Answer the following problems from the textbook. Notice that several of these problems are practice problems. 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 we ask about each practice problem. Your write-up only needs to contain the information necessary to understand your answer to the additional questions listed here - you do NOT need to turn in the answer to the practice problem in its entirety, but you DO need to submit your answer to the extra problem associated with each practice problem.

  1. Homework Problem 8.13, p. 789.
    Note that "Fork()" (with a capital F) is the book's call to fork() that checks for errors (see p. 738).
  2. Homework Problem 8.14, p. 789.
    Note that "Fork()" (with a capital F) is the book's call to fork() that checks for errors (see p. 738).
  3. Practice Problem 9.2, p. 807. Note 1KB = 1024 bytes.
    Repeat for:
    1. n = 64 and P = 4 KB (e.g., an x86-64 system with standard pages)
    2. n = 64 and P = 4096 KB (e.g. an x86-64 system with “huge pages”)
    Give your answer as a power of 2.
  4. Practice Problem 9.3, p. 816.
    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.)
  5. Homework Problem 9.12, p. 877.
    Read and understand the solution to practice problem 9.4 before working on this problem. You can write out the virtual address bits without drawing the boxes or labeling them with their bit indexes.
  6. Homework Problem 9.13, p. 878.