|
|
Subscribe / Log in / New account

Emulating Windows system calls in Linux

Emulating Windows system calls in Linux

Posted Jun 26, 2020 14:09 UTC (Fri) by pm215 (subscriber, #98099)
In reply to: Emulating Windows system calls in Linux by pbonzini
Parent article: Emulating Windows system calls in Linux

That would work, but it's not the approach suggested at the top of this comment thread, which includes "The ptracer looks at the code around the syscall and if it matches certain common patterns, we patch it with a jump to a stub"... (You don't need to runtime-patch the wine libraries -- wine controls that code so it can just be built to do whatever.)


to post comments

Emulating Windows system calls in Linux

Posted Jun 26, 2020 15:03 UTC (Fri) by pbonzini (subscriber, #60935) [Link]

Yes, the core idea though is the same, distinguishing trapped and pass-through system calls from the address.

Emulating Windows system calls in Linux

Posted Jun 26, 2020 21:05 UTC (Fri) by roc (subscriber, #30627) [Link] (2 responses)

Wine uses glibc and a bunch of other system libraries which do need to be patched. Those libraries aren't trying to stop us patching them, but they're not providing any hooks to avoid the need for patching, either.

Again: you don't need to patch the tricky game code with this approach ... as long as you can tolerate those syscalls being slow.

Emulating Windows system calls in Linux

Posted Jun 28, 2020 19:04 UTC (Sun) by NYKevin (subscriber, #129325) [Link] (1 responses)

> as long as you can tolerate those syscalls being slow.

I imagine this will depend on the game. If it's isolated into a bunch of small levels with loading screens between them, well, the loading screens will suck, but the rest of the game should basically work most of the time, assuming the game engine isn't trying to do something weird (like constantly telling the OS which pages to evict first).

But if it's an open world game that dynamically loads stuff in and out of memory all the time, then you're in trouble.

Emulating Windows system calls in Linux

Posted Jul 3, 2020 13:28 UTC (Fri) by raoni (guest, #137137) [Link]

IIRC from when I read the thread, they are OK with overhead on syscalls from windows code, they are not the concern for performance, they are concerned that applying some sort of overhead for all syscalls is a bigger performance hit because the linux libraries and the winAPI emulation code.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds