I don't understand segmentation
So I'm reading about segmentation for x86, but I'm confused. If I understand correctly, each process is allowed 3 GB of total memory -- including code, stack, and heap:
LinuxDevCenter.com -- When Linux Runs Out of Memory
On the other hand, it sounds like Linux also uses _USER_CS and _USER_DS segment descriptors:
Section 2.3.* Segmentation in Linux
That makes it sound like the code and data segments *each* have 2^32 bytes of memory. For example:
"As an example, when the kernel invokes a function, it executes a call assembly language instruction specifying just the Offset component of its logical address; the Segment Selector is implicitly selected as the one referred to by the cs register."
Why should it need to use a segment selector if the code resides in the same 32-bit address space as the data?