Page 129 - DCAP403_Operating System
P. 129
Operating System
Notes 7.2 Logical and Physical Address Space
A memory address identifies a physical location in computer memory, somewhat similar to a
street address in a town. The address points to the location where data is stored, just like your
address points to where you live.
In the analogy of a person’s address, the address space would be an area of locations, such as
a neighborhood, town, city, or country. Two addresses may be numerically the same but refer
to different locations, if they belong to different address spaces. This is similar to your address
being, say, “32, Main Street”, while another person may reside in “32, Main Street” in a different
town from yours.
Many programmers prefer to use a flat memory model, in which there is no distinction between
code space, data space, and virtual memory – in other words, numerically identical pointers refer
to exactly the same byte of RAM in all three address spaces.
Figure 7.2: Memory Management Unit
Main memory
Physical addresses
IOMMU MMU
Device addresses Virtual addresses
Device CPU
Physical Address
A physical address, also real address, or binary address, is the memory address, that is
electronically (in the form of binary number) presented on the computer address bus circuitry in
order to enable the data bus to access a particular storage cell of main memory.
Logical Address
Logical address is the address at which a memory location appears to reside from the perspective
of an executing application program. This may be different from the physical address due to the
operation of a Memory Management Unit (MMU) between the CPU and the memory bus.
Physical memory may be mapped to different logical addresses for various purposes.
Example: The same physical memory may appear at two logical addresses and if
accessed by the program at one address, data will pass through the processor cache whereas if it
is accessed at the other address, it will bypass the cache.
In a system supporting virtual memory, there may actually not be any physical memory mapped
to a logical address until an access is attempted. The access triggers special functions of the
122 LOVELY PROFESSIONAL UNIVERSITY