Homeworks are not mandatory; rather, they are things you can do in your own time to see if you have really understood something. The basic idea is simple: each of the programs below let you both generate and get solutions for an infinite number of problems. They are meant to firm up your understanding of some of the basic concepts we discussed in class. In some cases, a few suggested problems are given.
Note: All of these scripts and README files are now available online here as well as in the file system at the path names listed below. Or, just download all the homeworks in one fantastic tarball here.
Homework 1: Scheduling.
Homework 2: Segmentation.
Homework 3: Linear Page Tables (Size).
prompt> ./paging-linear-size.py -v 16 -p 4kThen, to understand how linear page table size changes as page size grows:
prompt> ./paging-linear-size.py -v 32 -p 1kBefore running any of these, try to think about the expected trends. How should page-table size change as the address space grows? As the page size grows? Why shouldn't we just use really big pages in general?
Homework 4: Linear Page Tables (Translations).
Homework 5: Paging Policies.
Some examples (from the handout) to compare how OPT, FIFO, and LRU perform:
prompt> ./paging-policy.py -a 0,1,2,0,1,3,0,3,1,2,1 -p OPT -C 3 prompt> ./paging-policy.py -a 0,1,2,0,1,3,0,3,1,2,1 -p FIFO -C 3 prompt> ./paging-policy.py -a 0,1,2,0,1,3,0,3,1,2,1 -p LRU -C 3Or to discover Belady's anomaly (using FIFO, while increasing cache size):
prompt> ./paging-policy.py -a 1,2,3,4,1,2,5,1,2,3,4,5 -p FIFO -C 3 prompt> ./paging-policy.py -a 1,2,3,4,1,2,5,1,2,3,4,5 -p FIFO -C 4