Dienstag, 13. Oktober 2009

9.) [10.6] Final Touch

If you have your Mac OS X up and running, then it's time for the final touch. Get rid of the verbose booting messages, configure Chameleon to automatically boot your fresh installed Mac OS X 10.6 and displaying the gray Apple while booting. This is done by editing the file com.apple.Boot.plist in the Extra Folder of the Chameleon USB-Stick.

To disable the verbose booting you must change the "Kernel Flags" and the "Wait" key from:
<key>Kernel Flags</key>
<string>-v</string>
<key>Wait</key>
<string>Yes</string>

to:
<key>Kernel Flags</key>
<string></string>
<key>Wait</key>
<string>No</string>


To boot automatically your OS X installation you must first find out on which harddisk/partition it is installed. Chameleon numbers the harddisk chronologically starting with 0 and the partitions starting with 1. The Chameleon USB-Stick itself becomes disk number 0. Just press the "TAB" key at the Chameleon Boot Menu to see this Menu:


Find the hd(x,y) for your OS X Installation and configure the "Default Partition" in com.apple.Boot.plist. My OS X installation is on hd(1,2). It is also a good idea to configure a timeout, to be able to access the Chameleon Boot Menu and to boot from other disks or partitions:
<key>Default Partition</key>
<string>hd(1,2)</string>
<key>Timeout</key>
<string>10</string>


If you don't like the Chameleon Boot Logo, then you can enable the standard Apple Boot Logo with the following entry in com.apple.Boot.plist:
<key>Legacy Logo</key>
<string>Yes</string>


The complete com.apple.Boot.plist should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel</key>
<string>mach_kernel</string>
<key>Kernel Flags</key>
<string></string>
<key>Default Partition</key>
<string>hd(1,2)</string>
<key>Legacy Logo</key>
<string>Yes</string>
<key>Timeout</key>
<string>10</string>
<key>Wait</key>
<string>No</string>
<key>GraphicsEnabler</key>
<string>Yes</string>
<key>EthernetBuiltIn</key>
<string>Yes</string>
</dict>
</plist>

Sonntag, 11. Oktober 2009

8.) [10.6] Install Mac OS X

Time to install Mac OS X 10.6. Shutdown your PC. Connect the prepared harddisk. Insert the prepared Chameleon USB-Stick. Power on the PC and enter the BIOS setup. Verify all the BIOS settings as explained here. Save and Exit the BIOS setup.

Chameleon should boot from the USB-Stick and presents you this screen. I've enabled some debug output for. You can disable these debug outputs if you have successfully installed OS X and system is up and running.

Hit ENTER to boot the Mac OS X 10.6 Install DVD (restored to HD). You will see some debug messages from Chameleon.

Hit any key to continue booting OS X. It will boot in verbose mode.

After some time you can see the Mac OS X Installer. Follow the Installer.

Select the Partiton "Mac OS X" as install target. You can click on "Customize" to customize your OS X installation.

Time for a cup of coffee...

At the End you will see this Error. Ignore it! The installtion went fine. Just restart.

Once again in Chameleon. You will see two bootable Installation now. Select "Mac OS X" with the cursor keys (right/left) as show in the photo and hit ENTER.

Once again the Chameleon debug messages. Hit any key to continue...

Now you will see the Mac OS X Welcome Video Clip...

... and some additional steps to complete the installation process.

Finally the Mac OS X 10.6 Desktop.

If you have a working Internet connection, then OS X will check and download (in background) all available software updates. Go on and install all... it's safe to do ;-)

After one final restart you are done. Congratulations!!!

Samstag, 10. Oktober 2009

7.) [10.6] Setup the Chameleon USB-Stick

Finally the last step before you can start installing Mac OS X. I will show you how to setup the Chameleon USB-Stick. You need a Hardware UUID and must download this stuff as mentioned already here:
  1. Chameleon 2.0 RC3 (Chameleon-2.0-RC3-r658-bin.tar.gz)
  2. Kernel extensions and Chameleon support files (Link)
Insert the Chameleon USB-Stick you have prepared in step "6.) [10.6] Prepare the Chameleon USB-Stick" and save the two downloaded files on the Chameleon USB-Stick. To get rid of the "com.apple.quarantine" extended attribute launch the Terminal and run the following commands (the shell prompt is blue, the commands you have to enter are green):
[~] > cd /Volumes/Chameleon/
[/Volumes/Chameleon] > xattr -d com.apple.quarantine Chameleon_Support_Files.zip
[/Volumes/Chameleon] > xattr -d com.apple.quarantine Chameleon-2.0-RC3-r658-bin.tar.gz

Double Click each downloaded file so that the Finder will extract the content. This should give you the following files on the USB-Stick:


Adapt the Chameleon USB-Stick according to your hardware. Modify the Extra/smbios.plist as explained already here:
  • SMboardmanufactor: the mainboard manufactor
  • SMboardproduct: the mainboard type
  • SMmemmanufacter_X: the memory manufactor
  • SMmempart_X: the memory part number
  • SMmemserial_X: the memory serial number
  • SMmemspeed: the memory speed in Mhz
  • SMmemtype: the memory type DDR2=19, DDR3=24
Replace the Extra/DSDT.aml file with the patched DSDT for your mainboard. Configure the UUID you are going to use by modifying the kernel extensions Extra/10.5/Extensions/UUID.kext and Extra/10.6/Extensions/PlatformUUID.kext with right-click with the mouse and select "Show Package Content". Then edit the file Content/Info.plist in each kernel extension. Insert/Replace the UUID for the "key/value" UUID-key (10.5: UUID.kext) and PlatformUUID (10.6: PlatformUUID.kext).

10.5 UUID.kext/Content/Info.plist
   <key>CFBundleIdentifier</key>
<string>com.free.driver.UUID</string>
<key>IOClass</key>
<string>UUID</string>
<key>IOMatchCategory</key>
<string>UUID</string>
<key>IOProviderClass</key>
<string>IOPlatformExpertDevice</string>
<key>IOResourceMatch</key>
<string>SMBIOS</string>
<key>UUID-key</key>
<string>00000000-0000-1000-8000-001FD02E7359</string>

10.6 PlatformUUID.kext/Content/Info.plist
   <key>CFBundleIdentifier</key>
<string>com.superhai.driver.PlatformUUID</string>
<key>IOClass</key>
<string>PlatformUUID</string>
<key>IOMatchCategory</key>
<string>PlatformUUID</string>
<key>IOProviderClass</key>
<string>IOResources</string>
<key>IOResourceMatch</key>
<string>IOKit</string>
<key>PlatformUUID</key>
<string>00000000-1008-1000-8000-001FD02E7359</string>
You must also configure the cpu type you are going to use for your hackintosh in the CPUInjector.kext. If you also have a Intel Quad Core CPU, then you can leave it as it is, because it's preconfigured to use a Quad Core CPU. If not read this post and edit Info.plist of the CPUInjector kernel extensions and replace the value for cpu-type with the one for your CPU. Use the Base64 encoded value.

CPUInjector.kext/Content/Info.plist
   <key>IOProviderClass</key>
<string>IOPlatformDevice</string>
<key>entriesToAdd</key>
<dict>
<key>cpu-type</key>
<data>
AQU=
</data>
</dict>

To install Chameleon on the USB-Stick you must find out which disk identifier is used for your USB-Stick. In the still open Terminal run this command:
[/Volumes/Chameleon] > diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *465.8 Gi disk0
1: EFI 200.0 Mi disk0s1
2: Apple_HFS MacOS X 400.9 Gi disk0s2
3: Microsoft Basic Data BOOTCAMP 64.6 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *930.9 Gi disk1
1: Apple_partition_map 31.5 Ki disk1s1
2: Apple_HFS asere 930.9 Gi disk1s2
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.9 Gi disk2
1: Apple_HFS Chameleon 1.8 Gi disk2s1
The command "diskutil list" list all disks and all of their partitions. In my case the disk identifier is "disk2" (marked red). The device is /dev/disk2 an the partition is /dev/disk2s1. Please use for all upcoming terminal commands your disk identifier! It could be different than mine. I will continue using disk2.

Now let's install Chameleon. Run these commands in the Terminal and do not forget to use your disk identifier. First you must remount the USB-Stick to get rid of the "noowners", "nosuid" and "nodev" mount options as explained already here:
[/Volumes/Chameleon] > cd
[~] > sudo -s
Password:
root [~] > sync
root [~] > umount -f /Volumes/Chameleon/
root [~] > mkdir temp
root [~] > mount_hfs /dev/disk2s1 temp
root [~] > mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local)
fdesc on /dev (fdesc, union)
/dev/disk0s3 on /Volumes/BOOTCAMP (ntfs, local, read-only, noowners)
map -hosts on /net (autofs, automounted)
map auto_home on /home (autofs, automounted)
/dev/disk1s2 on /Users/asere (hfs, local, nodev, nosuid, journaled)
/dev/disk2s1 on /Users/asere/temp (hfs, local)
The mount command shows you that the USB-Stick (/dev/disk2s1) is mounted to temp without the "noowners", "nosuid" and "nodev" options. Now set the owner and group of all files and directories in the Chameleon Extra folder to root:wheel (0:0):
root [~] > cd temp
root [~/temp] > chown -R 0:0 Extra
Finally it's time to install Chameleon. Please note the "r" before the disk identifier. Using "rdisk" isn't a typo:
root [~/temp] > cp Chameleon-2.0-RC3-r658-bin/i386/boot .
root [~/temp] > chmod 755 boot
root [~/temp] > dd if=Chameleon-2.0-RC3-r658-bin/i386/boot1h of=/dev/rdisk2s1
2+0 records in
2+0 records out
1024 bytes transferred in 0.004469 secs (229138 bytes/sec)
root [~/temp] > fdisk -f Chameleon-2.0-RC3-r658-bin/i386/boot0 -u -y /dev/rdisk2
root [~/temp] > cd
root [~] > sync
root [~] > umount -f temp
root [~] > rmdir temp
Congratulations! You are done and can remove the USB-Stick now to install Mac OS X 10.6.

Unknown CPU / About this Mac [Update]

A reader of my Blog pointed my to the Digital DJ Blog. He has found a way to fix the "Unknown CPU" problem. Editing the file "/System/Library/CoreServices/Resources/English.lproj/AppleSystemInfo.string" is only cosmetic. For the OS the CPU is still "Unkown". His solution is a kernel extension, which injects a "cpu-type" property into the IORegistry. Read the blog for more info about this topic.

Currently known CPU types of OS X:
  1. Intel Xeon Quad: 1281 - 0x501 - 0x0105 (little endian) - AQU= (Base64)
  2. Intel Core 2 Duo: 769 - 0x301 - 0x0103 (little endian) - AQM= (Base64)
  3. Intel Core Solo: 257 - 0x101 - 0x0101 (little endian) - AQE= (Base64)
For the time being I'll integrate the CPUInjector.kext from Digital DJ. I've already updated the kernel extensions and support files package in the post "2.) [10.6] What do you need"

Dienstag, 6. Oktober 2009

6.) [10.6] Prepare the Chameleon USB-Stick

Put your USB-Stick in any MAC you have and start Disk Util (Application -> Utilities -> Disk Utility).
  1. Start Disk Utility
  2. Select the USB-Stick itself as show in the photo (do not select a partition on the stick).
  3. Select Partition
  4. Under Volume Scheme select 1 Partition
  5. Click "Options" and in the Options sheet select "GUID Partition Scheme"
  6. Choose a Name without spaces (I used Chameleon)
  7. Choose Format "Mac OS Extended" (this allows you do modify the stick under Linux)
  8. Click "Apply"
  9. DONE (it should look like in the foto)

Montag, 5. Oktober 2009

5.) [10.6] Restore the Mac OS X Install DVD to HardDisk

One major drawback of Chameleon is the missing "Mac OS X Install DVD" boot support. You cannot boot an Install DVD directly. There are workarounds with special, custom made Boot DVDs, but I think the easiest solution is to restore the "Mac OS X Install DVD" to a HardDisk with Disk Utility. This allows you to boot the Installer from the HardDisk, which in turn works great under Chameleon and even on a real Mac. A positive side effect of this approach is an enormous speedup of the installation process due to the use of a harddisk instead of a slow optical drive.

There are many possibilities to restore the Install DVD onto a harddisk. On a separate internal or external harddisk, on a free partition or even on an USB-Stick (>= 8GB). It's up to you. I will restore the Install DVD on the same harddisk on which you are going to install Mac OS X 10.6.

Connect the harddisk on which you are planning to install Mac OS X 10.6 to a real Macintosh and launch Disk Utility. For this guide I will use a Samsung 500GB HD502SJ.

In Disk Utility select the new HD, click on Partition and selct as Volume Scheme 2 Partitions.

Then click the Options button and select GUID Partiton Table + OK.

Now select the partition "Untitled 2" with a click go to Size and enter 16 and confirm with ENTER. Go to Name and enter 10.6 Install DVD. Leave the Format as it is: Mac OS Extended (Journaled).

Select the first partition "Untitled 1" and rename it to Mac OS X (or a name of your choice). On this partition you will install Mac OS X. Leave the Format as it is: Mac OS Extended (Journaled).

Now click the Apply button and then the Partition button.


You are done with the preparations of the HD. Now let's restore the "Snow Leopard" Mac OS X Install DVD onto the partition "10.6 Install DVD". Insert the Install DVD and select the partiton "10.6 Install DVD" on the left side as shown in the photo. The click on Restore.

Now Drag-and-Drop the "Mac OS X Install DVD" from the left side to the Source Textfield. Repeat this step with the "10.6 Install DVD" HD-Partition to the Destination Textfield. Then click on the Restore button, acknowledge the sheet and provide the Administrator credentials.

Take a cup of coffee... and you are DONE.

Sonntag, 4. Oktober 2009

4.) [10.6] Prepare a DSDT

DSDT is an acronym for Differentiated System Description Table. I've already wrote about it. Please read this article first as an introduction and to get some general infos. Modifying the original DSDT from your mainboard is the most complicated part of all. Unfortunately Mac OS X 10.6 "Snow Leopard" does not boot with the most of the original DSDTs.

First you might look into the "DSDTs ready for use with Chameleon" thread in the efixusers.com forum. There you can find a lot of already patched DSDTs I've made. Maybe you will find the one you need for your mainboard/BIOS-version already there. If not leave me a request there or continue here...

Using an Ububtu LiveCD is the easiest way to obtain the original DSDT. Boot the Ubuntu LiveCD and start a Terminal: Applications->Accessories->Terminal

In the Terminal run the following commands to dump the DSDT into the file dsdt.aml (will appear on the Desktop):
ubuntu@ubuntu:~$ cd Desktop
ubuntu@ubuntu:~/Desktop$ sudo cat /proc/acpi/dsdt > dsdt.aml


You can go even further and modify the DSDT right here using the Ubuntu LiveCD. To do so install the AML-Disassembler/Compiler "iasl". Open the Synaptic Package Manager:
System->Administration->SynapticPackageManager

Enter "iasl" in Quick search, click on the Checkbox left from the iasl Package and select "Mark for Installation", then click on Apply. This will install the "iasl" compiler/decompiler.


In a first step you must decompile the DSDT. In the still open Terminal run:
ubuntu@ubuntu:~$  iasl -d dsdt.aml

Intel ACPI Component Architecture
AML Disassembler version 20081204 [Jan 10 2009]
Copyright (C) 2000 - 2008 Intel Corporation
Supports ACPI Specification Revision 3.0a

Loading Acpi table from file dsdt.aml
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
..................................................................................................................................................................................................................................................................................................................................................................................................................................................
Parsing completed
Disassembly completed, written to "dsdt.dsl"
Now fix all Errors and Warnings and the HPET, RTC and TMR device as described here.

Another very important fix for "Snow Leopard" is the CMOS Reset Fix. Without this fix AppleRTC.kext will corrupt the CMOS NVRAM used by the BIOS, so that you must reconfigure the BIOS settings at every Boot/Restart. Open "dsdt.dsl" in your favorite editor and find the RTC device.
Device (RTC)
{
Name (_HID, EisaId ("PNP0B00"))
Name (ATT0, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x04, // Length
)
IRQNoFlags ()
{8}
})
Name (ATT1, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x04, // Length
)
})
Method (_CRS, 0, NotSerialized)
{
Return (ATT1)
}
}
And change the length of the IO segment ATT1 (marked red) from 0x04 to 0x02.
Device (RTC)
{
Name (_HID, EisaId ("PNP0B00"))
Name (ATT0, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x04, // Length
)
IRQNoFlags ()
{8}
})
Name (ATT1, ResourceTemplate ()
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x00, // Alignment
0x02, // Length
)
})
Method (_CRS, 0, NotSerialized)
{
Return (ATT1)
}
}
Chameleon RC2 introduced a new feature to autodetect the graphic card and the builtin ethernet ports (Time Machine Fix). Unfortunately this works only when the UID of the PCI root device PCI0 is 0. All Gigabyte DSDTs I've fixed are using UID=1 and therefore the autodetection does not work. Find the following _SB -> PCI0 -> Name (UID, 0x01) (marked red):
Scope (\_SB)
{
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

Device (PCI0)
{
Name (_HID, EisaId ("PNP0A03"))
Name (_ADR, 0x00)
Name (_UID, 0x01)
Name (_BBN, 0x00)
Method (_S3D, 0, NotSerialized)
...and replace it with Name (UID, 0x00) (marked green):
Scope (\_SB)
{
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

Device (PCI0)
{
Name (_HID, EisaId ("PNP0A03"))
Name (_ADR, 0x00)
Name (_UID, 0x00)
Name (_BBN, 0x00)
Method (_S3D, 0, NotSerialized)

Now you have a DSDT with all mandatory patches to run Mac OS X 10.6. Just compile it and use the resulting dsdt.aml along with Chameleon.
ubuntu@ubuntu:~$  iasl -ta dsdt.dsl

Intel ACPI Component Architecture
AML Disassembler version 20081204 [Jan 10 2009]
Copyright (C) 2000 - 2008 Intel Corporation
Supports ACPI Specification Revision 3.0a

ASL Input: dsdt.dsl - 5931 lines, 197099 bytes, 2427 keywords
AML Output: dsdt.aml - 18854 bytes, 667 named objects, 1760 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 31 Optimizations
These are some other useful DSDT patches. You can fix the USB Device Removal Warning for the EHCI ports, make Onboard Sound or the Powerbutton working. I will describe some of them later.

Samstag, 3. Oktober 2009

3.) [10.6] BIOS Settings

The BIOS settings are important for a successful Mac OS X 10.6 installation. Try to update to the latest BIOS version and make this before continuing with the DSDT part, because a newer BIOS might result in a different DSDT. I'm using BIOS version 10a (Beta). It has a newer AHCI BIOS version 1.20, which gives you a 10 seconds quicker boot time.

Important: To bring up Mac OS X 10.6 on your PC, I do recommend to not use any PCI/PCI-E expansion cards in the first step. Disable all the not needed onboard hardware, like Sound, UART, LPT, IDE, Floppy. Do not connect any special hardware to the USB or Firewire ports. Use only a USB mouse and a USB keyboard. If you have Mac OS X 10.6 up and running, then try to bring up all the other hardware step by step.

Do not overclock your system and take care of the DRAM voltage. My DRAM runs at 1066Mhz and according to the datasheet it needs 2,2V at that speed. But the BIOS only used 1,8V automatically, which gaves me a lot of kernel panics. I got a stable system only after I had changed the DRAM voltage manually to 2,1V.

Enter BIOS Setup and load the optimized default settings:



Enter MB Intelligent Tweaker to verify the BIOS defaults and to set DRAM speed and voltage:




Enter Standard CMOS Features to disable the Floppy:

Enter "Advanced BIOS Features" to setup the boot priority & order:


Enter "Integrated Peripherals" to enable SATA AHCI and disable Sound, SMART LAN, IDE, UART and LPT. You can also disable the second LAN port if you don't need it.

In "Power Management Setup" set Suspend Type to S3 and enable HPET 64Bit mode.