r/AskProgramming • u/ionixsys • Apr 16 '26
Architecture At a technical level, how does Linux Wine (Wine is not an emulator) work?
I know the purpose of prefixes, I know wineserver is generally the "Circus master" that does IPC and some of the heavy lifting, but how do you take a PE file, take the .text segment, and get it to actually execute? During the bootstrap phase I am guessing that wine takes the import table and connects what it can to the emulated/replicated libraries or does it do something easier? Also how do they get "MyWindowsProgram.exe" to be shown as its own process?
9
Upvotes
6
u/KingofGamesYami Apr 16 '26
https://gitlab.winehq.org/wine/wine/-/wikis/Wine-Developer's-Guide/Architecture-Overview
3
u/high_throughput Apr 16 '26
That's the easy part. A running process can change its name at any time:
1
u/wasabiiii Apr 16 '26
There's not really any magic here. An exe has instructions. They are x86/64, the rest is just loading things up in memory at certain places and basically reimplementing Windows libraries.
It's a shit ton of work. But it's not really like.... Special?
1
u/arihoenig Apr 17 '26
Wine is an emulator. That's the joke.
11
u/[deleted] Apr 16 '26
[removed] — view removed comment
1
u/[deleted] Apr 25 '26
[removed] — view removed comment