How do WINE and Proton work for running Windows applications/games on Linux?

234 views

How do WINE and Proton work for running Windows applications/games on Linux?

In: 2

4 Answers

Anonymous 0 Comments

That’s a bit more complex but since this is ELI5 I will try to really simplify it:
Imagine Windows and Linux as two different languages. Let’s take English and German for this example.
Windows = Englisch and Linux = German
If a Programm now says
“Add 10 and 23 and display that number on the screen” Windows would understand what is meant while Linux (our German guy) will throw a fit because you make no sense. Same thing would happen if the program would say “Addiere 10 und 23 und zeichne das Ergebnis auf dem Bildschirm” just this time Windows would have no idea what to do.
WINE and Proton work as the equivalent to Google Translate.

Anonymous 0 Comments

This is a bit oversimplified but should cover it.

When people write computer programs, they use “libraries” that give names to pieces of code that do things.

So let’s say someone used some code on Windows named “DrawRectangle”. Obviously that code would do something to draw a rectangle on the screen. The code that actually does that is part of Windows and located in special files called “libraries”. When the person writes their program, a tool called a “compiler” makes sure everything looks good and when it sees the “DrawRectangle” part, it generates some instructions that tell Windows what library should have the file and the name of the code to run.

So if you try to run the program on Linux, it might start running, but as soon as it gets to “DrawRectangle”, things go wrong. Linux doesn’t have that Windows library, and even if it did the way to draw a rectangle on Linux is probably different so the Windows code wouldn’t work anyway.

Wine and tools like it takes advantage of that the program is really only saying “please run the code named DrawRectangle in this library”. They wrote their own library with a DrawRectangle method that does the right thing on Linux. When you run a program with Wine, it sets things up so when Linux sees “Call DrawRectangle in this Windows library”, instead it will do “Call DrawRectangle in this Wine library”. Since the Wine library is made to work on Linux, it works.

That was a lot of work, though. There are hundreds of Windows libraries with thousands of bits of code that had to be implemented. Not all of them are documented, so sometimes the Wine people had to guess what they are supposed to do.

Put more simply:

Used to we had phone books. So if you wanted to call Pizza Hut in Tallahassee, FL, you looked in the Tallahassee phone book for the Pizza Hut location with the address you want.

Later, if you wanted to call Pizza Hut in Houston, TX, you looked for “Pizza Hut” in the Houston phone book for a location with the address you want.

Windows is like the Tallahassee phone book. It’s got a Pizza Hut’s number. Wine is like the Houston phone book. It ALSO has a phone number for a Pizza Hut. It’s just a different number because you’re in a different city.

The program’s just saying, “I need to call Pizza Hut” and doesn’t care what phone book it gets. When it gets a phone book, it looks for “Pizza Hut” and calls the first number it sees.

Anonymous 0 Comments

Both Windows and Linux runs on the exact same computer. So there is no need to emulate any hardware. So there is not theoretically any performance issues running Windows applications on Linux. Even the libraries used by the applications are mostly the same as there are usually both Windows and Linux code for most libraries.

There are however a few differences. The way the executable are loaded is slightly different. It is not only different file formats but there is a difference in how libraries are merged into the application. This is things that the core WINE project solves. In addition to this there are unique libraries to Windows which does not exist natively on Linux. For example all the interactions with the kernel is different, file systems behave differently, etc. So there are a lot of Windows libraries which have to be remade as a Linux variant. This is where a lot of the work in WINE have gone into.

In general games do not use much system libraries. However they rely heavily on the graphics API which is implemented by the graphic card drivers. It is easy for games which use open source APIs like OpenGL and Vulcan as these are implemented by the Linux graphics card drivers as well. However others like DirectX is proprietary for Windows. So a big challenge for running Windows games on Linux have been to implement the graphics drivers that are proprietary. There are some of these in WINE already but Proton have implemented even more of them and they offer better performance and compatibility.

Anonymous 0 Comments

there is more than one way of getting to a destination

there is the most common interstate way

but there is also the backroads way