What are they for and what are they used for by Windows and Linux.
The initial intention of the segment register was to allow the program to access many different (large) memory segments, which were supposed to be independent and part of a permanent virtual storage. The idea was taken from the 1966 Multics operating system , which processed files as simply addressable memory segments. There is no BS “Open file, write record, close file”, just “Save this value in this virtual data segment” with dirty page cleaning.
Our current 2010 operating systems are a giant step backwards, so they are called eunuchs. You can access only one segment of the technological space by providing the so-called "flat (IMHO dim) address space". Segment registers on the x86-32 machine can still be used for real segment registers, but no one was worried (Andy Grove, former president of Intel, had a fairly well-known social approach in the last century, when he realized that all these Intel engineers spent energy and his money to implement this function that no one is going to use it. Go Andy!)
AMD, having switched to 64 bits, decided that it does not matter to them whether they excluded Multics as a choice (that charitable interpretation, homely, they do not know about Multics) and therefore disabled the general capabilities of segment registers in 64-bit Mode. There is still a need for threads to access the local thread store, and each thread needs a pointer ... somewhere in the direct accessible state of the thread (for example, in registers) ... for local storage. Since Windows and Linux used FSand GS (thanks Nick for the clarification) for this purpose in the 32-bit version, AMD decided to use 64-bit segment registers (GS and FS), essentially only for this purpose (I think you can force point them anywhere in your process space; dunno if the application code can load them or not). Intel in their panic did not lose their 64-bit AMD market share, and Andy, who retired, decided to simply copy the AMD circuit.
It would be architecturally prettier IMHO, so that each thread memory card had an absolute virtual address (for example, 0-FFF say), which was its local stream store (register pointer [segment] is not required!); I did this on an 8-bit OS back in the 1970s, and it was very convenient, for example, to have another large register stack to work with.
So, segment registers are now similar to your application. They serve a rudimentary purpose. To our collective loss.
Those who do not know history are not doomed to repeat this; they are doomed to do something ridiculous.