There is something about AS in Linux(1)
AS = ADDRESS SPACE
I will try to present, in intuitive and accessible manner, the addresse space and some issues related to it.
please remember this:
Each process is assigned a physical memory region or physical address space.
At some moment, here is the physical memory layout:
But the OS with some hardware support (CPU) will offer, instead, a beautiful and neat memory illusion for each process:
For example the process A would get the illusion that it is living in the following virtual address space (logical address space) :
The process A "thinks" it is loaded into memory at a address 0.
But as we saw before, the processes' physical address spaces are actually :
Thus each process has its own virtual address space which gets mapped to physical memory by the operating system (with serious CPU help).
And now magic happens! Sorry for this over simplification:
The generic technique uses by OS ( +CPU) is called address translation: mapping the VA to PA
- PA:=Physical address
- VA:= Virtual Address
The "process table" is an important data structure at the OS's disposal. The OS allocates entry for each resident process!
Suppose process A needs update its variable x. We suppose the variable x is living at the VA address 2K ( Process A's perspective):
- VA(x) =2K
Before updating the variable x, OS needs to translate VA to PA! it should ensure first that the virtual address of x is a legal address.
The OS with serious help from hardware will do:
What if the VA(x) is out of the range [0K, 4K]?:
The OS will be offended by the process A, and would consider the access as illegal : As a result, the OS will kill the process A and free the A's entry from the process table.
Any question? please let me know!
Happy OS!