For actual calculations, such as adding two numbers, only hardware is required, and you really get the same machine code under Windows and under Linux.
An interesting โglueโ is provided by platform libraries, for example. C standard library, which provides the function "print characters on standard output". The function call code is also completely hardware-defined (although there are some conventions that differ between Windows and Linux, for example, where you need to put function arguments, but these are just conventions). The implementation of these libraries is provided by an interesting platform-specific "meat". For example, how is printf implemented? On Linux and Windows, different code is generated, but the differences are not in the instructions, but in the way you talk to the operating system.
Again, this is mainly a matter of convention, and there are no significant differences in the actual machine program codes for different operating systems on the same hardware. The only difference is how to force the operating system to perform certain functions on your behalf, such as input / output, providing you with memory, indicating the time, etc.
source share