0
votes

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.

1

1 Answers

0
votes

You are way off the mark. The CPU does not generate virtual/logical addresses. The operating system defines the page tables that translate logical addresses to physical addresses. The CPU interprets those table.

Paging and swapping are two different things. In paging, the individual pages of the process may be moved between memory and secondary storage. In swapping, the entire process is moved to between memory and secondary storage.

In the days before virtual memory and paging, swapping was the norm. Because processes tended to be small (around 32K) this was not as big a deal as it would be today when processes tend to use Gigabytes.