x86 Linear Address Space Paging Revisited

Last time we revisited x86 segment addressing, which translates logical-address into linear-address. As we mentioned earlier, two stages of address translation would be used to arrive at a physical address: logical-address translation and linear address space paging. Paging in x86 is optional and is controlled by CR0.PG. If paging is disabled (CR0.PG = 0), the linear-address would be mapped…

0

x86 Segment Addressing Revisited

Memory segmentation was first introduced to x86 family with 8086, to make it possible to access 1MB physical memory under 16bit addressing mode. Real Mode Logical address points directly into physical memory location. Logical address consists of two parts: segment and offset. Physical address is calculated as Segment * 16 + Offset, and if the…

0

Data Breakpoints

The Visual Studio debugger supports a kind of breakpoint called Data Breakpoint, sometimes it is also called watchpoint. Data breakpoint is architecture dependant, as it requires hardware support provided by CPU. For x86, this will be the DR (Debug Register). The following code demonstrates how to use the x86 debug register by implementing a very simple native debugger. #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <stdio.h>…

2