Sunday, September 6, 2009

Subsequent expansion(8086)

The 80286's protected mode extended the processor's address space to 224 bytes (16 megabytes), but not by increasing the shift value. Instead, the 16-bit segment registers supply an index into a table of 24-bit base addresses, to which the offset is added. To support old software the 80286 also had a "real mode" in which address calculation mimicked the 8086. There was, however, one small difference: on the 8086 the address was truncated to 20 bits, while on the 80286 it was not. Thus real-mode pointers could refer to addresses between 100000 and 10FFEF (hexadecimal). This roughly 64-kilobyte region of memory was known as the High Memory Area, and later versions of MS-DOS could use it to increase available low memory.
The 80386 increased both the base address and the offset to 32 bits and introduced two more general-purpose segment registers, FS and GS. The 80386 also introduced paging. The segment system can be used to enforce separation of unprivileged processes in a 32-bit operating system, but most operating systems using paging for this purpose instead, and set all segment registers to point to a segment with an offset of 0 and a length of 232, giving the application full access to its virtual address space through any segment register.
The x86-64 architecture drops most support for segmentation. The segment registers still exist, but the base addresses for CS, SS, DS, and ES are forced to 0, and the limit to 264.
In x86 versions of Microsoft Windows, the FS segment does not cover the entire address space. Instead it points to a small data structure, different for each thread, which contains information about exception handling, thread-local variables, and other per-thread state. The x86-64 architecture supports this technique by allowing a nonzero base address for FS & GS.

No comments:

Post a Comment