The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can I make "touch" create executable files by manipulating umask? tphyahoo Shell Programming and Scripting 2 01-30-2009 04:20 PM
Finding executable files in all directories CSGUY UNIX for Dummies Questions & Answers 4 04-19-2005 06:34 PM
Converting Unix executable files Steven Greenber OS X (Apple) 4 02-04-2005 12:58 PM
Cannot translate Unix executable files Steven Greenber OS X (Apple) 1 02-11-2004 03:14 PM
pls hlp: making .sh files executable ropers Filesystems, Disks and Memory 2 07-29-2002 05:44 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-29-2007
nervous nervous is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 55
Executable files

This question always confuses me :-

Suppose I write a program and compile it on a machine with operating system A and processor B

will the exe file run on a machine

with operating system A2 but processor B
operating system A but processor B2
operating system A2 and processor B2........

In a nutshell, Does the compatibility of a exe file depend on

only operating system ?

only machine architecture ?

or BOTH ?
  #2 (permalink)  
Old 10-29-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by nervous View Post
BOTH
There are CPUs: i386, Sparc, PowerPC, MIPS, PA-RISC, MC68020 etc

There are object file formats: ELF, XCOFF, COFF, PE, SOM, AOUT etc

Then there are CPU modes, 64 bit, 32 bit

And also operating system versions, so typically a binary compiled for one version of an OS cannot be used on an earlier one.
  #3 (permalink)  
Old 10-29-2007
drl's Avatar
drl drl is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 706
Hi.
Quote:
Originally Posted by porter View Post
There are CPUs ...
There are object file formats...
Then there are CPU modes...
And there is Executable - Wikipedia, the free encyclopedia ... cheers, drl
  #4 (permalink)  
Old 10-30-2007
nervous nervous is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 55
Porter

Some body told me like this:

"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."


What you say now?
  #5 (permalink)  
Old 10-30-2007
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
some body told you correctly
  #6 (permalink)  
Old 10-30-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
For example, Windows is meant for x86
And also previously ran on MIPS, DEC-Alpha and PowerPC.

Quote:
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.
Except that any code compiled for i386 will have to be run through an emulator.

Quote:
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.
Absolutely, (a) at the cost of translation to the native format (b) JVM and .NET both still sit on top of an operating system, they do not replace it.

Even a JVM running in a embedded system will still run on an embedded OS, however minimalist that is.
  #7 (permalink)  
Old 10-30-2007
nervous nervous is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 55
What is meant by native format????

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).

Thanks for all your support.

Last edited by nervous; 10-30-2007 at 03:48 AM.. Reason: Added one more question
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0