To make virtual memory concept simple, we need to remember few basic ground rules.
1. Linux visualizes its physical resource of memory
2. Process never ever directly address physical memory.
3. Instead Kernel associates each process with unique address space.
Memory Management happens in Linux using Page and Paging.
Kernel allocates unique Virtual Address Space to each Process. This Virtual Address Space is composed of Pages.
Two type of Pages we have
1. Valid Page : Its associated with Physical Page or Secondary storage like disk.
2. Invalid Page : Its unused, unallocated piece of Address space.
A program cannot use a page in secondary storage. It can use the page if it is associate with a page in physical memory.
Program -> Tries to access a Page on Secondary Storage -> MMU generate Page fault-> Kernel does Page-in the desired page from secondary storage to Physical memory.
Imagine a Process tries to access a page on secondary storage.
Since the page is not present, page fault occurs.
The Kernel intervenes and does Page-in the desired page to Physical memory from Secondary storage.
No comments:
Post a Comment