quarta-feira, dezembro 30, 2009

Snow Leopard 64 bit on unsupported Macbook

According to almost everyone there is no specific advantage in running a 64 bit kernel, but if you wan't to try it on your Macbook this is the way to do it.

This was tested on a Macbook3,1 (Late 2007) 2,0 Ghz 4Gb ram.

First of all kudos for Amit Singh, Netkas and Petr.

If you read Amit´s post and Netkas you will find out that it is possible to hack Snow Leopard to run in 64bit mode on machines unsupported by Apple. Petr gave the final piece of info to enable the hack on my Macbook 3,1. (See post 99 on Netkas Blog).

Why, the need for a hack?
Apple, in their everpresent care for the users decided that for compatibility reasons it was better to disable 64 bit mode on older machines.
The reason for this is that drivers (kernel extensions) for some hardware where not ported to 64 bit so some functions would not work (namely video in my macbook). Also apple and third party software developers needed time to port 64 bit versions of their kexts.
For the normal user running the kernel in 32bit mode is not an issue sice apps will still run on 64 bit mode.

This is an hack so there might be problems. In my case sleep doesn't work yet. But if you wanna try, do it knowing that it is on your own risk.

So what do you need?
A Macbook3,1 with Snow Leopard 10.6.2 installed (10.6.2 includes 64 bit intel video driver)
A hex editor (I used HexEditor 1.4)
Some knowlege of how to input commands on terminal.app

How to do it?

Fire up Terminal.app
Backup you boot.efi sudo cp /System/Library/CoreServices/boot.efi ./boot64.efi
If boot64.efi is locked, unlock it
Fire up you hex editor open boot64.efi and go to offset 0x266e0 there should be:

0x266E0: 38 47 01 00 00 00 00 00 00 00 00 00 00 00 00 00

you will change to

0x266E0:38 47 01 00 00 00 00 00 01 00 00 00 00 00 00 00

this means that Macbook1,x or higher is allowed to boot into 64 bit mode

Enter the followin commands in terminal

sudo cp boot64.efi /System/Library/CoreServices/

cd /System/Library/CoreServices/

sudo chown root:wheel boot64.efi

sudo chflags uchg boot64.efi

sudo bless −−folder /System/Library/CoreServices/ −−file /System/Library/CoreServices/boot64.efi

Dont forget enter after each cammand and the password if asked for it

You should be able to reboot into 64 bit mode holding the "6" and "4" keys at boot time

If you wan't to make it permanent

in terminal enter sudo systemsetup -setkernelbootarchitecture x86_64

Good luck