











































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












































Virtual Memory
The solution is Virtual Memory (VM)
Virtual memory
■
Solves problem of limited memory space
■
Creates the illusion that more memory exists thanis available in system
■
Two types of addresses in virtual memorysystems
–Referenced by processes
–Describes locations in main memory
■
Memory management unit (MMU)
address
The position and function of the MMU
Map (translate)virtual address to real
Virtual and real memory are divided intofixed sized
pages
Programs are divided into pages
A process address (both in virtual & realmemory) has two components
Physical Memory
Virtual Memory
Stack Heap Static Code
Divide into equal sizedchunks (“page” of about 4KB)
Any chunk of Virtual Memoryassigned to any chunk ofPhysical Memory
©Javaid Khurshid
64K Virtual
Memory
32K Real Memory
When process pages are transferredfrom VM to real memory, page numbersmust be mapped from virtual to realmemory addresses
This mapping is done by software &hardware
When the process is started only thefirst page (main) is loaded. Other pagesare loaded on
demand
Index of page table is the virtual page #
Page Table
0
Page frame # Page protectionReference bitModification bit
Validity bit
Page Table Entry
1 2 3 4 5 6 7 8
Validity bit is set when the page is inmemory
Reference bit is set by the hardwarewhenever the page is referred
Modified bit is set whenever the page ismodified
Page-protection bits set the accessrights (eg., read, write restrictions)
The virtual address issued by the processoris divided into two fields:
■
The virtual page number field and
■
The offset field.
If the number of bits in the virtual pagenumber field is
then the number of entries
in the page table will be 2
N
©Javaid Khurshid