Linked by Thom Holwerda on Tue 18th Aug 2009 18:46 UTC
Mac OS X Even though Apple has been hyping up the 64bit nature of its ucpoming Snow Leopard operating system, stating it will be the first Mac OS X release to be 64bit top-to-bottom, reality turns out to be a little bit different so far. With the current Snow Leopard seed, only Xserve users get the 64bit kernel and drivers - all other Macs default to 32bit. By holding down the '6' and '4' keys during boot, you can to boot into full 64bit mode - that is, if your Mac supports it. As it turns out, some Macs with 64bit processors cannot use the 64bit kernel because the EFI is 32bit. Note: I should have included in the article that 64bit applications will run just fine (including benefits) on a 32bit kernel in Mac OS X. Since this was already possible in Leopard, I assumed people were well aware of that. Turns out some were not, so my apologies for that.
Thread beginning with comment 379254
To read all comments associated with this story, please click here.
Franz27682
Member since:
2009-08-18

On Windows and Linux, not having a 64-bit kernel means not having 64-bit applications, either.

Mac OS X can run 64-bit applications on 64-bit machines even with the 32-bit kernel.

Reply Score: 8

Jimbo Member since:
2005-07-22

Mac OS X can run 64-bit applications on 64-bit machines even with the 32-bit kernel.


Wow I didn't know that was possible. Do you have a reference for that?

Reply Parent Score: 1

val1984 Member since:
2009-08-18

"Mac OS X can run 64-bit applications on 64-bit machines even with the 32-bit kernel.

Wow I didn't know that was possible. Do you have a reference for that?
"
Is a screenshot enough for you?
http://yfrog.com/e0x64appsonx86kernelp

Edited 2009-08-18 20:21 UTC

Reply Parent Score: 2

galvanash Member since:
2006-01-25

http://en.wikipedia.org/wiki/64-bit

From about 2/3rds down

Because device drivers in operating systems with monolithic kernels, and in many operating systems with hybrid kernels, execute within the operating system kernel, it is possible to run the kernel as a 32-bit process while still supporting 64-bit user processes. This provides the memory and performance benefits of 64-bit for users without breaking binary compatibility with existing 32-bit device drivers, at the cost of some additional overhead within the kernel. This is the mechanism by which older versions of Mac OS X enables 64-bit processes while still supporting 32-bit device drivers.

Reply Parent Score: 3

FellowConspirator Member since:
2007-12-13

"Mac OS X can run 64-bit applications on 64-bit machines even with the 32-bit kernel.


Wow I didn't know that was possible. Do you have a reference for that?
"

That's an over simplification. The Mach kernel will switch to a 64-bit OS X if it finds a 64-bit capable processor. You'll note that this happens even if you have 32-bit EFI.

Even then, the Mach microkernel does use the 64-bit "long mode" which permits execution of "64-bit" and "compatibility mode" (32-bit) code. In Leopard, the majority of the OS X kernel itself runs predominantly 32-bit and various frameworks run in the 64-bit mode. In Snow Leopard, everything runs 64-bit save for hooks for 32-bit legacy device drivers. There's nothing peculiar about it, it's built right into the EM64T spec -- it's just that leveraging it requires a microkernel architecture rather than a monolithic kernel.

This article doesn't really go into that and concludes, somewhat erroneously, that Snow Leopard doesn't run 64-bit on many pieces of Mac hardware. In fact, it's more accurate to say that the boot-loader and microkernel entry point will start in 32-bit mode and switch to 64-bit mode if there's a 32-bit EFI.

Reply Parent Score: 3

PlatformAgnostic Member since:
2006-01-02

It's probably a pretty tricky bit of code that allows this to work. Basically when you're running a 64-bit app the processor is in long mode and when you enter the kernel the processor switches to "compataibility mode" to run the kernel code. The kernel needs to have some support for the 64-bit paging structures and all of the fault and exception handlers need to detect the previous mode and switch if it's long mode.

Running a 64-bit app on OSX should be much more efficient than running a 32-bit app since the kernel is mapped into the lower 4GB so CR3 switch is not required to enter the kernel. As far as I understand, for 32-bit apps, each system call requires a process switch, which is quite expensive on x86 processors (it wasn't so expensive on PPC so the design worked okay there).

Reply Parent Score: 2

regomodo Member since:
2009-01-23

On Windows and Linux, not having a 64-bit kernel means not having 64-bit applications, either.

Mac OS X can run 64-bit applications on 64-bit machines even with the 32-bit kernel.

That isn't true, at least in Linux. You can have a 64bit userland on top of a 32bit kernel for a while now.

Reply Parent Score: 1

WereCatf Member since:
2006-02-15

That isn't true, at least in Linux. You can have a 64bit userland on top of a 32bit kernel for a while now.

You can? Last time I tried that it was a no-go. It's been a while, but I haven't read anywhere of such a change so I am a bit surprised.

Reply Parent Score: 4

broch Member since:
2006-05-04

Solaris does this (small changes to GRUB) and IBM does it too.

this is somethimes needed for let's say driver development or debugging.

However as your kernel is 32-bit, your app may be even 128-bit and still be limited by 32-bit kernel memory limitations. So for your system 64-bit app still behaves like 32-bit.

In short you have flag (64-bit) but not capabilities unless you switch to 64-bit kernel. For average user: useless.

Reply Parent Score: 1