"I think it totally depends upon the OS, provided it abstracts hardware efficiently. For example, Windows is meant for x86 architechture. Someday Microsoft comes up with Windows for SPARC that uses same system calls, i.e. H/W is abstracted. Any Win32 program would run on that too.
Virtual Machines (such as JVM) do exactly that. They provide a consistent set of instructions to the programs accross platforms. Underneath these instructions are executed differently on different systems."
I'll add one more question, A file compiled on x86-32 architecture under Windows XP, will it work on x86-64 architecture under Windows XP or Windows 2003?
Can I get a link where some guide is provided how OS and hardware architecture interact with each other. I'm really confused, not exactly understanding what is happening (inside the hardware, OS and system calls).
Native implies it is compatible with the CPU in the machine and complies with the default ABI (Application Binary Interface) of the operating system.
Upto a point, it will be compiled to the WIN32 standard. Code can be compiled for Win32 and work without change from Windows 3.1 running WIN32S through to Windows Vista, as long as the calls it makes are implemented on that platform. Overtime APIs are added to a platform, if you restrict the set you call you can maintain good backward compatibility.
Note, the a x86-64 processor can run both 32bit and 64bit binary code. But a 386 cannot run 64 bit code natively.
Similarly an UltraSparcII can run both 32bit and 64bit SPARC code, but a DEC-Alpha is only available as 64bit, there is no 32bit equivalent.