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 ?
Currently wine seems to run on the following platforms: Linux version 2.0.36 or above FreeBSD 6.2 or later Solaris x86 2.5 or later NetBSD-current Mac OS X 10.4 or later I found almost no OS specific code for each of the architectures in the source. Are there special precautions to be taken in one of these OSes to be able to use the segment register in user land code ?
My last question is related to an AROS version hosted on Windows. Would Windows put any restrictions on the use of the segment registers for this purpose. Is there a difference between 32bit and 64bit ?
thanks, Staf.
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
On Wed, 07 Nov 2007 08:37:34 +0100, Marcus Meissner marcus@jet.franken.de wrote:
On Tue, Nov 06, 2007 at 10:17:12PM +0100, Staf Verhaegen wrote:
Hello wine developers,
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.
But the use of %fs by wine does not seem to conflict in any way with a possible usage of that segment register by the OS where wine is running on. Or is there some OS specific code that is handling it ?
greets, Staf.
On Wed, Nov 07, 2007 at 09:25:51PM +0100, Staf Verhaegen wrote:
On Wed, 07 Nov 2007 08:37:34 +0100, Marcus Meissner marcus@jet.franken.de wrote:
On Tue, Nov 06, 2007 at 10:17:12PM +0100, Staf Verhaegen wrote:
Hello wine developers,
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.
But the use of %fs by wine does not seem to conflict in any way with a possible usage of that segment register by the OS where wine is running on. Or is there some OS specific code that is handling it ?
No, it does not conflict. Your syscall / scheduler entry/exit points however need to take care to save/restore it correctly, otherwise you get interesting crashes ;)
Ciao, Marcus
On Thu, 08 Nov 2007 09:08:29 +0100, Marcus Meissner marcus@jet.franken.de wrote:
But the use of %fs by wine does not seem to conflict in any way with a possible usage of that segment register by the OS where wine is running on. Or is there some OS specific code that is handling it ?
No, it does not conflict. Your syscall / scheduler entry/exit points however need to take care to save/restore it correctly, otherwise you get interesting crashes ;)
Already big thanks.
Do you know where this code for these entry/exit points handling is located for the different OSes in the wine source code?
Does Windows/wine also have such entry/exit points so I could freely use %fs,%gs in AROS hosted on Windows?
greets, Staf.
On Sat, Nov 10, 2007 at 12:52:24PM +0100, Staf Verhaegen wrote:
On Thu, 08 Nov 2007 09:08:29 +0100, Marcus Meissner marcus@jet.franken.de wrote:
But the use of %fs by wine does not seem to conflict in any way with a possible usage of that segment register by the OS where wine is running on. Or is there some OS specific code that is handling it ?
No, it does not conflict. Your syscall / scheduler entry/exit points however need to take care to save/restore it correctly, otherwise you get interesting crashes ;)
Already big thanks.
Do you know where this code for these entry/exit points handling is located for the different OSes in the wine source code?
These are in the Operating System itself.
Linux: arch/i386/kernel/entry.S
Does Windows/wine also have such entry/exit points so I could freely use %fs,%gs in AROS hosted on Windows?
See above.
Ciao, Marcus