CS 4760 Operating Systems Memory Management

streambabyDéveloppement de logiciels

14 déc. 2013 (il y a 7 années et 10 mois)

369 vue(s)

CS 4760 Operating Systems
Assignment#6 Due Date:November 13,2013
Memory Management
In this part of the assignment,you are to implement the MEMORY and PAGEINT modules of OSP.
Implement a Unix-like second-chance algorithm.When the number of free frames falls below some value (let it be
10% of the total),a special daemon program kicks in.In OSP,the logical place for this daemon to be invoked is the
get_page routine.Once invoked,the daemon sweeps the frame table,turning o the valid bit of the corresponding
resident pages (if they don't expect i/o into them).This does not make the frames free,but only marks them for
replacement.If the valid bit of the page in some frame is already o,then the frame is freed up completely (don't
forget to save the page on disk).Frames marked for replacement are reclaimable.This means that when a page fault
occurs over a page sitting in such a frame,there is no need to swap it in { just turn the valid bit back on.Make sure
that you perform dirty bit optimization.
To begin the assignment,copy the les:
into your directory.You will implement the missing functions memory_init,deallocate,get_page,lock_page,
unlock_page,refer,start_cost,and prepage at the end of the le memory.c,and the function pagefault_handler
at the end of the le pageint.c.You may leave prepage function empty to indicate that no prepaging is performed.
It should be pointed out that the OSP function refer simulates work that would be done by the hardware in a real
Submit four runs using the hand_in program.The simulation parameters for the runs are in the following les:
The suxes low and high refer to the frequency of process arrival,and the suxes local and random refer to the
pattern of memory reference.The rst of parameter-le induces a short simulation run with the trace switch on.
The les par.low test your program under low frequency of memory reference (an I/O bound system).The les
par.high generate cpu-bound simulation,in which case the memory reference frequency is high.
The statistics of interest for this assignment are:
 Number of pages swapped in/out (the most important parameter for this assignment).
 Turnaround time.
 Waiting time.
 Throughput.
Memory Management 2
To compare your results with the statistics generated by the standard system,see:
Make sure that your name and email are included in your source le.Also include as comments in your source le a
description of your fetch and replacement strategies,and an explanation of the statistics you obtained.The standard
module uses lru and prepages a small number of least recently used pages for the dispatched process.
Provide good documentation regarding how you do things.