What's new

x86 Stack

blueshogun96

A lowdown dirty shame
Hey all. Any x86 experts out there? I was wondering where is the stack usually located on the x86 memory map (4GB, 32-bit, Protected Mode)? I know that SS normally points to that, but is it commonly located right after the data segment (DS)? I might have missed this in the Intel documentation, but I did look. Anybody have any idea? I kinda feel like a noob for asking this.. thanks though.

EDIT: Is it possible to assume it begins after DS? Or should it not matter for a system running in ring0?
 
Last edited:

Exophase

Emulator Developer
This doesn't have anything to do with the processor, it's up to the OS to decide where it goes since esp is for the most part just another general purpose register. OSes tend to put it at the top of the user address space, since it counts down. On Linux this should be 0xC0000000.

Also, in protected mode operating systems, usually all of the segments select regions that cover the entire 4GB space, in other words, "flat" addressing.
 

Top