Page Table in OS
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.
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week