Carnegie Mellon
SCS logo
Computer Science Department
home
syllabus
staff
schedule
lecture
projects
homeworks
 
 

15-410 Homework 2


This homework assignment is due Friday, December 5th at 23:59:59. As we intend to make solutions available on the web site immediately thereafter, please turn your solutions in on time.

Homework must be submitted (online) in either PostScript or PDF format (not: Microsoft Word, Word Perfect, Apple Works, LaTeX, XyWrite, WordStar, etc.). Except as otherwise directed (in the crypto question), turn in your answers as .../$USER/hw2/$USER.pdf, .../$USER/hw2/$USER.ps, or .../$USER/hw2/$USER.text. If you use another filename, there is some risk that your solutions will not be credited to you.

As usual, you may discuss this assignment with others, but you must then go off by yourself to write up the solution.


Question 1 - Public Key Practicum

This question is not hard, but it does take some time to do it right. Please don't leave this question to the last minute, and think carefully about what the various steps accomplish.

Follow the directions in gpg.html to generate a PGP key ring, containing public and private keys for digital signature and encryption purposes. Do not turn the key ring in to your hw2 directory. Instead, follow the directions on how to export the public key information from the key ring into a file, hw2/$USER.asc. Then create a secret message for the course staff, in hw2/$USER.secret.asc.


Question 2 - Demand Loading

Suppose that Project 4 had been adding demand loading of executables to your Project 3 kernel. The key idea of demand loading is that each individual invocation of a program will execute only a subset of the instructions, and hence typically access only a subset of the data; it is thus possible to save time and memory during exec() by copying little (or none?) of the executable file into memory. Once launched, the program will encounter page faults which will bring parts of the executable into memory, but only those parts which are truly needed for that particular run.

Part A

Explain what housekeeping information would be required by the page-fault handler in order to enable demand loading of pages from the text region. Briefly outline how the page-fault handler would access and use that information. We do not expect that you will need more than a paragraph for your answer.

Part B

Now choose another memory region to discuss in the same fashion as your answer for Part A. Try to select the "most interesting" region, and briefly state why you chose the one you did.

Part C

Some systems may benefit more from demand loading than others. Use the Linux size command (and perhaps also the sort command) to examine some executable files found in 410user/progs/. For comparison purposes you may also wish to examine /usr/local/lib/Adobe/Reader8/Reader/intellinux/bin/acroread. What does this examination suggest to you?

Part D

It is possible to use the nm command to produce a list of the C "objects" (code or data items) in an executable file, sorted by size. If you apply this to a few files in 410user/progs/, what surprising (or at least interesting) pattern emerges?


Helpful Hint

By the way, if you think you are having AFS permission problems, try running the program located at
% /afs/cs.cmu.edu/academic/class/15410-f08/pub/access_hw2



[Last modified Wednesday December 03, 2008]