While studying about memory management, paging and segmentation there is a lot of usage of phrases like CPU generates logical addresses
and logical addresses are converted to physical addresses
etc. I know that the term physical address refers to actual RAM, but I do not have clear idea about what logical address is and where does it reside.
So my questions are:
- What is meant by
CPU generates logical address
? - Where do logical addresses reside (in RAM or somewhere else)?
Can anyone please explain these things.
Asked By : swdeveloper
Answered By : Ran G.
Well, this is the entire point of "virtual memory".
When your program runs, the OS makes it believe it has all the memory just for itself. That is, addresses 1 to 10,000 (say), are all empty and ready for this program to use. If you run two programs, each one of them gets its own space - each one can access address 1 to 10,000 without any interference between the programs.
Obviously, for this to work, the OS must perform some clever bookkeeping, mapping the programs' "virtual memory" into places in the real memory (or hard disk). That is, when the first program access cell 200, the information needs not be in cell number 200 in the real memory. It may be somewhere else, but the OS is responsible of converting the (virtual/logical address) "200" of the first program to some (real) address X, as well as the virtual "200" address of the second program, to some other (real) address Y.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/56494
0 comments:
Post a Comment
Let us know your responses and feedback