1. Homepage
  2. Programming
  3. VM Lab - Programming Assignment Virtual Memory

VM Lab - Programming Assignment Virtual Memory

Engage in a Conversation
NYUVirtual Machines: Concepts & ApplicationsC

Programming Assignment Virtual Memory CourseNana.COM

What Will We Do? CourseNana.COM

In this project we will implement a simple virtual memory system. CourseNana.COM

Memory Access File CourseNana.COM

Page Size CourseNana.COM

# mem accesses after which R-bit CourseNana.COM

is cleared CourseNana.COM

Stats on screen CourseNana.COM

Please review slides
14 and 15 from
“Memory Management 3” CourseNana.COM

./vmem filename page num CourseNana.COM

Assumptions Virtual address is 16 bits CourseNana.COM

Physical address is 10 bits CourseNana.COM

Your Source Code CourseNana.COM

vm.c
compile with:
gcc Wall o vmem std=c99 vm.c -lm CourseNana.COM

Input File Format CourseNana.COM

address read/write CourseNana.COM

Example: CourseNana.COM

abcd 0 123a 1 a345 0 3456 1 CourseNana.COM

You are provided with a file that can generate input files for you. CourseNana.COM

Input File: CourseNana.COM

abcd 0 123a 1 a345 0 3456 1 CourseNana.COM

Example CourseNana.COM

./vmref example.in 64 2 CourseNana.COM

num reads = 2
num writes = 2
percentage of page faults 1.00 mem[0]: 2af
mem[1]: 48
mem[2]: 28d
mem[3]: d1
mem[4]: ffffffff
mem[5]: ffffffff
mem[6]: ffffffff
mem[7]: ffffffff
mem[8]: ffffffff
mem[9]: ffffffff
mem[10]: ffffffff
mem[11]: ffffffff
mem[12]: ffffffff
mem[13]: ffffffff
mem[14]: ffffffff
mem[15]: ffffffff
CourseNana.COM

page = 64 bytesoffset = 6 bits abcd1010 1011 1100 1101 CourseNana.COM

Remove offset:
1010 1011 11
00 1101 1010 1011 112af CourseNana.COM

Notes About Input page size: 32, 64, or 128 only CourseNana.COM

Number of memory accesses after which R bit is cleared cannot be 0 or negative. CourseNana.COM

We will not test your program with wrong inputs. CourseNana.COM

The Big Picture CourseNana.COM

Read entry from the file: virtual address and op CourseNana.COM

virtual addressvirtual page number (VPN) CourseNana.COM

Access page table using VPN Page exists in physical memory CourseNana.COM

Update R & M bits CourseNana.COM

Page fault CourseNana.COM

Physical memory has empty slot CourseNana.COM

Physical memory is full
Apply NRU (slides 14 and 15 in “Memory Management 3”) Update Page Table AccordinglyVery important step CourseNana.COM

Regarding NRU CourseNana.COM

Start from the beginning of physical memory (i.e. address 0) and go downward. CourseNana.COM

Victimize the page with lowest RM. CourseNana.COM

If more than one page have the lowest RM, then victimize the page in the lowest address of them. CourseNana.COM

What To Submit CourseNana.COM

Your source code: single file with the name vm.c Do not submit anything else. CourseNana.COM

Avoid The Following Mistakes (Penalty applied for each) CourseNana.COM

Late submission (-10% for each day for up to three days) CourseNana.COM

Output with different format (-10) CourseNana.COM

The work is not your own (zero!) CourseNana.COM

The code works on your machine but not on CIMS machines (zero!) CourseNana.COM

Test your code on one of the crunchy machines. That is, you need to ssh to access then to crunchy. CourseNana.COM

Excuses not Accepted I submitted the wrong file. CourseNana.COM

I submitted a bit after the deadline. CourseNana.COM

We highly suggest that you upload a version, even if not yet complete, each time you implement something and do not wait till you finish the whole program. CourseNana.COM

You are provided with one hour grace period. CourseNana.COM

One last thing CourseNana.COM

  • To help you start, we are proving you with a binary file that works as a reference. CourseNana.COM

    execute with: ./vmref filename page num CourseNana.COM

  • We are also providing you with another executable: CourseNana.COM

    genfile that can generate input files for you. execute with: ./genfile filename #entries CourseNana.COM

  • Important: These executable files will not run on your laptop. To use them, do the following: CourseNana.COM

    Copy them to the crunchy machines CourseNana.COM

    execute the following command first: chmod777./vmref
    chmod 777 ./genfile CourseNana.COM

CourseNana.COM

All the Best!  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
NYU代写,Virtual Machines: Concepts & Applications代写,C代写,NYU代编,Virtual Machines: Concepts & Applications代编,C代编,NYU代考,Virtual Machines: Concepts & Applications代考,C代考,NYUhelp,Virtual Machines: Concepts & Applicationshelp,Chelp,NYU作业代写,Virtual Machines: Concepts & Applications作业代写,C作业代写,NYU编程代写,Virtual Machines: Concepts & Applications编程代写,C编程代写,NYUprogramming help,Virtual Machines: Concepts & Applicationsprogramming help,Cprogramming help,NYUassignment help,Virtual Machines: Concepts & Applicationsassignment help,Cassignment help,NYUsolution,Virtual Machines: Concepts & Applicationssolution,Csolution,