Why linux executable(a.out) doesnt run on windows(.exe) directly?

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 2
Reputation: therock4u is an unknown quantity at this point 
Solved Threads: 0
therock4u therock4u is offline Offline
Newbie Poster

Why linux executable(a.out) doesnt run on windows(.exe) directly?

 
0
  #1
May 10th, 2007
Dear all,

Why do i need to recompile the code?
Where as the X86 the architecture is same??
The final instruction are also going to be same right???
I assume there must be some difference between windows and linux executable handling in the sense of program loading (loader) but can some expert put some more highlight on this Please..

Thanks
Sirius..
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,055
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: Why linux executable(a.out) doesnt run on windows(.exe) directly?

 
1
  #2
May 10th, 2007
First, the program communicates with the operating system differently. To perform input and output, it must talk to the OS with a system call, using a particular protocol, and they use different protocols. Second, the libraries are different. Linux programs expect libraries with functions like printf and whatnot to be in particular places; Windows programs expect them somewhere else. Third, the filesystem and arrangement of where things are stored is different. Fourth, the executable file format is different. The Linux procedure which launches programs expects executable files to be in a particular format (or one of a set of formats?). The .exe file format(s?) is (are?) different. The general scheme of how GUI output is performed is different. The notion of processes is different. And on and on and on.
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: Why linux executable(a.out) doesnt run on windows(.exe) directly?

 
0
  #3
May 10th, 2007
That's because when you provide Chinese instructions to an OS that understands only French it won't understand.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 2
Reputation: therock4u is an unknown quantity at this point 
Solved Threads: 0
therock4u therock4u is offline Offline
Newbie Poster

Re: Why linux executable(a.out) doesnt run on windows(.exe) directly?

 
0
  #4
May 10th, 2007
Originally Posted by Rashakil Fol View Post
First, the program communicates with the operating system differently. To perform input and output, it must talk to the OS with a system call, using a particular protocol, and they use different protocols. Second, the libraries are different. Linux programs expect libraries with functions like printf and whatnot to be in particular places; Windows programs expect them somewhere else. Third, the filesystem and arrangement of where things are stored is different. Fourth, the executable file format is different. The Linux procedure which launches programs expects executable files to be in a particular format (or one of a set of formats?). The .exe file format(s?) is (are?) different. The general scheme of how GUI output is performed is different. The notion of processes is different. And on and on and on.
Thank you very much for your information..
just for a little bit of clarity... does it mean that loader which loads the program is actually OS specific (as it deals with actual allocation of memory and pysical address mapping for program and providing program counter to processor ) and
linker OS-independant.. if not what OS - Dependant information linker provides in ELF ( executable of linux?)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 7143 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC