[轉] Real Mode & Protected Mode Memory Addressing

出處:http://www.ece.unm.edu/~jimp/310/slides/micro_arch2.html

Protected Mode Memory Addressing

Segments
are interpreted differently in Protected Mode vs. Real Mode:
Segment register
contains a selector that selects a descriptor from the
descriptor table.
The descriptor contains
information about the segment, e.g., it’s base address, length and access
rights.
The offset can be
32-bits.
======================================
Introduction to Big Real Mode 
出處:ftp://ftp.heanet.ie/mirrors/sourceforge/h/hw/hwtools/Documents/Introduction_to_Big_Real_Mode/Introduction_to_Big_Real_Mode_CHT_.pdf
在 real mode 中, CPU 最後實際存取 Memory 的位置 (Physical Address 或 Linear Address), 
是透過 Segment
Address 向左 Shift 4
bits, 然後加上 Offset
Address 來計算.

故 real mode 的 address space range 是從 0_0000 ~ F_FFFF, 也就是只能組合出 1MB 的空間.

而在 protected
mode (或 big real
mode) 中, 原 real mode 中的 “segment register” 換了個名稱與定義, 改稱作 “segment selector”. 

而這個 “segment selector” 將不是直接填寫 Address, 而改為載入 Segment
Descriptor 在 GDT Table 裡面的 Offset Address.

而 Segment
Descriptor 內將會含有 Base
Address 這個欄位, 用以說明 Segment 起始位址.故將 Segment
Descriptor 內之 Base
Address, 加上 Offset
Address 後, 便是實際 CPU 所將存

取的 Memory 位置 (Physical Address 或 Linear Address).
未經允許不得轉載:GoMCU » [轉] Real Mode & Protected Mode Memory Addressing