C Programming — Virtual Memory

Cerrado Publicado Apr 29, 2016 Pagado a la entrega
Cerrado Pagado a la entrega

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

Programación en C Java

Nº del proyecto: #10367535

Sobre el proyecto

6 propuestas Proyecto remoto Activo hace 7 años

6 freelancers están ofertando un promedio de $60 por este trabajo

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 Más

$100 USD en 1 día
(143 comentarios)
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 en 2 días
(29 comentarios)
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 Más

$25 USD en 1 día
(0 comentarios)
0.0