How does processor know about a process's address space
I was studying the linux virtual memory system.
Because I am reading it for the first time I have many confusions.
Linux maintains VMA and page table data structures corresponding to virtual address space of processes on the system. Through page tables it maintains the mappings from process virtual address space to physical address space.
It means that every process has an address range and if it tries to accss beyond it segmentation fault will occur.
okay so far its fine...
I had a doubt that when a process being executed by the processor then how will processor keep track of its virtual address space. Every time a process tries to access some particular address, for example process writes some data as mentioned by the following pseudo code:
STORE <value> <address>
Now how will processor verify that this address comes under its virtual address space or not?
After thinking a bit I made an understanding, Because processor accesses its own (hardware) page tables every time an address is accessed. In case no entry is found corresponding to any virtual address, processor will jump to the page fault exception handler of the kernel.
But after making this understanding I again had a doubt that does it mean that every time a process is scheduled for execution by the kernel , kernel also populates processor's page tables?
If yes, then does it mean that architectures which do not support paging hardware cannot run linux kernel? Or is it possible to run linux without VM on those architectures.
Please comment on it, if you feel that I making any wrong understanding about the kernel operation then please correct me.I would appreciate if you answer my questions point wise and at the same time apart from answering questions please write a descriptive text also.
Last edited by nitinarora; 07-09-2010 at 02:20 AM.