[ original mail: https://systeme.lip6.fr/pipermail/cocci/2021-July/008661.html ] I'm in the midst of doing something potentially a bit taboo in these parts: porting some Linux code to the NT kernel used by Windows.
I am the developer of WinDRBD, a project that ports the (Linux) DRBD (distributed replicated block device) driver from Linux to the NT-Kernel family. The source code can be found here: https://github.com/LINBIT/windrbd Not including work by Mantech we are working since almost 4 years on this port and are approaching a stable 1.0.0 release (right now I fix things detected by Windows driver verifier). The approach we use attempts to minimize patches to the original source code and use a compatibility layer to map the Linux interfaces (and behaviour) to the Windows NT interfaces (and behaviour). Since we use Microsoft's C compiler to build the project we need to patch some compiler specific things (like MS C does not know gcc's typeof). Parts of the patching is done via coccinelle but also there are lots of manual patch files. My advice would be to keep the compat.h header (and related files) so that the changes to the Linux sources are kept at a minimum. The reason for doing so is that it makes it far more easy to keep in sync with newer wireguard / DRBD Linux drivers that will come up. (It takes me about 1 to 2 days to upgrade DRBD changes from 1 or 2 months). The compat layer implements for example a wait_event() implementation which allows to use Linux wait_event / wake_up with minimal changes to the original source code (no changes neccessary if you are using gcc / clang to compile). Also there is a mapping of the kernel socket API to WinSock. As long as you are GPL feel free to re-use parts (or the whole) of the compat layer (I'd be happy to assist you on that process).
I was wondering if anybody on this list is a bit bored this summer and wanted to spend a week or two on this. It's perhaps not the most
I would love to see your project I think and hope we can collaborate in the future, Best regards, - Johannes _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci