C Programming — Virtual Memory

Closed Posted 7 years ago Paid on delivery
Closed Paid on delivery

Objective:

To translate a virtual address to a physical address, involving a custom-sized fully

associative page table.

Inputs:

The total size of physical memory (in words)

The page size (words/page)

The replacement policy (LRU, FIFO)

Outputs:

The corresponding physical address for a virtual address

A message indicating a page fault (if any) in the page table

Specification:

The program translates a virtual address to a physical address based on choosing from a

menu of choices, where each choice calls the appropriate procedure, where the choices

are:

1) Set parameters

2) Map virtual address

3) Quit program

Upon entering the parameters, the page table is to be dynamically allocated based on the

total number of page frames. The page frames will be mapped to virtual pages on demand in the page frame order 0,1,2,3,…

Output:

Virtual memory to Main memory mapping:

--------------------------------------

1) Enter parameters

2) Map virtual address

3) Quit

Enter selection: 1

Enter main memory size (words): 2048

Enter page size (words/page): 1024

Enter replacement policy (0=LRU, 1=FIFO): 0

Virtual memory to Main memory mapping:

--------------------------------------

1) Enter parameters

2) Map virtual address

3) Quit

Enter selection: 2

Enter virtual memory address to access: 5000

Page fault!

-----------------

| VP | PF |

-----------------

| 4 | 0 |

-----------------

Virtual memory to Main memory mapping:

--------------------------------------

1) Enter parameters

2) Map virtual address

3) Quit

Enter selection: 2

Enter virtual memory address to access: 2048

Page fault!

-----------------

| VP | PF |

-----------------

| 4 | 0 |

-----------------

| 2 | 1 |

-----------------

Virtual memory to Main memory mapping:

--------------------------------------

1) Enter parameters

2) Map virtual address

3) Quit

Enter selection: 2

Enter virtual memory address to access: 4509

Virtual address 4509 maps to physical address 413

-----------------

| VP | PF |

-----------------

| 2 | 1 |

-----------------

| 4 | 0 |

-----------------

Virtual memory to Main memory mapping:

--------------------------------------

1) Enter parameters

2) Map virtual address

3) Quit

Enter selection: 2

Enter virtual memory address to access: 7160

Page fault!

-----------------

| VP | PF |

-----------------

| 4 | 0 |

-----------------

| 6 | 1 |

-----------------

Virtual memory to Main memory mapping:

--------------------------------------

1) Enter parameters

2) Map virtual address

3) Quit

Enter selection: 3

C Programming Java

Project ID: #10367535

About the project

6 proposals Remote project Active 7 years ago

6 freelancers are bidding on average $60 for this job

hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on server side, using c++ under linux environ More

$100 USD in 1 day
(143 Reviews)
6.9
StrongDecs

Greetings, This task would be done during 2 days. Please contact me if it makes you interested my proposition. Thank you,

$88 USD in 2 days
(29 Reviews)
4.4
apmtc11

Hi we are team of developers and we are looking for a chance to make our self best in this. because we know we are the best with new ideas and we can code anything , we are new on freelance and very hungry for work eve More

$25 USD in 1 day
(0 Reviews)
0.0