I am trying to read Intel software developer manual to gain some understanding how operating system works and these four addressing terms is confusing me . Here is what i have understood, correct me if I am wrong.
linear address : What appear to a isolated program a long string of memory which start with address 0. all the segment of that program will be addressed from its linear address. It may be in the ram or in the disk.
physical address : Address that appear in the ram or main memory pins .
logical address : Combination of swap memory in the disk and ram . All the linear memory for all the program will stay in logical address space.It can be only used by kernel mode. The translation from logical to physical address is done by internal hardware.
virtual address : Virtual address is same as linear address. It will be only used by user mode in the operating system. Operating system will map virtual address from logical address.
The linear address space denotes all addresses that can be formed on the system. An address for any byte in linear address space is called a linear address. Todays system have around 46 bits of memory bus width, which corresponds to a linear address space of around 64 TiB. Intel only uses this term in its flat memory model.
The memory that the processor addresses on its bus is called physical memory. Each byte is assigned a unique address, called a physical address. It should be noted that in addition to the memory, memory-mapped I/O devices are also connected to this bus and can be addressed. This memory area also does not have to be contiguous, the memory controller here assigns the physical addresses to individual memory bars and devices.
Paging now adds virtual address spaces: each program is assigned its own linear address space. Some addresses in this address space are valid, others are not. valid addresses refer to data that may be in the physical memory but also to outsourced data on a hard disk (swap files). The translation is done in hardware by the MMU (Memory Management Unit) together with the TLB (Translation Lookup Buffer) or by the operating system. It is also possible that this data does not exist at all and is only generated when accessed, but this leads too far here. Let us note that these are the virtual addresses.
Logical addresses are a term that intel uses in the segmented memory model: there the memory is divided into segments. To address a byte in a segment, a logical address is used. This consists of a segment selector and an offset. Logical addresses are converted into virtual addresses using the segment selectors: The selector contains the beginning of the segment and its size. If the offset is larger than the size of the segment, the address is invalid. Adding the beginning of the segment to the offset gives you the virtual address. This segmented memory model was largely abolished in 64bit mode.
Summary
Logical Addresses -> Virtual Addresses -> Physikal Addresses
Virtual addresses and physical addresses are linear addresses, but not the other way around.
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With