Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 7, 2007, 07:27 PM   #1
planetbeing
macrumors member
 
Join Date: Oct 2007
32-bit kernel in Leopard?

I've already done some research, but Google has been giving me diminishing returns, so I thought it might be more efficient just to ask.

As you know, Apple markets Leopard as a 64-bit operating system. It also advertises full compatibility with existing 32-bit drivers and applications "with no emulation". Application compatibility seems to be done by simply having two versions of every library (well, more like four, because of PowerPC).

So what about driver compatibility? Well, at little research has indicated that the kernel itself is still 32-bit, in order to maintain compatibility with 32-bit drivers. That's all good and well. But...

How the heck would it run 64-bit drivers?!

Could someone explain to me whether 64-bit drivers run, and how this is accomplished?
planetbeing is offline   0 Reply With Quote
Old Nov 7, 2007, 08:27 PM   #2
Muncher
macrumors 65816
 
Muncher's Avatar
 
Join Date: Apr 2007
Location: California
As far as I know (and I know very little ), the discs contain both a 64-bit and a 32-bit version for x86 processors, as well as a 64 and 32-bit version for ppc processors. Now, I personally can't see how they fit it all on there,and my guess is that there's some common non-crucial 32-bit code for the ppc and x86. That would be (if anything) apps like safari or mail, or other things like that.

But I really don't know. I just saw a question with no answer, thought about it, and took a well aimed stab .
__________________
2.4Ghz 20" Rev. A iMac, Wii, crimson DS, intuos3 4x6, PS3
iPod touch 2G 16GB > Fiio E1 > Hifiman RE0
Muncher is offline   0 Reply With Quote
Old Nov 7, 2007, 09:54 PM   #3
larkost
macrumors 6502a
 
Join Date: Oct 2007
You don't need 64bit drivers, and there are none on the Mac platform. Windows only needs them because Microsoft messed up the transition so badly and haas ot have two completely separate environment. Apple has a much cleaner implementation that nicely allows 32bit and 64bit to run together (more or less).
larkost is offline   0 Reply With Quote
Old Nov 8, 2007, 02:42 AM   #4
planetbeing
Thread Starter
macrumors member
 
Join Date: Oct 2007
@larkost: I don't think your description of the situation is accurate.

Microsoft's implementation is a lightweight translation layer called WOW64 that sits between 64-bit libraries and 32-bit applications. Apple's solution is to ship both 32-bit and 64-bit libraries. If anything, OS X is the one that has two completely separate environments.

Microsoft's solution, however, is necessarily more complex because the problem is complicated by the existence of the registry, which OS X doesn't have. The translation layer has to handle that as well.

However, it seems to be done well, and there are no problems that are innately related to running in a 64-bit environment.

I have much less information on Apple, however, and that's what I'm trying to remedy. Do you have a source on the assertion that there are no and can be no 64-bit drivers for Leopard?

@Muncher: Thanks for replying! Code usually doesn't take that much room, it's the resources that do most of the damage, as a look through my iTunes directory will attest.

However, I read elsewhere that Apple didn't actually bundle any 64-bit applications with Leopard (only Chess as a demo application) because most applications would just take up more space in memory (64-bit code is bigger) without any perceptible performance benefit.
planetbeing is offline   0 Reply With Quote
Old Nov 8, 2007, 03:11 AM   #5
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by planetbeing View Post
How the heck would it run 64-bit drivers?!

Could someone explain to me whether 64-bit drivers run, and how this is accomplished?
It doesn't. And it never will until someone comes up with a reason why having a 64-bit driver would be an advantage to any user, and on top of that an advantage that is worth the extra programming, debugging and maintenance effort for the driver developer.
gnasher729 is offline   0 Reply With Quote
Old Nov 8, 2007, 04:13 AM   #6
Persifleur
macrumors member
 
Join Date: Jun 2005
Location: London, UK
Quote:
Device drivers are implemented on Mac OS X as kernel extensions that load dynamically when matching hardware devices are detected. Mac OS X supports both 32-bit and 64-bit drivers.
http://developer.apple.com/hardwared.../overview.html

How does it do it? I don't know enough about kernel design to speculate.
Persifleur is offline   0 Reply With Quote
Old Nov 8, 2007, 08:55 AM   #7
Sayer
macrumors 6502a
 
Sayer's Avatar
 
Join Date: Jan 2002
Location: Austin, TX
Actually going to 64-bit on Intel hardware would be an advantage because of the architectural changes inherent in such a change e.g. more general purpose registers available (matching what PPC has had since forever) and register-based parameter passing instead of stack-based passing and PC-relative addressing (as with PPC et al).

For PowerPC the difference between 32-bit and 64-bit is semantic, there really is no difference at the lower levels. For intel CPUs OS X intelligently loads an appropriate binary based on environment and the software that it is running, A single app can potentially have four different executables inside it: 32-bit PPC, 64-bit PPC, 32-bit intel, and 64-bit intel.

There is no hard requirement for a 64-bit app/framework/driver to run on a 64-bit processor under OS X in 64-bit mode. This aint Windoze, folks.
__________________
Obama is a true statesman whose experience as a state senator, half-term US Senator & guest lecturer in a Constitutional Law class has fully prepared him to take control of our nuclear arsenal.-Me
Sayer is offline   0 Reply With Quote
Old Nov 8, 2007, 09:06 AM   #8
iSee
macrumors 68030
 
iSee's Avatar
 
Join Date: Oct 2004
^^^
There aren't really 64-bit drivers on Mac OS X.
There are a few things you have to do to play nice with or even take advantage of a 64-bit memory space.

http://developer.apple.com/documenta...section_8.html

http://developer.apple.com/documenta...section_4.html


By the way, even reading the word WOW64 makes me want to barf. Ugh. Admitedly, I had to deal with it in the worst possible situation (dealing with installation and configuration of 64-bit and 32-bit drivers and related software from both 32-bit and 64-bit code--don't ask why--one of our suppliers were incredible idiots). WOW64 is terrible, horrible, ugly, and disgusting.
iSee is offline   0 Reply With Quote
Old Nov 8, 2007, 12:42 PM   #9
Krevnik
macrumors 68020
 
Krevnik's Avatar
 
Join Date: Sep 2003
The kernel is 32-bit.

You can write your driver to have a 64-bit image in the binary, but it won't ever get loaded by Leopard, since the kernel is a 32-bit process and will link against the 32-bit images of the drivers.

That said, if you write drivers, I recommend letting it built 64-bit as well, as it will save you time in the long-run when a 64-bit kernel is introduced. You will at least have a compiling version of the driver which will have good odds of just working.
__________________
iMac 2013 27", 13" rMBP, iPad 4, iPhone 5s
Krevnik is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Kernel Panic installing Snow Leopard adrianruego Mac Pro 4 Apr 26, 2014 02:43 PM
Kernel Panics: MacBook5,1 Late 2008 Unibody OS X 10.6.8 Snow Leopard holyster MacBook Pro 1 Dec 27, 2013 05:15 PM
Reinstall Failure Snow Leopard 64-bit jj17 OS X 3 Dec 28, 2012 09:24 PM
Constant Snow Leopard Kernel Panics XFire OS X 3 Nov 15, 2012 06:22 AM
Snow Leopard Kernel Panic Sheroo OS X 2 Aug 15, 2012 05:54 AM

Forum Jump

All times are GMT -5. The time now is 08:56 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC