Join us at IRC!
Society leans ever heavily on computers, if you have the power to take out computers you can take out society. - cubeman372
Friday, May 25, 2012
Navigation
Members Online
Total Online: 27
Web Spiders: 13
Guests Online: 27
Members Online: 0

Registered Members: 70217
Newest Member: HyperFang8
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Universal Binaries potential for true portability?

Zkunxen
Member

Posts: 47
Location:
Joined: 24.07.09
Rank:
Elite
Posted on 28-12-09 05:03
I've been thinking, if mac programmers can make a universal binary for a program that works on PowerPC and x86 macs, why hasn't anyone found a way to make a truly "Universal" binary, that is, one compiled program that can install on any operating system?
it seems like such a thing would be all it takes to push machine code programming languages, such as C++ and C back up to the top, over bytecode and interpreted languages, such as Java and Python... then again, people are lazy and don't feel like learning code for another machine so it would probably be useless outside open source projects anyway...
even still, maybe, with a batch scblockedript, some shell scblockedripts, and a concatenation of binaries for various systems something similar could be conceived. or even a java installer to unpack an archive of binaries for various systems, and just delete the unnecessary files.
what do you all think about such an idea? could it be done? I'm sort of new to programming still, so I'm definitely no expert, this is more like a six-year-old's perspective of a complicated matter that seems simple to a mind ignorant to the normal boundaries of possibility.
Author

RE: Universal Binaries potential for true portability?

skathgh420
Member



Posts: 418
Location: 127.0.0.1
Joined: 03.03.08
Rank:
God
Posted on 28-12-09 05:35
Entirely insane (kind of). Could possibly be done but ....... I don't even know. There are seriously way too many platform's and OS's and architectures to have a truly universal binary. Any way's ASM is pretty much the lowest of low languages and that is processor dependent which is a lot less discriminant than other languages. Shit you could say that binary itself is universal (zero's and one's) that's what it all comes down too.



1 3 3 www.google.com
Author

RE: Universal Binaries potential for true portability?

stealth-
Member



Posts: 999
Location: Eh?
Joined: 10.04.09
Rank:
God
Posted on 28-12-09 06:14
The term for this is "fat binary", if memory serves right.

A big issue with this, I believe, is that the binary size would grow substantially larger with each added support for each architecture and OS. This results in a slower, more bulky application and complicates alot of things.

The main reason this method isn't used often is because of its more effective alternatives, such as having the installer choose a architecture-specific binary at install time or compiling from source. Not to mention linux pretty much doesn't have to worry about it because of the wonderful idea of a package respiratory.

So it's not so much that we can't do it, it's just that there is better alternatives or the results of doing a fat binary would be more problems than it's worth.

Hope that cleared it up for you :)


The irony of man's condition is that the deepest need is to be free of the anxiety of death and annihilation; but it is life itself which awakens it, and so we must shrink from being fully alive.
http://www.stealth-x.com

Edited by stealth- on 28-12-09 06:32
http://www.stealth-x.com
Author

RE: Universal Binaries potential for true portability?

Compromise
Member

Posts: 224
Location:
Joined: 11.11.09
Rank:
Moderate
Warn Level: 30
Posted on 28-12-09 15:00
http://en.wikipedia.org/wiki/Executable_and_Linkable_Format


CrazySpai
minecraft.net
Author

RE: Universal Binaries potential for true portability?

wolfmankurd
Member



Posts: 1519
Location: UK
Joined: 30.05.05
Rank:
God
Posted on 28-12-09 16:22
Well, I didn't understand your whole post, but I think you're asking why doesn't a powerpc binary run on x86 or amd64.

There are several problems, like you and others have identified, the machine code is different. What means jne on one doesn't mean the same on the other. But we can get by this, why don't windows x86 binarys run on linux x86?

Well this time there are two issues, firstly the packing loading etc. windows can run code without any special bits such as .com files there are just binary, but linux can't load them linux uses ELF mostly these days.

Another issue is kernel interupts the are widely different from linux to windows. (linux only uses 80h windows use what appear to be random ones) but we can even get past this! How about we just use bios provided interupts. Well then what can I say, if you successfully load the .com file into memory and have it excicute it would run on linux. Theres probably even a way to do this.

But for converting between platforms it just so happens it's more useful to have the compile seperate from the binary to save space.


BY READING MY POST, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE USE OF THIS (MIS)INFORMATION.


Widowmakr@hotmail.com http://LetsHackStuff.com
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.