Logical Address->Linear Address->Physical Address

3 registers for starting pos:

LDTR, GDTR( register for starting addr of DT)

---段描述符
每个段由一个8字节(64位)的段描述符来描述,他表示段的各项属性。段描述符放在叫全局描述符表(Global Descriptor Table:GDT )或局部描述符表(Local Descriptor Table:LDT)中。GDT和LDT可以理解为数组。而段选择符里的索引是用于选择在这个数组当中的元素。
如:GDT[index],表示GDT中第index个段描述符。

CPU当中有两个特殊控制器gdtr和ldtr分别存储GDT和LDT的地址

CR3(control register for starting addr of Page directory)

内核先将当前任务的页目录表的物理地址填入cr3寄存器。

Descriptor table structure:

Base address: A 32-bit integer that defines the starting location of the segment in the 4 GByte
linear address space.
Privilege level: Each segment can be assigned a privilege level between 0 and 3, where 0 is the
most privileged, usually for operating system kernel code. If a program with a higher-numbered
privilege level tries to access a segment having a lower-numbered privilege level, a processor fault
is generated.
Segment type: Indicates the type of segment and specifies the type of access that can be made
to the segment and the direction the segment can grow (up or down). Data (including Stack) segments
can be read-only or read/write and can grow either up or down. Code segments can be
execute-only or execute/read-only.
Segment present flag: This bit indicates whether the segment is currently present in physical
memory.
Granularity flag: Determines the interpretation of the Segment limit field. If the bit is clear,
the segment limit is interpreted in byte units. If the bit is set, the segment limit is interpreted in
4096-byte units.
Segment limit: This 20-bit integer specifies the size of the segment. It is interpreted in one of
the following two ways, depending on the Granularity flag:
• The number of bytes in the segment, ranging from 1 to 1 MByte.
• The number of 4096-byte units, permitting the segment size to range from 4 KByte to 4 GByte.

Descriptor table structure:

Page directory: An array of up to 1024 32-bit page-directory entries.
• Page table: An array of up to 1024 32-bit page-table entries.
• Page: A 4 KByte or 4 MByte address space.
To simplify the following discussion, we will assume that 4 KByte pages are used:
A linear address is divided into three fields: a pointer to a page-directory entry, a pointer to a
page-table entry, and an offset into a page frame. Control register (CR3) contains the starting
address of the page directory. The following steps are carried out by the processor when translating
a linear address to a physical address, as shown in Figure 11–9:
1. The linear address references a location in the linear address space.
2. The 10-bit directory field in the linear address is an index to a page-directory entry. The pagedirectory
entry contains the base address of a page table.
3. The 10-bit table field in the linear address is an index into the page table identified by the
page-directory entry. The page-table entry at that position contains the base location of a page
in physical memory.
4. The 12-bit offset field in the linear address is added

下面来源:

Linear adress and physical address

Linear address is generated after page table mapping. Physical addres is generated before page table mapping(ie paging).

Linear Adress,created by adding logical address to the base of segment, CS,DS,ES,SS,FSor GS.

When Paging is enabled, the page tables are used to translate linear address to physical address.

On the Other Hand, Physical Address is nothing but, the address value that appears on pins of processor during a memory read/memory write operations.

InShort, we can say if paging is disabled linear address = physical address

时间: 2024-12-13 14:01:18

Logical Address->Linear Address->Physical Address的相关文章

Linear to physical address translation with support for page attributes

Embodiments of the invention are generally directed to systems, methods, and apparatuses for linear to physical address translation with support for?page attributes. In some embodiments, a system receives an instruction to translate a memory pointer

logical vs physical address

Logical vs physical address  1) An address generated by the CPU is a logical address. Whereas, an address seen by the memory unit, that is, the one loaded into the memory-address register of the memory, is a physical address. 2) The user program neve

[转载]PAE ( Physical Address Extension )

转自:http://blog.chinaunix.net/uid-20384269-id-1954602.html 首先,内存访问和管理是一个跨越应用程序,操作系统,硬件平台的一个复杂过程,不能单纯的讲32bit系统就支持4G内存,从而认为这个过程只是OS和内存两者之间的关系 理论上:32位系统,32bit的地址总线位数,寻址空间2^32B=4GB. 64位系统,寻址空间2^64. 至于在实际应用环境中,对于有4G物理内存而OS最多只能识别3G的情况,主要是主板的问题,丢掉的内存被PCI设备占用

Inet Address和Inet Socket Address类

Inet Address类: 封装计算机的IP地址,不包含端口号 Inet Socket Address类: 此类用于实现IP套接字地址(IP地址+端口号),用于socket通信 代码示例: package aaa; import java.net.InetAddress;import java.net.UnknownHostException; public class TestInetAddress { public static void main(String[] args) throw

PatentTips - Supporting address translation in a virtual machine environment

BACKGROUND A conventional virtual-machine monitor (VMM) typically runs on a computer and presents to other software the abstraction of one or more virtual machines. Each virtual machine may function as a self-contained platform, running its own "gues

Virtual address cache memory, processor and multiprocessor

An embodiment provides a?virtual?address?cache?memory including: a TLB virtual?page memory configured to, when a rewrite to a TLB occurs, rewrite entry data; a data memory configured to hold?cache?data using a?virtual?page tag?or a page offset as a?c

Method, apparatus, and system for speculative abort control mechanisms

An apparatus and method is described herein for providing robust speculative code section abort control mechanisms. Hardware is able to track speculative code region abort events, conditions, and/or scenarios, such as an explicit abort instruction, a

Snoop resynchronization mechanism to preserve read ordering

A processor employing a post-cache (LS2) buffer. Loads are stored into the LS2buffer after probing the data cache. The load/store unit snoops the loads in the LS2?buffer against snoop requests received from an external bus. If a snoop invalidate requ

Method and apparatus for loading a segment register in a microprocessor capable of operating in multiple modes

A microprocessor contains an address generation unit, including a segment block, for loading?descriptor?data and a segment selector in a segment register. Two?descriptor?loads from a?global?descriptor?table?(GDT) and a local?descriptor table?(LDT) ar