LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2007, 05:25 PM   #1
bookerg
LQ Newbie
 
Registered: Jul 2007
Posts: 11

Rep: Reputation: 0
Do Linux Binary Files work across all platforms/CPU types? (i.e. Between PC/Mac)


Hi all (Linux Newbie here).


This question may seem glaringly obvious to some of you, but I'm completely stuck. I know (from what I'm told) that generally speaking, binary/executable files are said to only work on the type of processor that they were originally compiled for (whether it be x86, PowerPC, etc.)


However, does the same story apply if an Operating System (such as Linux) acts as an "intermediate"?


What I mean is - if I download a binary/executable "Linux" file, will it work just the same on an x86 PC running ubuntu Linux as it would on an Apple Mac running ubuntu Linux? Or does it have to be compiled separately for each processor type by having access to the source code?



(P.S. There's no particular reason why I used ubuntu Linux as an example above, rather than any other Linux distro)



Many thanks to all who can help out
 
Old 07-31-2007, 05:40 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Binary executables only work on one specific CPU type.

There are some applications that emulate specific processors. If you were running an x86 machine but had an emulator that emulated a G4 processor then you could execute G4 binaries within that G4 emulator running on the x86 machine.

When we talk about different CPU types we have to keep in mind that we are also talking about the supporting hardware designed for that CPU type. For example an x86 processor doesn't access RAM in the same way that a G4/Power PC chip accesses RAM. So a binary compiled for a particular CPU type also has instructions for reading disks and writing to the monitor that are unique to that CPU family. The CPU emulators take care of that supporting hardware emulation as well as the specific CPU instructions.

Last edited by stress_junkie; 07-31-2007 at 05:48 PM.
 
Old 07-31-2007, 05:48 PM   #3
bookerg
LQ Newbie
 
Registered: Jul 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by stress_junkie
Binary executables only work on one specific CPU type.

There are some applications that emulate specific processors. If you were running an x86 machine but had an emulator that emulated a G4 processor then you could execute G4 binaries within that G4 emulator running on the x86 machine.
Hi.

So if I download a binary Linux file (specifically in this case, a console emulator from Zophar's Domain), it's safe to assume that it has been compiled for an x86 processor? (unless stated otherwise, I don't think it would be compiled for an Apple Mac or anything)


With that in mind, how difficult is it to compile the source code to get it to work with a different processor? Does it entail any actual coding, or will the compiler automatically just "get it work" ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Many Linux users work with multiple OS platforms, survey finds LXer Syndicated Linux News 0 07-22-2007 03:16 AM
Can someone compare the top 3 types of computers- Windows, Mac and Linux? ussr_1991 Linux - General 12 05-25-2007 05:38 AM
Build one Linux binary for many i386 platforms? mattengland Programming 2 04-14-2006 12:36 PM
Compiling a Mac Binary On Linux calimer Linux - Software 6 06-10-2005 04:47 AM
Genral Questions on Types of Linux Files roiboy Linux - Newbie 4 04-27-2004 08:22 PM


All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration