shaz wrote:
so it just requires conversion of system calls .
Only if the application in question is of a rather generic nature. As soon as an app makes use of any "special" OS functionality, porting it will become
much harder. A good example are games.
There are those who use OpenGL, which is a generic graphics API. Porting those from one platform to another is a (relatively) easy task: You have to make adjustments, but all in all the application remains the same.
Then there are those who use DirectX - which is a technology proprietary to Microsoft. You will find it a taxing task to port this to any other platfom, because the whole
architecture of the application in question is likely to revolve around the DirectX API.
Of course, a programmer
could write an application in a way that it could easily abstract the actual API used - e.g. the game "IL-2 Sturmovic" allows to switch the rendering engine between OpenGL and DirectX - but unless the programmer had portability in mind right from the start, chances to find such a setup are slim.
is there any way to change those system calls at runtime.
Again, only for trivial applications. As soon as the issue becomes more evolved, chances are that it's not only the call in question, but the whole
architecture surrounding it that has to be changed.
Picture this: You have two graphics APIs - let's call them OpenGL and DirectX.
Both have a command to draw a circle, which is passed x, y, radius, color and a couple other parameters. Since the task at hand is very similar, chances are that a little rearranging of parameters and renaming of the function call itself will do the trick of "porting" the drawing of a circle from one to the other.
But most things are more delicate than this. Complex data structures might be fundamentally different. One solution might use shared memory where another uses sockets, etc. etc. - it's no longer a matter of shifting around a couple of parameters, you have to change
concepts.
means that there is some sort virtual machine which converts the system calls accordingly and then exexutes that application.
From a certain level of complexity onward, you are usually better off trying to port the
underlying technology instead of the application.
Cygwin provides a POSIX environment including many common shell tools and an X server for Windows. Wine provides a Windows API emulation for Linux. Perhaps one of these two readily available solutions can help you.