I have read in the Galvin book that Switching the cpu from one process to another process requires preserving the address space of the current process.Why this address space need to be preserved?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By address space I think you are trying to ask why the page table of a process needs to be saved, when there is a context switch.
Well imagine that when a process is context switched virtual page 100 is mapped to physical page 400.this information is saved in the page table corresponding to this process.If this table is not saved when it is context switched , the next time this process is scheduled to run how will we know where the virtual page 100 is mapped in the physical space.Saving the page table gives you this information on the virtual to physical address mappings.
In reality what happens is that when a context switch takes place , a register (cr3) on x86 holds a pointer to page table and this points to a new table when there is context switch, so that the virtual to physical mapping of the new process is available when we do address translations.