with reference to following questions
1 How are the different segments like heap, stack, text related to the physical memory?
2 memory allocation in data/bss/heap and stack
3 how does a program runs in memory and the way memory is handled by Operating system
4 How convert address in elf to physical address
especially in question 1 what is asked to clear still needs experts comments.
at the same time different answers/comments in opposite directions making this more confusing. what we know is that elf is loaded in virtual address space and when needed the actual physical page, process is provided with that page by MMU. I have severe doubts about this. if mappings are only made in virtual address then how execution is started? one possibility is that segments from elf binary are loaded into virtual address space and an empty pagetable is also created which is populated on page faults on each memory access. And in this population there is no role of ELF binary stored on disk.I can delete my elf stored on disk with out effecting execution?
if above understanding is right confusion lies in lack of knowledge on our side about virtual memory. As VM is considered deception but it seems it is more than that. lets say int x=12 when this line is loaded in virtual space it means there is record keeping for value of x (12) in VM. when some instruction mov x,register is executed for the first time, a page is created in RAM only to give actual space to make this instruction run?
After noticing the reputation scores of mine and others with similar question even if this is basic question, this concept is creating a lot of confusions for me at least.