Hacker News new | ask | show | jobs
by tptacek 6090 days ago
Forget everything about the code, data, and stack segments.
2 comments

The confusion and the reason you got modded down is that people don't understand that the segmentation is still present in the CPU, but that common practice now is to overlay all segments as a single 4GB space.

In other words, if you really really insisted you could mess around with giving the segment registers different base values and / or lengths but you'd probably end up regretting it.

What do you mean?
He means that you don't need those anymore.

You used to need them (badly), especially on the smaller CPUs because otherwise you were severely limited in memory.

Check out the 'mixed models' that were pretty common usage in the 80's.

There were lots of them:

  code          data            model name
  under 64KB	under 64KB	Small (-ms) or Tiny (-mt)  
  over 64KB	under 64KB	Medium (-mm) 
  under 64KB	over 64KB	Compact (-mc) 
  over 64KB	over 64KB	Large (-ml) 
I was so happy when I finally got out of 'model hell' and could use 'flat' mode using DJGPP. Finally C programming without the headaches.

http://en.wikipedia.org/wiki/DJGPP

You're going to see a lot of references to segment selectors, and apart from the fact that FS may refer to thread information, you're never going to have to remember what any of it means. You can safely consider segmentation to be detritus.
Specialized segment prefixes mean jacksquat in an execution model with no specialized segments.