MacBook – 64 bit support with a 32 bit kernel in OS X Snow Leopard

64-bitkernelmacbook prosnow leopard

I know that many apple laptops such as my Macbook 6,1 run a 32 bit kernel in OS X Snow Leopard. The kernel according to Apple can also run or "support" 64 bit applications. My question is how does the system do that?

A 64 bit OS can run 32 bit apps by default because the OS has emulators that catch all 32 bit calls and translate them into native 64 bit calls.

But how does the 32 bit kernel in OS X do that with 64 bit?

  1. Hardware architecture virtualization? (if so, wouldnt this be slow as the conversion from 32 bit calls and memory addresses to 64 bit is a lot more intensive?)
  2. Hybrid architecture design (i.e the kernel is designed with some 64 bit elements mixed in with the mostly 32 bit design?)

Apple docs and support doesnt seem to have anything specific on this. I am just curious!

Best Answer

Note, some of the info in this answer was cribbed from here:

Mac OS X 10.6 Snow Leopard was the last OS to support 32 bit CPU architectures, like the Core Solo, and Core Duo (not Core 2 Duo) processors. Note that it's entirely possible to have a 64bit processors like the Core 2 Duo, and still have a 32bit EFI firmware, so the CPU alone isn't the sole indicator of your systems capabilities in this respect.

This is how you end up the situation of having a 32 bit kernel, that is held back by the EFI, running on a 64 bit CPU, which is capable of running a 64bit application stack so long as it is not dynamically loading any kernel modules etc. The application isn't wholly tied to the kernel, and is capable is independent running in a different state to the kernel if required. Same way an app can run 32bit on a 64bit kernel...

To be honest, the number of people with a Core 2 Duo or above but with a 32bit EFI are relatively limited, and you are unlucky if you are one of those people that has, say a Macbook from 2007/8 when this was common. The 64bit EFI was introduced in a staggered way across the range so it's not simple to pinpoint what date it was common across all formats.

You can check your machine’s EFI by entering the following command in Terminal:

ioreg -l -p IODeviceTree | grep firmware-abi

It will return either “EFI32″ or “EFI64.”

In addition, some perfectly capable machines still only boot into 32bit mode kernels, even when they are capable, although you can force a 64bit kernel by holding down the 6 and 4 keys on boot.

OS News notes that only Macs with a 64-bit EFI are able to boot the 64-bit Snow Leopard kernel and kexts; an artificial limitation imposed by Apple, even though a 32-bit EFI can boot a 64-bit kernel “just fine.”

What’s worse is that even if your MacBook (non-Pro) has a 64-bit EFI, it will only be able to boot the 32-bit version of Snow Leopard because of a limitation that Apple imposes on MacBooks. The biggest roadkill on Route 64 is the original Mac Pro (which was discontinued January 8, 2008) it won’t be able to boot the 64-bit kernel and drivers either.enter link description here