Why does my Mac OS X 10.6 kernel run in 32-bit mode?

11,287

Solution 1

In Jon Siracusa's Review of Snow Leopard he discusses the 64-bit transition.

Tiger Leopard Snow Leopard

The short version is: because there's no 'mixed-mode' a 64-bit kernel requires 64-bit Kernel Extensions and Drivers.

As those aren't widely available yet, Apple chose to default to 32-bit to avoid breaking lots of things.

Instructions from the article:

For all K64-capable Macs, boot while holding down "6" and "4" keys simultaneously to select the 64-bit kernel. For a more permanent solution, use the nvram command to add arch=x86_64 to your boot-args string, or edit the file /Library/Preferences/SystemConfiguration/com.apple.Boot.plist and add arch=x86_64 to the Kernel Flags string:

...
    <key>Kernel</key>
    <string>mach_kernel</string>
    <key>Kernel Flags</key>
    <string>arch=x86_64</string>
...

To switch back to the 32-bit kernel, hold down the "3" and "2" keys during boot, or use one of the techniques above, replacing "x86_64" with "i386".

Solution 2

According to what has been leaked to MacRumors (since the official documents are under NDA) (Source) only the following computers support running the 64-bit kernel:

  • Early 2008 Mac Pro (MacPro 3,1)
  • Early 2008 Xserve (Xserve 2,1)
  • MacBook Pros (15"/17") (MacBookPro 4,1)
  • 2008 iMacs (iMac 8,1)
  • Unibody MacBook Pros (MacBookPro 5,1 and 5,2)
  • Early 2009 Mac Pro (MacPro 4,1)
  • 2009 iMacs (iMac 9,1)
  • Early 2009 Xserve (Xserve 3,1).

Only the XServes use the 64-bit kernel by default.

If you start up the computer holding the 6 and 4 keys you will start up the 64-bit kernel, or according to another source breaking their NDA you can edit /Library/Preferences/SystemConfiguration/com.apple.Boot.plist adding a kernel flag or do it in the nvram.

Solution 3

There is not much benefit to running a 64-bit kernel in Snow Leopard, unlike most other operating systems. In Windows and Linux, you need a 64-bit kernel to run 64-bit applications. On OS X, you can run 64-bit applications with the 32-bit kernel.

Most people seem to be concerned that running the 32-bit kernel in OS X limits the performance or capabilities of their machines, but in practice this doesn't have a significant material impact. The 32-bit kernel supports running 64-bit applications, and those apps have a virtual 64-bit address space that gets mapped to a 36-bit PAE address space by the kernel, so they behave the same as they would on a 64-bit kernel, just with more constrained memory usage and memory-mapped I/O to the usable range. The way Apple handles this address space in the 32-bit kernel results in a 32 GB limit for physical memory, breaking the 4 GB 32-bit limit with PAE. Performance-wise there isn't much of a benefit, if there is a measurable one at all with using a 64-bit kernel with 32 GB of memory or less. If you want to, you can test some benchmarks yourself when you force-boot with the 64-bit kernel by holding the 6 and 4 keys at startup. I doubt you would see and significant difference in performance.

The other issue is compatibility with device drivers, kernel extensions, and the device's firmware. For device drivers and kernel extensions, they need to match bit-ness, be recompiled, or rewritten (especially if they have any assembly, which portions are common in those types of code). Apple's EFI originally came in 32-bit only, and more recently some models have 64-bit firmware. For the operating system to talk to the firmware, the bit-ness of the kernel and the EFI have to match. Things that involve talking to EFI are things like choosing a startup disk or some power management controls (like if you have more than one OS X installation and you need to wake from sleep after the battery has run out).

So would a 64-bit kernel be a benefit? Performance-wise not really in practice, and I can see the wisdom with Apple using 32-bit kernels for most of the machines running Snow Leopard for better compatibility.

Solution 4

Jason's unfortunately obfuscated link hid a very useful piece of information:

ioreg -l -p IODeviceTree | grep firmware-abi

The 64 bit EFI Macs will report

| | "firmware-abi" = <"EFI64">

Solution 5

Until Snow Leopard is released, we won't know what systems will support 64/32 bit mode... But all indications are that Snow Leopard will be transparent with the kernel support...

But, alas, sorry to be a "downer", if you are a registered Appleseed member, the Appleseed forum discusses how to force the kernel to 64bit mode. Otherwise, if you have received Snow Leopard elsewhere, don't worry about it.

Snow Leopard's release is right around the corner...

Share:
11,287

Related videos on Youtube

Chopper3
Author by

Chopper3

mmm...delicious cheese, oh and I design and build large video-on-demand systems, but let's get back to the cheese...

Updated on September 17, 2022

Comments

  • Chopper3
    Chopper3 over 1 year

    I have a MacBook Pro (5,1) with 4GB of memory running 10A432 - but it's running the 32-bit kernel.

    Any ideas why it wouldn't be running in 64-bit mode, and how I can get it to do so?

    • OscarRyz
      OscarRyz almost 15 years
      I understood the very purpose of 10.6 was to rewrote core component to maximize the use of 64bit. So with this you're saying it will run optimized code on 32 bit most of the times? ...
    • Chopper3
      Chopper3 almost 15 years
      dunno, most code is clearly 64 bit but kernel doesn't seem to be, for me anyway
  • Chopper3
    Chopper3 almost 15 years
    I spotted that too, that's why I put my model code.
  • OscarRyz
    OscarRyz over 14 years
    Starting with [6][4] does the job, but, what's the benefit of having the kernel running on 64 bits? ...
  • Chealion
    Chealion over 14 years
    @Oscar Reyes: You can then use 64-bit drivers and processes can access more than 4GB of memory. So right now? None unless you're running a server side application that can utilize more than 4GB of memory - hence the 64-bit default on Xserves.
  • Lake
    Lake almost 12 years
    Thanks to Gareth for the edit (rehosted image links to imgur from arstechnica and quoted relevant instructions from the article).