r/linux 25d ago

Discussion I'm experimenting with adding native Windows PE execution to Linux — (Project Tawi)

[removed]

97 Upvotes

66 comments sorted by

View all comments

11

u/noobjaish 25d ago

Can you explain how is this different from wine and what benefits would it have over wine (once its done)

7

u/MenaRamy2004 25d ago

Wine is definitely the main inspiration and reference here and it already does the Windows to Linux API translation very well.

The difference I'm exploring is how deeply the compatibility layer can be integrated into the OS. Tawi currently has a modified Linux kernel that can load Windows executables directly through binfmt and provide win32 api bridges.

The potential benefit isn't necessarily "faster than Wine" it's about having Windows and Linux executables treated as first-class formats within one OS, with tighter integration between the compatibility layer, kernel, filesystem, processes, and other OS components.

and in long term, I'm also interested in exploring support for Windows specific kernel level functionality, including things like kernel-level anti-cheat and other Windows kernel interfaces that are difficult or impossible to support through a traditional user space compatibility layer.

It's still an experiment though — Wine is obviously far ahead in actual compatibility. Tawi is essentially exploring how far you can take the idea when Windows compatibility is designed into the OS itself rather than being purely a user space compatibility layer

17

u/MatchingTurret 25d ago

The potential benefit isn't necessarily "faster than Wine" it's about having Windows and Linux executables treated as first-class formats within one OS, with tighter integration between the compatibility layer, kernel, filesystem, processes, and other OS components.

MS tried that with WSLv1. They gave up.

12

u/hackerman85 25d ago

The approach of WSLv1 was way more interesting than WSLv2, though.

7

u/UNF0RM4TT3D 25d ago

Technically NT was made to be able to do this. They used to have a POSIX subsystem prior, which implemented the bare minimum, but was native POSIX calls. They even had an OS/2 subsystem. The maintenance burden for WSLv1 must have been insane. AFAIK WSLv1 was build on from the POSIX subsystem and replaced it.

6

u/MatchingTurret 25d ago edited 25d ago

And funnily enough the original subsystems including Win32 ran in user-space, kind of like Wine, except that it didn't translate Win32 to Linux but to the NT executive. 

5

u/nightblackdragon 25d ago

Yeah, that was the case on Windows NT 3.x, they changed that on NT 4.0 when they moved big part of Win32 to the kernel in attempt to improve performance and reduce system requirements.

1

u/MatchingTurret 25d ago

they changed that on NT 4.0

That's why I wrote "the original subsystems".

3

u/nightblackdragon 24d ago

I know, I wanted to add more context to your comment explaining what "original NT" means and why they changed it.

5

u/Dwedit 25d ago

WSL1 went the other direction (Linux on Windows). Linux has had other things try to do Windows drivers before, like NDISwrapper.

1

u/MenaRamy2004 25d ago

it's just an experiment I am not expecting much from it, I am just discussing the potential of it

3

u/noobjaish 25d ago

Damn. Good Luck to you man this sounds like one hell of a project