Operating Systems, CSCE 4413

Homework Assignment 5

Part 1: Written Exercises

This part of assignment is to be done on your own, and with the help of the textbook or other legitimate resources. Write the answers to these in plain text and submit the file to the Homework Submission Page.

  1. From the text, do exercises 10.3, 10.5, 10.9, 10.17, and 11.7.
  2. Using the page-reference string in exercise 10.11 from the text, determine the number of page faults that would occur for each of LRU, FIFO, and Optimal page replacement, and assuming each of one, three, five, or seven frames. Remember that all frames are initially empty, so your first unique pages will all cost one fault each.

Part 2: Experimental Study

If you would like, you may work in teams of two for this part of the assignment. For this assignment you are to use the scientific method to design, run, and make conclusions about virtual memory behavior. (You may want to look up the steps of the scientific method before you start!) Use the example code, or some modification of it, and also in combination with other activity on your computer as a starting point for the experiment.

To Prepare: Do a man on vmstat, on ps, and any other tools that you find in Linux to see what kind of statistics are available. Try to explore enough tools that you have a feeling for what kinds of statistics can be measured at the user level. You may also use another operating system, such as Windows, if you prefer, but be sure that you have access to enough tools to get useful statistics and information.

Exercise: I would like you to design an experiment about virtual memory, with the example code as a starting point. You should make some hypotheses, run some experiments, and then draw some conclusions based on what you observe. Be sure to run the code for a variety of inputs. For best results, you should run the experiment on a machine that is not heavily used at the time. You can run ps or users at the command line to see what else is happening on the machine.

IMPORTANT: You should try your experiment on a personal computer first. Use the computer resources responsibly! If you think that you might crash a heavily used server by running some particular code, then don't do it!

Turn In: For this part of this assignment, DO NOT USE the Homework Submission Page. Rather, use good word processing tools and techniques, including any graphing or figure drawing tools that you may find appropriate, and turn in a short writeup (4-5 pages). The writeup should include:

  1. A brief description of the problem you have studied, and the hypotheses you made.
  2. A description of the tools (e.g., vmstat, ps, top) and the code that you used in your study.
  3. A description of the experimental environment in which you ran your study (e.g., comp.uark.edu at 4am with no other users around ...). Include information such as the size of physical memory on the machine, number of processors, or virtual memory algorithms used by the system that you are experimenting on.
  4. A graphs or chart of your results, as appropriate.
  5. Conclusions describing what you have learned about virtual memory behavior, and a brief description of items that you may still not understand very well.
The Experimental Study is worth 60 Homework Points, with the points divided approximately equally between the five items listed above and an overall impression of the writeup. Be aware that grammar, spelling, and your overall use of the English language will count.

Have fun!