When will Wine integrate an x86 CPU emulator?

Kelly Leahy kellyleahy at swbell.net
Wed Aug 20 17:08:12 CDT 2003

Ok.  I can agree with that.  I'm not sure that "emulator" is the best term
for this, but it'll have to do unless someone has an alternative.

I don't think this would be as hard as it sounds, if the .spec files could
be used to describe all of the parameters and calls to the API functions.
The "emulator" (probably better termed an interpreter) would need to
intercept all CALL instructions and JMP instructions and have some way of
knowing the difference between native and x86 code (for the purpose of
determining where the CALLs are going to).

A better way to do this would be to write an emulator that is invoked by
wine when a binary is targeted to x86 and is loaded for running on a non-x86
machine.  The emulator could, when resolving dynamic links to the dlls,
provide an x86 implementation of the function that merely packages the
parameters up for calling to the native "real" implementation of the

It would even be possible to write a "proxy" wine-x86 for running under an
emulator that implements the really simple stuff (that would be slow to
implement natively, due to cross-CPU (emulator vs. native) issues) in x86
code, but makes native calls for more complicated stuff using some
non-CPU-specific method (like RPC, sockets, etc.) that is supported by both
the emulator and the host system.


----- Original Message ----- 
From: "Ulrich Weigand" <weigand at i1.informatik.uni-erlangen.de>
To: "Kelly Leahy" <kellyleahy at swbell.net>
Cc: <wine-devel at winehq.org>
Sent: Wednesday, August 20, 2003 4:36 PM
Subject: Re: When will Wine integrate an x86 CPU emulator?

> Kelly Leahy wrote:
> > While writing an x86 emulator (and integrating it into wine) would be
> > difficult, I don't see how the complexity has anything to do with the
> > types and API functions...  A true emulator has no concept whatsoever of
> > data types (except the very basic data types of the cpu - x-bit word,
> > IEEE number, for instance), so its complexity cannot possibly depend on
> > high-level data types used by the compiler generating the machine
> This is true when you run the whole application, i.e. the Wine parts
> with the Windows binaries, under an emulator.  However, to do so you don't
> need to integrate the emulator into Wine, but you can just run the whole
> Wine process under an external emulator like qemu.
> The only reason for wanting to integrate an emulator into Wine is that
> would allow to run the Wine components natively, and only switch to the
> emulator for executing Windows binaries.  However, for this to work means
> that on every cross-call from Wine to Windows code or vice versa we need
> to transition into or out of the emulator; and this involves converting
> all arguments and return values of such calls between the Windows/x86
> format and the native format of the host.
> Bye,
> Ulrich
> -- 
>   Dr. Ulrich Weigand
>   weigand at informatik.uni-erlangen.de

More information about the wine-devel mailing list