Can I boot Snow Leopard in 64-bit mode?

UPDATE: Please read Update 2 at the bottom of this post before using a 64-bit kernel as your default.

With Snow Leopard making its appearance this Friday, August 28, 2009, some people may be wondering whether they’ll be able to boot their Macs in 64-bit mode. Only Intel Xserves will boot this way by default. If you want to boot your desktop or mobile Mac in 64-bit mode, you’ll need to take some additional steps. The first is checking to see if your Mac has a 64-bit-capable EFI. If the output of the following command is EFI64, you’re good. If not, you’re out of luck.

    ioreg -l -p IODeviceTree | awk -F'"' '/firmware-abi/{print $4}'

Once you’ve verified it’s possible, you have a couple options for making your Mac boot into 64-bit mode. I’d try them in this order. First, to affect the current boot only, hold down the ‘6’ and ‘4’ keys during bootup. Once you’ve verified it works and are comfortable with it, you can make the change permanent by adding an ‘arch=x86_64’ boot flag to your, like so:

    sudo defaults write /Library/Preferences/SystemConfiguration/ \
    'Kernel Flags' 'arch=x86_64'

UPDATE 1 (8/28/09): Apple has a couple new (and one older) knowledge-base articles pertaining to this topic.

  1. Mac OS X Server v10.6: Macs that use the 64-bit kernel
  2. Mac OS X Server v10.6: Starting up with the 32-bit or 64-bit kernel
  3. How to tell if your Intel-based Mac has a 32-bit or 64-bit processor

UPDATE 2 (8/29/09): This post has received quite a few hits, so I now feel the need to include some educational material about why Apple chose to make Snow Leopard boot with a 32-bit kernel by default.

The primary reason is for compatibility with third-party software, particularly software that requires kernel extensions. Probably the most widely know examples of software that depends upon kernel extensions, or kexts, are VMware Fusion and Parallels. If you use these to run Windows or Linux on your Mac, you’ll want to keep using a 32-bit kernel. Virtualization software needs direct access to the hardware normally controlled by the kernel (CPU, RAM, Disk) in order to “fool” operating systems into thinking they’re installed on “real” computers. The kernel extensions allow them to do this.

Kexts must be written specifically for 32-bit or 64-bit kernels. They are not interchangeable. Applications, on the other hand, can run at 64-bit even if the kernel is 32-bit. As far as your 64-bit CPU is concerned, the kernel is just another application. It’s a very important application — in the sense that it is code that is executed on a processor — whose job it is to arbitrate demands on the system’s resources. Most applications don’t have direct access to the CPU, RAM, or other physical devices, but make requests of the kernel instead.

UPDATE 3 (9/1/09): John Siracusa’s new article on Snow Leopard was posted today. Then entire thing is great reading, but I’m linking to the section that addresses 64-bit vs 32-bit here.


Test for 64-bit Capability

UPDATE (10/8/08): The following one-liner will work on ppc or intel boxes and will return 1 if the computer is 64-bit capable or 0 if it is not. UPDATE 2 (12/11/08):  Reader Ted suggested suppressing stderr for cleaner output. I amended the code below to include his suggestion.

sysctl hw.optional 2> /dev/null | awk -F': ' '/64/ {print $2}'

The arch tool is an easy way to test whether a Mac’s processor is intel or ppc, but it does not draw a distinction between the different types of intel processors. It will return i386 whether it’s a Core Duo, Core 2 Duo, or Xeon. We can use the fact that the Core Duo is only intel processor found in Macs incapable of running 64-bit code to write a script that extend arch to test for 64-bit capability.


    proc=$(/usr/sbin/system_profiler SPHardwareDataType | \
    /usr/bin/awk -F': ' '/Processor Name:/ {print $2}')

    if [ "$(/usr/bin/arch)" == "i386" ]; then
        if [ "$proc" != "Intel Core Duo" ]; then
            /bin/echo $(/usr/bin/arch)-64
            /bin/echo $(/usr/bin/arch)-32
        /bin/echo $(/usr/bin/arch)

This script will return i386-32 for intel processors limited to 32 bits, i386-64 for 64-bit capable intel processors, and ppc for non-intel processors.

I’ve called this script archbits and made it downloadable here.