Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
X86 memory segmentation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Later developments == The [[x86-64]] architecture does not use segmentation in long mode (64-bit mode). Four of the segment registers, CS, SS, DS, and ES, are forced to base address 0, and the limit to 2<sup>64</sup>. The segment registers FS and GS can still have a nonzero base address. This allows operating systems to use these segments for special purposes. Unlike the [[global descriptor table]] mechanism used by legacy modes, the base address of these segments is stored in a [[model-specific register]]. The x86-64 architecture further provides the special ''SWAPGS'' instruction, which allows swapping the [[kernel mode]] and [[user mode]] base addresses. For instance, [[Microsoft Windows]] on x86-64 uses the GS segment to point to the [[Win32 Thread Information Block|Thread Environment Block]], a small data structure for each [[thread (computer science)|thread]], which contains information about exception handling, thread-local variables, and other per-thread state. Similarly, the [[Linux kernel]] uses the GS segment to store per-CPU data. GS/FS are also used in [[GNU Compiler Collection|gcc]]'s [[thread-local storage]] and [[Buffer overflow protection#GNU Compiler Collection .28GCC.29|canary-based]] stack protector.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)