Assignment 7, due Apr. 2
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!
a) These do many of the same things. Describe the common core of functionality they share, from the user's perspective. (0.5 points)
b) With reference to the memory map of the calling process, describe how the start argument of the mmap() function must operate. For full credit, your description must explain why start operates as a hint. (0.5 points)
In a system that supports the mmap system call, a different approach must be used. If you know from the start that you are going to support mmap(), you should use mmap() to link the code, static and stack segments to their backing storage as well as using it for files that a user elects to access through mmap().
a) When the time comes to move a page between main memory to backing store, how does the system find the appropriate disk address. You may need to invent some auxiliary data structures besides the page table in order to make this feasible. Assume that there is no pre-computation of disk addresses associated with each virtual address. Your answer must relate what you know about file systems to what you know about virtual memory. (0.5 points)
b) Explain the potential improvement in system performance that would result from pre-computing the disk address associated with each page-table entry. Your discussion must build on part A by explaining the part of the cost of accessing a page that is avoided by this precomputation, and estimating its potential best-case and worst-case magnitude. (0.5 points)
c) How would your answer to the first two parts of this problem change if you had enforce the constraing that mmaped files must start on a hardware segment boundary (assuming a paged-segmented virtual memory model). (0.5 points)
A Problem: What can you do, as a programmer, to tolerate this? Solve the problem in C. (0.5 points)
Write a program that uses mmap() to read and list a text file to the screen. It should take the file name as a command line argument, and it should output the lines with a leading dash on each line.
As usual, submit your source file as mp4.c.