Implementation requirements a) You will be given a configuration file containing 1. The number of processes (degree of multiprogramming) 2. The size of physical memory in frames 3. The minimum frames per process 4. The id size in pages, start time and duration for cach process 5. the page traces for each process b) You need to simulate each process behavior in separate thread c) The memory management system will also have a separate thread d) The physical memory will be represented by a shared memory block betwoen all thread (part of this memory should be used for the page tables) e) Each page will be represented in the shared memory by 4 byte. 2 bytes contain the process id and 2 bytes for the page id ) Synchronization should be used to prevent more than one thread of accessing the same memory reference simultancously (e.g when memory management

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Virtual Memory Management Simulation
This project is about memory management and virtual memory in particular, It
consists of writing a simulator for experimenting with page replacement
algorithms. The project will be done in groups of up to 3 students.
General:
The primary goal for the project is to implement and experiment with page
replacement algorithms. To do this, you will write a paging simulator. It will
read in a set of data files specifying the page traces for individual johs and will
need to simulate the paging requirements of those programs. The trace file
could also be generated using a random number generator that produces random
page numbers for each job. The value of each number is within the size of the
program (address space) which we assume given.
We assume that the processes are run Round Robin and that the rate of page
generation is steady/fixed and that the number of memory accesses for a job is
proportional to its length, which is given at the start. So a job with 2 hours
duration generates double the memory traces of the job of one hour and half the
traces of a job of 4 hours duration. The process duration is given at the start or
generated randomly (between I and 10 hours only).
Implementation requirements
a) You will be given a configuration file containing
1. The number of processes (degree of multiprogramming)
2. The size of physical memory in frames
3. The minimum frames per process
4. The id size in pages, start time and duration for cach process
5. the page traces for each process
b) You need to simulate each process behavior in separate thread
c) The memory management system will also have a separate thread
d) The physical memory will be represented by a shared memory block
between all threads (part of this memory should be used for the page tables)
e) Each page will be represented in the shared memory by 4 byte, 2 bytes
contain the process id and 2 bytes for the page id
) Synchronization should be used to prevent more than one thread of accessing
the same memory reference simultaneously (e.g when memory management
thread updating page table should not alow other threads to access that page
table till update is done )
g) You have the freedom to decide how to implement other details like how to
simulate a page fault, how notify the process that the page fault was served
and scheduling implementation.
Configuration file Format
N number of processes
M / size of physical memory in frames
S minimum frames per process
PID start Duration
Size memory traces (e.g. 10 13 IA 3B ..)
Il a line for each process (N lines total)
Memory Traces
Memory trace is a list of addresses accessed by a program in Hexadecimal. The
addresses are truncated to virtual page numbers by removing the lower 12 bits
(assuming which page size??), which makes the files smaller. The process size
limitation needs to be observed
Scheduling
You will need to simulate a simple scheduling algorithm that allows programs to
alternate running. For this project, you only need implement round robin
between runnable processes with fixed time Quantum. The simulator defines the
quantum through the number of references seen (a clear approximation).
Your scheduler will keep track of the current time in terms of cycles, where a
cycle is one memory reference in the memory trace. If needed you can assume
1000 cycles in a second.
Context switching should take 5 cycles. After a context switch, you should start
simulating memory references from where you left off.
The scheduler should report elapsed time (time between when it started and
when it completed) for cach process. In addition, at the end of the simulation
(when all processes have completed), it should report the TA (Tumaround) and
W (wait) for the processes.
You should experiment with different quantum values.
Transcribed Image Text:Virtual Memory Management Simulation This project is about memory management and virtual memory in particular, It consists of writing a simulator for experimenting with page replacement algorithms. The project will be done in groups of up to 3 students. General: The primary goal for the project is to implement and experiment with page replacement algorithms. To do this, you will write a paging simulator. It will read in a set of data files specifying the page traces for individual johs and will need to simulate the paging requirements of those programs. The trace file could also be generated using a random number generator that produces random page numbers for each job. The value of each number is within the size of the program (address space) which we assume given. We assume that the processes are run Round Robin and that the rate of page generation is steady/fixed and that the number of memory accesses for a job is proportional to its length, which is given at the start. So a job with 2 hours duration generates double the memory traces of the job of one hour and half the traces of a job of 4 hours duration. The process duration is given at the start or generated randomly (between I and 10 hours only). Implementation requirements a) You will be given a configuration file containing 1. The number of processes (degree of multiprogramming) 2. The size of physical memory in frames 3. The minimum frames per process 4. The id size in pages, start time and duration for cach process 5. the page traces for each process b) You need to simulate each process behavior in separate thread c) The memory management system will also have a separate thread d) The physical memory will be represented by a shared memory block between all threads (part of this memory should be used for the page tables) e) Each page will be represented in the shared memory by 4 byte, 2 bytes contain the process id and 2 bytes for the page id ) Synchronization should be used to prevent more than one thread of accessing the same memory reference simultaneously (e.g when memory management thread updating page table should not alow other threads to access that page table till update is done ) g) You have the freedom to decide how to implement other details like how to simulate a page fault, how notify the process that the page fault was served and scheduling implementation. Configuration file Format N number of processes M / size of physical memory in frames S minimum frames per process PID start Duration Size memory traces (e.g. 10 13 IA 3B ..) Il a line for each process (N lines total) Memory Traces Memory trace is a list of addresses accessed by a program in Hexadecimal. The addresses are truncated to virtual page numbers by removing the lower 12 bits (assuming which page size??), which makes the files smaller. The process size limitation needs to be observed Scheduling You will need to simulate a simple scheduling algorithm that allows programs to alternate running. For this project, you only need implement round robin between runnable processes with fixed time Quantum. The simulator defines the quantum through the number of references seen (a clear approximation). Your scheduler will keep track of the current time in terms of cycles, where a cycle is one memory reference in the memory trace. If needed you can assume 1000 cycles in a second. Context switching should take 5 cycles. After a context switch, you should start simulating memory references from where you left off. The scheduler should report elapsed time (time between when it started and when it completed) for cach process. In addition, at the end of the simulation (when all processes have completed), it should report the TA (Tumaround) and W (wait) for the processes. You should experiment with different quantum values.
Page Replacement
Your simulated machine will have a fixed number of frames (physical pages) to
share between running processes. When the memory required exceeds the
available physical memory, you will need to use disk storage.
You need to keep track of which pages are in physical memory and which are
on disk. It takes 300 cycles to move a page from disk to memory. Moving pages
from memory to disk is free, as this can be overlapped with computation. For
each cycle that process executes, you should check whether the virtual page is in
physical memory. If so, advance to the next address. If it is not in physical
memory, you must simulate a page fault by:
1. Context switching to a new process
2. Putting the current process on a blocked queue
3. Reading the page off disk
4. Making the process ready again when the page comes back off disk
You must keep track, for each process, which pages are in physical memory and
which are on disk. Assume that all pages start off on disk and you are doing
demand paging. Because writing pages to disk is free, you don't have to worry
about whether a page is dirty or not (and in fact, the trace does not indicate
whether a memory reference is a read or a write).
Report the number of page faults experienced by each process and the total
number of page faults experienced across all processes.
You should experiment with total physical memory sizes of 40 pages, 200
pages, and 500 pages.
Page replacement policies
You should simulate 2 different page replacement policies, the odd ones in the
list below (1,3) or the even ones in the list below (2,4) based on the max value of
the first digit of the team ID numbers, again:
1. FIFO
2. Second-chance FIFO
3. LRU
4. Clock
For each trace, you should try both page replacement policies to see how they
compare.
Transcribed Image Text:Page Replacement Your simulated machine will have a fixed number of frames (physical pages) to share between running processes. When the memory required exceeds the available physical memory, you will need to use disk storage. You need to keep track of which pages are in physical memory and which are on disk. It takes 300 cycles to move a page from disk to memory. Moving pages from memory to disk is free, as this can be overlapped with computation. For each cycle that process executes, you should check whether the virtual page is in physical memory. If so, advance to the next address. If it is not in physical memory, you must simulate a page fault by: 1. Context switching to a new process 2. Putting the current process on a blocked queue 3. Reading the page off disk 4. Making the process ready again when the page comes back off disk You must keep track, for each process, which pages are in physical memory and which are on disk. Assume that all pages start off on disk and you are doing demand paging. Because writing pages to disk is free, you don't have to worry about whether a page is dirty or not (and in fact, the trace does not indicate whether a memory reference is a read or a write). Report the number of page faults experienced by each process and the total number of page faults experienced across all processes. You should experiment with total physical memory sizes of 40 pages, 200 pages, and 500 pages. Page replacement policies You should simulate 2 different page replacement policies, the odd ones in the list below (1,3) or the even ones in the list below (2,4) based on the max value of the first digit of the team ID numbers, again: 1. FIFO 2. Second-chance FIFO 3. LRU 4. Clock For each trace, you should try both page replacement policies to see how they compare.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY