lab4: virtual memory

6
Lab4: Virtual Memory CS 3410 : Computer System Organization & Programming Spring 2014

Upload: etana

Post on 04-Jan-2016

42 views

Category:

Documents


0 download

DESCRIPTION

Lab4: Virtual Memory. CS 3410 : Computer System Organization & Programming Spring 2014. Single vs. Multi Level Page Table. Directory. Multi-Level Page Table. Single-Level Page Table. Wrap-up : Address Translation. Lab 4 : C Operator Exercise. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lab4: Virtual Memory

Lab4: Virtual Memory

CS 3410 : Computer System Organization & Programming

Spring 2014

Page 2: Lab4: Virtual Memory

Single vs. Multi Level Page Table

Single-Level Page Table Multi-Level Page Table

Directory

Page 3: Lab4: Virtual Memory

Wrap-up : Address Translation

Page 4: Lab4: Virtual Memory

Lab 4 : C Operator Exercise

• Leftshift a variable A to the left by 5 bits and store it in A.A = A << 5;

• Rightshift a variable A to the left by 5 bits and store it in A.A = A >> 5;

• AND, OR, and XOR two variables and store them into a third variable.

z = x & y; z = x | y; z = x ^ y;• Change a variable into its negation.

z = ~z;

Page 5: Lab4: Virtual Memory

Lab 4 : Virtual Memory

• What to implement (vmem.c)– create_address_space()– map_page()Optional:– map_shared_page()– pfault()

• Where to start with– Start from reading ‘mem.h’– Each function in vmem.c has headers in mem.h which

has comprehensive comments on what to do.

Page 6: Lab4: Virtual Memory

Lab 4 : Virtual Memory

• Useful Physical Memory API functions– Headers provided in mem.h, implementations

provided in pmem.c• allocate_physical_page()• dereference_physical_page(unsigned int ppn)

• Debugging Tools– gdb debuggers– Function : dump_physical_memory()