fs and gs register question (intel)

Michael L. Galbraith (mikeg@mikeg.weiden.de)
Fri, 29 Nov 1996 07:00:33 +0100 (MET)

The kernel no longer pushes/pops the gs and fs registers - but...

__asm__ __volatile__("mov %w0,%%fs ; mov %w0,%%gs ; lldt %w0"
__asm__("mov %%gs,%0":"=r" (dump->regs.gs));
"xorl %%eax,%%eax; mov %%ax,%%fs; mov %%ax,%%gs\n\t"
__asm__("mov %w0,%%fs ; mov %w0,%%gs":"=r" (seg) :"0" (seg));

I'm appearently missing something here - when/where are these registers
saved/restored? It seems to me that this guarantees catastrophe.

So - since my little box isn't retching (much) - what am I missing?

scritch scritch baffle