Types of Memory Address

From The Linux Memory Wiki

Jump to: navigation, search

Before we start, there is some important concept of memory address that need to be explained. When talking about memory address, there are 3 types of memory address that refer to different thing: the logical address, linear address and physical address.


Logical Address

This is the address we use when programming or looking at code in assembly instructions. The address of instructions such as jump are refered in logical address. The logical address is a consequence of the segmentation technology introduced by Intel during 16-bit era. in x86 a logical address is consist of a 16-bit segment and a 32-bit offset.


Linear Address

The logical address will be translated into physical address by the CPU segmentation unit. This is basically the entire address range a software can see. We may view the linear address in this way: a same logical address that is refered in different places in a program may be translated into different linear addess.

For example, jmp 0x058690 may be translated into 0x278690 while lw %eax, 0x058690 may be translated into 0x558690.

The linear address is also been refered to as virtual address, typically in intel documentation.


Physical Address

All program runs in the linear address space. So when the program talks about an addess 0x123456, where exactly is this address in the ram? A linear address will ultimately be translated into the physical address. A physical address points directly to the memory units in the RAM chip, hence when you see a physical address, you can tell which cell in the RAM contain the address.



Note that most of the time the same memory may be located at completely different address in each 3 types of address.

For example, if you see an assembly jump instruction jmp 0x100204, before this instruction runs it may be translated into linear address 0x201204 which normally obtained by simple addition, then finally it becomes the physical address jmp 0x401720 when the cpu sees and execute this instruction.


The first step of translating logical address into linear address is called segmentation. The second step of translating linear address into physical address is called paging.


Next we will discuss about how these translation takes place and why we need them.


Prev: Prerequisite
Next: Logical Address and Segmentation
Advertisement