Final Exam
Part of
materials for 22C:50, Summer 2004
|
Name: ________________________________________________
ID Number: ___________________
Please write your answers in the space provided! Make sure your name is in the same form as it appears on your University ID card! Illegible and excessively long answers will be penalized! This exam is open-book, open-notes, closed neighbor! This exam is worth 1/5 of the final grade (20 points; allocate 2 minutes per point).
a) What difference in processing speed would you expect between these two, and why? (if it matters, assume lots of macro calls, no macro parameters and no disk cache) (1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
b) One of these models does not allow preprocessing of the macro body in order to speed the substitution of macro actual parameters for macro formal parameters. Which does not, and why? (1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
The supervisor of a process on this system can implement demand paged virtual memory, even though the supervisor cannot directly access the MMU or access any MMU registers.
a) With reference to the above operations and normal file system operations, how does the supervisor clean a page frame and transfer its contents to disk? (1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
b) What page replacement policies can the supervisor implement, and what feature of this system prevents it from implementing better policies. the supervisor would perform in response to a page fault message. (1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
c) What does the supervisor do in order to determine the specific page in the process's address space that caused the fault? (1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
d) What does the supervisor do at the point where a normal page-fault service routine would return to the process that caused the fault? (1.0 point)
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
a) The program executes int fd = open("/a/b.txt", O_RDONLY); how many disk accesses are required? (1.0 point)
______________________________________________________________
b) And then, the program executes read(fd, buf, 1); how many additional disk accesses are required? (1.0 point)
______________________________________________________________
c) When the user process does read(fd, buf, 1);, it only reads one byte of data. Does the DMA hardware directly read from disk to the user's buffer buf? If not, how does the data get there? (1.0 point)
______________________________________________________________
a) Which policy is likely to improve the locality of reference in a
demand-paged virtual memory environment for applications that make
intensive use of the heap? Why?
(1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
b) Which policy is likely to lead to faster searches for a large enough free block if there are no page faults, and what slows down the other policy? (1.5 points)
______________________________________________________________
______________________________________________________________
______________________________________________________________
a) Aside from one, what interleaving factors make sense here? (1.5 points)
______________________________________________________________
a) Show the order of the sectors with the smallest of these. (1.5 points)
______________________________________________________________