CS 4760 Operating Systems Memory Management

streambabySoftware and s/w Development

Dec 14, 2013 (4 years and 17 days ago)

195 views

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:
~osp/ass6.sun4/Makefile
~osp/ass6.sun4/memory.c
~osp/ass6.sun4/pageint.c
~osp/ass6.sun4/dialog.c
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
system.
Submit four runs using the hand_in program.The simulation parameters for the runs are in the following les:
~osp/ass6.sun4/par.high.local
~osp/ass6.sun4/par.high.random
~osp/ass6.sun4/par.low.local
~osp/ass6.sun4/par.low.random
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:
~osp/ass6.sun4/run.low.local
~osp/ass6.sun4/run.low.random
~osp/ass6.sun4/run.high.local
~osp/ass6.sun4/run.high.random
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.