I have gone through various online docs/videos to understand "Virtual Address, Virtual Address Space(VAS)" and so on but still few doubts mentioned below aren't yet clear.
1) When program is read from hard disk, CPU generates the "Virtual Address". So where does this virtual address resides? Is it resided into hard disk/RAM/Virtual Memory?
2) To execute, a program needs to be loaded into RAM, and CPU generates the virtual address for same. Do these activities(generating VA & loading into RAM) happen simultaneously or sequentially? If any, how does Kernel/MMU know which particular virtual address needs to be mapped to which physical address into RAM?
3) Paging is technique of Virtual Memory. Are page out/in & swap out/in same or different? If different, how?
4) pmap cmd on linux is VA to physical address representation?
5) If not, how to check VA & PA of a process on linux?
It will be really great & help if my above doubts get clear.