x86 system programming 1
本系列博客用来记录自己对x86体系结构的学习总结,同时方便大家查阅,节省大家学习的时间。
system-programming overview
一句话,(CPL=0), privileged software
1.1 Memory Model
- backward-compatible with legacy memory model.
- hardware-translation mechanisms for VA to PA.
- long mode, falt-memory model.
- legacy mode, the architecture implements all legacy memory models.
1.1.1 Memory Addressing
- Logical addr reference into a segmented-addr space Logical Addr = Segment Selector : Offset (Far pointers) ?
-
Effective addr, or segmetns offsets, which are a portion of the logical addr Effective Address = Base + (Scale x Index ) + Displacement (Near pointers) ?
-
linear(virtual) address Linear Address = Segment Base Addr +Effective Address
- Physical addr
1.1.2 Memory Organization
Virtual Memory
- Protected Mode (32bits virtual addr)
- Long Mode (64bits virtual addr) Physical Memory
- Real-Address Mode real mode, 1M bytes of physical address space using 20bits physical addr.
- Legacy Protected Mode
- Long Mode
1.2 Memory Management
Written on September 27, 2017