NASM Forum > Other Discussion

linux code inside windows binary?


I have been thinking about how to add linux operating system support for own windows program. One way would be running it under Wine and fix any incompatibilities.
On the other hand 64 bit platform provides easy way to code position independent code. I guess NASM would compile same functional linux bytecode into windows binary. That would be more interesting way to prevent duplicating same program logic, where possible.
It would make sense to have three executable sections (one for windows, one for linux and one for code that works for both). I am looking for linux procedures that would be required to pick up latter two in memory.

Any bright ideas?

No bright ideas unfortunately, but I'm very interested to see if you can pull this off. You're not the first one to try though so good luck!

Cyrill Gorcunov:
This won't work: OS always figures out the executable from the program header, which of course is different between OS. That said you won't make it work inside one single binary (except of course if you write own windows/linux drivers).


[0] Message Index

Go to full version