3 ms·
Funny enough, when I was younger and more naive, I attempted to write a Linux kernel implementation of Win32, starting with a PE binfmt and linker. Never got mu
by jchw 9y ago
Funny enough, when I was younger and more naive, I attempted to write a Linux kernel implementation of Win32, starting with a PE binfmt and linker. Never got much of interest working because I had trouble dealing with syscalls.
But I realized over time that it wasn't actually a good idea. Linux and Windows have one hell of an impedance mismatch. Windows distributes the user-space and kernel-space dramatically differently from Linux. The Linux VFS layer is greatly different than the Windows filesystem layer, and related semantics. Windows likes UTF-16 APIs, Linux likes UTF-8. They do threading differently, Winsock is extremely broken, named pipes don't work like netlink sockets, Windows is a little bit country, Linux is a little bit Rock'n'roll...
I'm sure someone with more experience can list off more. Even the general ecosystems are entirely different. A lot of things on Windows are kind of 'defacto.' Like, wintab32.
At the end of the day, the hacks that Wine does to make things work are astoundingly small compared to the massive undertaking they have reimplementing Windows in a fashion that is useful. You could go in with the logic of trying to be 'as Windows as possible' and use as much of the Windows libraries as you can, but how are you going to deal with things at that level, when Windows puts GDI and RPC in the kernel and Linux has it as userspace daemons?