Sunday, January 24, 2010

The big Mach-O in Mac OS X

This is a bit technical, but I try to write it as easy as possible to be understand by layman.

Mac OS X support both PowerPC and Intel platform, and is possibile to run the same executable on PowerPC and Intel Mac, provided it is an universal binary.

Is no big deal for Intel Mac users, but is a big deal for old PowerPC Mac users. The lastest software might not have PowerPC support unless you download the universal binary executable.

The Mac OS X originally written to support PowerPC Mac. Steve Jobs announced Mac switch to Intel at year 2006.

Mac OS X 10.4 Tiger (the updated version) is the first version of OS X to support both PowerPC and Intel platform. New Mac users who start using OS X 10.6 Snow Leopard may not interested, because Snow Leopard drop PowerPC and support Intel only platform. For those people who are still using PowerPC Mac, you will love the universal binary.

Universal binary help the operating system transition from one platform (PowerPC) to another platform (Intel) smoothly. Mac OS X 10.5 Leopard is the last version that you can used for PowerPC Mac.

To support two different platform (PowerPC and Intel), you need two different set of binaries, one for the PowerPC Mac and one for the Intel Mac. Apple introduced universal binary to support two platform with a single binary, this single binary contain the code for PowerPC and Intel. Is easy for user without CPU architecture (PowerPC or Intel) knowledge, just download the universal binary and it should work on your Mac.

The universal binary also called as "fat binary" or multi-architecture binary, which include more than one binary code in a single executable file, so it is usually bigger in size. Sometimes the universal binary file also refer as big Mach-O (Mach Object, Mach not Mac) file. Snow Leopard which only support Intel platform, the size are smaller compare with Leopard which support both binary code. (Code optimization may help to reduce the binary size as well)

If you know Mac OS X history, it based on NeXT Computer's NeXTSTEP operating system code. Before Apple bought over NeXT, NeXTSTEP is capable to run on Intel platform (and SUN's SPARC!). Is not so surprise for you that Apple can switch to Intel platform in a short period of time.

Next time, I will talk about how to create universal binary using Xcode development tools.

No comments: