[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
So what makes Windows Executables unable to run on Linux? Aren't
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 7
Thread images: 1
File: 1458466405546.gif (3 MB, 240x320) Image search: [Google]
1458466405546.gif
3 MB, 240x320
So what makes Windows Executables unable to run on Linux? Aren't the instructions x86 for both of the oses? What would need to be modified in Linux to make windows executables work? I assume it's more than just copying over the dlls from Windows, but what specifically is stopping someone from making a distro that can run exes?
>>
Different binary formats. Different ABI: calling conventions, incompatible syscalls. Does the caller or called clean up the stack? How many arguments are passed through registers?

Even if they had the same syscall convention: NT syscall 0x60 is NtAcceptConnectPort, Linux syscall 0x60 is gettimeofday.

Regardless, Wine doesn't need to change the kernel to achieve good compatibility (better than newer Windows in some cases).
>>
>>55261061
So what's stopping some cool /g/uy from changing the Linux source code to be compatible with what exe's need? A FOSS OS that runs windows exe's seems like it's be a pretty cool thing
>>
>>55261290
Wine basically does that and without changing Linux.
>>
m8 it's called Wine

If you want a OS, look for ReactOS
>>
>>55261370
Doesn't WINE have compatibility issues/lag with things like gaymes and more intensive programs? Either way an OS solution would be faster and more stable I'd imagine...
>>
Linux uses ELF, Windows uses PE. Linux does not, by default, know how to open a PE file. If you try to run an exec syscall on it, the kernel will say it's not an executable file, and toss it away. Fortunately, third party programs like Wine can open the file, and map the appropriate sections to allocated memory that has been given appropriate memory protections.

Windows programs all do system level shit by means of a couple of DLLs that use incompatible syscalls compared to Linux. Fortunately, Windows NT syscalls are rather undocumented (and allowed to change at any time!), so Windows programs have to call functions inside of DLLs, rather than making syscalls themselves. This is why Wine can work, at least half decently, rather than being completely broken. Rather than copying the Kernel32.dll and other relevant files from Windows, they implement the functions themselves so that, for example, when a program executes the WriteConsole() function in the DLL, it will actually use the write() syscall in Linux, rather than whatever Windows is using. Since no program is going to use the syscall instruction on its own, there's at least some possibility for compatibility.

That said, Wine is imperfect, and D3D is a bitch to implement, so you're still going to have some compatibility issues no matter what.
Thread replies: 7
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.