written 5.9 years ago by | modified 3.0 years ago by |
Subject: Operating System
Topic: Memory Management
Difficulty: High
written 5.9 years ago by | modified 3.0 years ago by |
Subject: Operating System
Topic: Memory Management
Difficulty: High
written 3.0 years ago by |
Page Table is a data structure used by the virtual memory system to store the mapping between logical addresses and physical addresses.
Logical addresses are generated by the CPU for the pages of the processes therefore they are generally used by the processes.
Physical addresses are the actual frame address of the memory. They are generally used by the hardware or more specifically by RAM subsystems.
The image given below considers,
Physical Address Space = M words
Logical Address Space = L words
Page Size = P words
Physical Address = log 2 M = m bits
Logical Address = log 2 L = l bits
Page offset = log 2 P = p bits The CPU always accesses the processes through their logical addresses. However, the main memory recognizes physical address only.
In this situation, a unit named as Memory Management Unit comes into the picture. It converts the page number of the logical address to the frame number of the physical address. The offset remains same in both the addresses.
To perform this task, Memory Management unit needs a special kind of mapping which is done by page table. The page table stores all the Frame numbers corresponding to the page numbers of the page table.
In other words, the page table maps the page number to its actual location (frame number) in the memory.
In the image given below shows, how the required word of the frame is accessed with the help of offset