LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2008, 01:38 PM   #16
nflenz
Member
 
Registered: Feb 2006
Distribution: CRUX 2.4
Posts: 96

Rep: Reputation: 18

Four reasons come to mind:

Different executable format
Different libraries
Different window system
Different kernel

Wine does a pretty good job of overcoming these obstacles, but I don't really care. Windows software usually sucks.
 
Old 11-16-2008, 01:59 AM   #17
prerp
LQ Newbie
 
Registered: Jun 2008
Location: china
Posts: 7

Original Poster
Rep: Reputation: 0
I get it, Applications itselves are very different as pinniped says. different lib, different logic, and different struct.
 
Old 11-16-2008, 02:05 AM   #18
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by prerp View Post
I get it, Applications itselves are very different as pinniped says. different lib, different logic, and different struct.
Just stay with different and you will be fine.....
 
Old 11-16-2008, 02:26 AM   #19
prerp
LQ Newbie
 
Registered: Jun 2008
Location: china
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Wim Sturkenboom says:
When you compile the c-code on a X86 machine, the compiler will generate the correct machine (binary) code for the x86; it's however very unlikely that that machine code will work on the sparc processor. You need to compile the c-code again on the machine with the sparc processor to get the correct machine code for it (or use a cross-compiler).
Quote:
billymayday says:
When you say programs run on different cpus, that's only really true where they are instruction set compatible or backwards compatible. As said previously, a totally different CPU requires a different binary that has been compiled for it.
( I don't understand. I download a game, I can run it in my computer and in my friends' computers without compling)

Quote:
pinniped says:
Sure a program has machine code in it. That's only part of the story. Programs also have tables in them indicating what other programs (libraries) they may need to use and the functions to use in those libraries. The tables also have the addresses of functions, including main() which is the one called when a program is started.

A second problem is that winduhs and Linux communicate with programs in a different way. The operating system essentially provides access to hardware, and *all* software must interact with it. One typical way of getting this done is to put information in certain CPU registers and then generate a software interrupt. Some operating systems use multiple interrupts but if I recall correctly, Linux only uses one. It just happens that winduhs and Linux use different registers and different interrupts - so even if you wrote another program to place that *.exe into memory and begin execution, the program will still not run because it can't communicate with the kernel.

Now for CPUs - different families of CPUs have different instruction sets, so you *cannot* run a program on different CPUs simply because the operating system has the same name. Linux is written in a "high-level" language, C, and can be compiled for many CPU families. Although the more abstract code (C) is mostly the same, the final executable code is very different. This is why you cannot install Linux for x86 on an ARM computer.
Quote:
ErV says:
However it is possible to write library that'll work on both systems (as long as CPU architectures and endianness will be compatible) if there is loader for it. For your information - mplayer can use *.dll files for codecs (windows "libraries), even on Linux. Please note that library is not what people normally call a program, it is collection of functions.
These great suggestions!
 
Old 11-16-2008, 02:47 AM   #20
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by prerp View Post
( I don't understand. I download a game, I can run it in my computer and in my friends' computers without compling
It has already been compiled.
 
Old 11-16-2008, 03:29 AM   #21
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by Nylex View Post
It has already been compiled.
and they are both probably the same arch, or similar so it doesn't need to be recompiled
 
Old 11-16-2008, 10:07 AM   #22
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by prerp View Post
( I don't understand. I download a game, I can run it in my computer and in my friends' computers without compling)
Some others already gave good reasons why it might work. Another reason why it might work which I did omit on purpose (as it might have created more confusion) is that the program is written in an interpreted language or pseudo language (not sure what the official name is for the latter).

So if you downloaded a game written in an interpreted language, the interpreter that needs to be installed on your system will do the translation to the system calls and the OS while handle it from there. Examples of interpreted languages are basic, perl, tcl etc

The pseudo language I'm referring to is Java. It is compiled to a byte-code and will run in a Java Virtual Machine that needs to be installed on your machine and translates the bytecode to system calls.

Both the Java Virtual Machine as well as interpreters are different for the different HW/OS (so the one that you download for Windows on x86 will not work under Linux on x86 (see easrlier answers)).
 
Old 11-16-2008, 12:06 PM   #23
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Rep: Reputation: 37
Its an interesting question...... and the answers make me wonder what exactly an emulator program like wine "emulates". What does such a program do to a windows executable to run it in windows??

And by the way, does an application directly communicate with the hardware?? It communicates through the kernel right?? So one factor should be the difference in kernel that limits a windows application from running on Linux.....

The similarity in kernels also explains why a game that runs on a Core2 also runs on an AMD or a Pentium as long as the machines have the same OS. This is also true in the case of Linux.

I think the same reason prevents an application that runs on 32-bit OS from running on its 64 bit version. Of course measures are taken to avoid such compatibility issues, that could be why applications can run on different OSes of the same vendor..... like an application running on both XP and Vista...

Last edited by firewiz87; 11-16-2008 at 12:24 PM.
 
Old 11-16-2008, 12:36 PM   #24
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by firewiz87 View Post
Its an interesting question...... and the answers make me wonder what exactly an emulator program like wine "emulates". What does such a program do to a windows executable to run it in windows??
Wine Is Not an Emulator
 
Old 11-16-2008, 03:23 PM   #25
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by firewiz87 View Post
Its an interesting question...... and the answers make me wonder what exactly an emulator program like wine "emulates". What does such a program do to a windows executable to run it in windows??
It doesn't "emulate" things. It takes available linux system calls and wraps them in the way so the will be compatible with WinAPI, and implements some missing stuff. This is not an emulation. It is reimplementation of WinAPI (according to its specification), on GNU/linux OS.

Quote:
Originally Posted by firewiz87 View Post
And by the way, does an application directly communicate with the hardware?? It communicates through the kernel right?? So one factor should be the difference in kernel that limits a windows application from running on Linux.....
Normal program never communicates with hardware directly. It uses system calls. How exactly system calls communicate with hardware is the problem of OS developer, not software developer (well, in most cases).

Quote:
Originally Posted by firewiz87 View Post
The similarity in kernels also explains why a game that runs on a Core2 also runs on an AMD or a Pentium as long as the machines have the same OS. This is also true in the case of Linux.
Nope, in this case they run also because CPUs use similar(to certain extent) instruction set , and games sometimes detect advanced features of Core2/AMD/Pentium and change their behavior accordingly.
 
Old 11-16-2008, 03:44 PM   #26
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by firewiz87 View Post
And by the way, does an application directly communicate with the hardware?? It communicates through the kernel right?? So one factor should be the difference in kernel that limits a windows application from running on Linux.....
On some bare systems like DOS, the software often had to communicate with hardware directly. This was really horrible and resulted in so much inconsistency. It slowly improved, but one other big problem with DOS is that any program had access to any memory (and could easily screw up any other program/driver which was running). The amusing thing is that at the same time, UNIX was in charge of the hardware and software only had to communicate with the OS.

Quote:
Originally Posted by firewiz87
I think the same reason prevents an application that runs on 32-bit OS from running on its 64 bit version. Of course measures are taken to avoid such compatibility issues, that could be why applications can run on different OSes of the same vendor..... like an application running on both XP and Vista...
Not quite. For Linux (and Visduh would have to use the same mechanism), the compatibility with 32-bit apps is provided by a 32-bit kernel interface. In the case of Linux, a 64-bit kernel will have a 64-bit interface so you need to explicitly build the 32-bit interface if you want to support 32-bit code. Otherwise the pointers being passed to the kernel will have the wrong size and alignment and some other data types may also have the wrong size and alignment.
 
Old 11-17-2008, 01:58 PM   #27
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
If you took a game disk for a Playstation 3 and put it in an XBOX 360, would you expect it to work?

If you put a DVD for the Mac OS X version of Microsoft Office in to a Windows machines, would you expect it work?
 
Old 11-17-2008, 11:09 PM   #28
sandypeter111
LQ Newbie
 
Registered: Nov 2008
Posts: 11

Rep: Reputation: 0
Smile yes it is true windows and linux architecture both are different

but i think some of the compatible things available with startoffice and ms office. we can exchange file with those office packages.
but i would like to know how to convert any exe of microsoft be used linux compatible?
 
Old 11-17-2008, 11:38 PM   #29
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by sandypeter111 View Post
but i think some of the compatible things available with startoffice and ms office. we can exchange file with those office packages.
but i would like to know how to convert any exe of microsoft be used linux compatible?
did you not read the thread?
 
Old 11-18-2008, 01:38 PM   #30
nflenz
Member
 
Registered: Feb 2006
Distribution: CRUX 2.4
Posts: 96

Rep: Reputation: 18
Quote:
Originally Posted by sandypeter111 View Post
but i think some of the compatible things available with startoffice and ms office. we can exchange file with those office packages.
but i would like to know how to convert any exe of microsoft be used linux compatible?
File formats like .doc are not software. They only contain data for executables like Microsoft Office or OpenOffice. Think of it this way:

Operating System <- Word Processor <- file.doc

File formats are operating system independent because they are read by software instead of being executed by the OS itself.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
run windows exe file in Linux? shipon_97 Linux - Newbie 5 11-24-2008 09:42 PM
how to run .exe file as we run the samwe in windows chandrala13 Linux - Newbie 2 05-22-2008 05:30 AM
How to run windows based .exe programs on linux slsscoot Linux - Newbie 7 04-20-2008 05:28 PM
run windows exe munna_dude Programming 4 10-10-2007 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:11 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
Open Source Consulting | Domain Registration