title: How does program execute? Where does the Operating Systems come into play?
body: <p>A program is compiled from some language to ASM --> Machine Code (directly executable). When people say that this is platform dependent, the mean that the binaries formed will run (correctly) only on the CPUs with same Instruction Set Architecture like x86, x86-64. It may (incorrectly) / may not (at all) run on other processes because of the difference in ISA. Right?</p>
  
  <p>Now, the concept of binaries is confusing me. Everything is about the "Machine Language Code" &amp; "CPU". Where does the OS come into play? I mean the compiled binary has direct instructions for CPU when it is loaded into memory. &amp; CPU executes one instruction at a time. I couldn't see the role of Operating System any where except in process management <a href="http://upload.wikimedia.org/wikipedia/commons/8/83/Process_states.svg" rel="noreferrer">link text</a> . It should be running on the CPU of same ISA irrespective of Operating System. right? </p>
  
  <p>Yet its not the case. If I build a code to x86 on windows machine. It won't run on Mac x86 machine or Linux x86 machine.</p>
  
  <p>I'm missing something here. Please clear my confusion.</p>