[Darwine] Re: Wine Emulation: Swapping functions

Robert Shearman rob at codeweavers.com
Wed Aug 25 13:14:49 CDT 2004

Jim White wrote:

> Mike Hearn wrote:
>>> I think you are going in the wrong direction with this; the right way
>>> IMO is to compile Wine for x86 and run the whole Wine+app under the
>>> CPU emulator. Otherwise you'll have to write wrappers for each of the
>>> 15,000 APIs.
>> Certainly dealing with the syscalls alone is a lot easier than 
>> flipping on every Windows API. You may wish to talk to TransGaming. 
>> They've actually *done* what you guys are trying to do, and run x86 
>> software/games on a Mac. IIRC they found it unworkable (due to 
>> endianness conversion) even when using virtualization software more 
>> advanced than QEMU, however they were focussing on games where 
>> performance is critical. So maybe it doesn't matter to you guys.
> I agree that flipping the syscalls is a much more promising approach 
> than the WIN32 API.  I'm also thinking that there is bound to be some 
> relevant code around aleady (perhaps even in QEMU).
> While the current phase of the Darwine effort is concerned with making 
> something that works, naturally performance is an important issue.  In 
> fact one of the architectural motivations for Darwine is that it will 
> be able to achieve much higher performance than approaches that 
> virtualize the OS (in addition to the objectives of not having to run 
> Windows).

The only way you will be able to use the Wine libraries compiled 
natively while running x86 executables will be to extend the current 
spec format so that it works similar to IDL files. You will also need to 
do generate wrapper code for each COM interface too. Also, there are 
limitations in what you can specify (and quirks such as off-by-one 
errors in Windows). Perhaps you would be able to special case these and 
be left with a manageable task, or perhaps not.
There is also the fact that the wrapper code for leaf functions may take 
longer to execute than the code itself. To get good performance out you 
will probably need to compile these types of functions (such as string 
manipulation functions in kernel32, shlwapi, user32) as x86.

Good luck with solving these issues (although I think the estimate of 
getting most programs that run on Wine working in 1 year that you stated 
in your interview is very ambitious).


More information about the wine-devel mailing list