%fs, %gs on AROS hosted

Marcus Meissner marcus at jet.franken.de
Wed Nov 7 01:37:34 CST 2007

On Tue, Nov 06, 2007 at 10:17:12PM +0100, Staf Verhaegen wrote:
> Hello wine developers,
> I am an AROS developer (http://www.aros.org); that is an open source
> implementation of the old AmigaOS. It has also the possiblity to run
> hosted on other OSes and is thus very similar to wine. I know that this
> group is for wine posts but I think I could reuse much of the knowledge
> gained by the wine developers for AROS.
> Recently there has been discussion about the use of the %fs and %gs
> segment for AROS purposes and thus also for the hosted version.
> As wine also has to handle these registers, I am interested to know how
> wine handles these registers. Or doesn't wine have to take these registers
> into account ?
> I did download the 0.9.48 source code of wine and I only did find some
> places where a proper saving and restoring of these registers was done. Is
> there something I am overlooking ?

Win32 (and so Wine) uses %fs as the thread selector.

It needs to stay constant over process switches (as in "saved") and the base
virtual address must be settable.

Older Wines allocate a (LDT?) selector themselves for %fs, newer ones have it use
a GDT (?) slot.

%gs is not used in 32bit mode usually, but Win16 programs use it and so it should
be allocatable and savable too.

Ciao, Marcus

More information about the wine-devel mailing list