Introduction

This is documentation of the hardware specific configuration that my Hackintosh requires in order to run unpatched retail version of Mac OS X 10.6 Snow Leopard perfectly. So this is not a generic guide, more like reminder for myself. Of course many of these tricks can be applied to other hardware configurations as well, especially if using a motherboard manufactured by Gigabyte.

The hardware configuration is the following:

  • Intel Xeon X3350 processor
  • 4x 1GB Kingston HyperX KHX8500D2
  • Gigabyte GA-EX38-DS5 motherboard, BIOS version F4
    • Intel ICH9 chipset
    • ALC889 audio chip
  • Gigabyte GV-NX88T512HP NVIDIA GeForce 8800 GT graphics card
  • 3ware 9650SE-4LPML SATA RAID controller
    • 4x Western Digital Velociraptor 300GB WD3000GLFS hard disks configured in RAID10

See my ?hardware inventory on the machine for more details about the system.

Kernel extensions

Besides the mendatory kernel extensions I need the following drivers to be placed inside the preboot image as described in the article Create preboot image for Chameleon bootloader.

  • LSI3ware9000.kext [1]
    • Driver for the 3ware RAID Controller. Referenced driver is a beta release. The current stable release[2] doesn’t support 64-bit driver as of writing this.

DSDT patches

I use the following set of patches that are applied against the ASL source of the DSDT of the motherboard that was extracted and decompiled as documented in the posting Create preboot image for Chameleon bootloader.

Fix compiler errors

This patch fixes errors in the source code noted by iasl compiler[3],[4]

--- dsdt.dsl.orig      2010-02-05 22:34:31.000000000 +0200
+++ dsdt.dsl       2010-02-05 22:37:10.000000000 +0200
@@ -276,18 +276,23 @@
         Notify (\_SB.PCI0.USB3, 0x00)
         Notify (\_SB.PCI0.USB4, 0x00)
         Notify (\_SB.PCI0.USB5, 0x00)
+        Return (Package (0x02)
+        {
+            Zero,
+            Zero
+        })
     }
 
     Scope (\_SI)
     {
         Method (_MSG, 1, NotSerialized)
         {
-            Store (Local0, Local0)
+            Store (Zero, Local0)
         }
 
         Method (_SST, 1, NotSerialized)
         {
-            Store (Local0, Local0)
+            Store (Zero, Local0)
         }
     }
 

Download patch

Fix CMOS corruption

Booting Mac OS X without this patch corrupts the CMOS of the motherboard[4],[5],[6]. You don’t need ElliottForceLegacyRTC.kext when this is applied.

--- dsdt.dsl.orig      2010-02-05 22:34:31.000000000 +0200
+++ dsdt.dsl       2010-02-05 23:42:48.000000000 +0200
@@ -3144,7 +3144,7 @@
                             0x0070,             // Range Minimum
                             0x0070,             // Range Maximum
                             0x00,               // Alignment
-                            0x04,               // Length
+                            0x02,               // Length
                             )
                         IRQNoFlags ()
                             {8}
@@ -3155,7 +3155,7 @@
                             0x0070,             // Range Minimum
                             0x0070,             // Range Maximum
                             0x00,               // Alignment
-                            0x04,               // Length
+                            0x02,               // Length
                             )
                     })
                     Method (_CRS, 0, NotSerialized)

Download patch

CPU power management

The following fixes are needed in order to make native Mac OS X CPU power management work[3],[4]. You don’t need NullCPUPowerManagement.kext when this is applied.

--- dsdt.dsl.orig      2010-02-17 03:07:40.000000000 +0200
+++ dsdt.dsl       2010-02-17 03:10:23.000000000 +0200
@@ -3060,21 +3060,7 @@
                     })
                     Method (_CRS, 0, NotSerialized)
                     {
-                        If (LGreaterEqual (OSFX, 0x03))
-                        {
-                            If (HPTF)
-                            {
-                                Return (ATT6)
-                            }
-                            Else
-                            {
-                                Return (ATT5)
-                            }
-                        }
-                        Else
-                        {
-                            Return (ATT5)
-                        }
+                        Return (ATT6)
                     }
                 }
 
@@ -3097,40 +3083,12 @@
                     })
                     Method (_STA, 0, NotSerialized)
                     {
-                        If (LGreaterEqual (OSFX, 0x03))
-                        {
-                            If (HPTF)
-                            {
-                                Return (0x0F)
-                            }
-                            Else
-                            {
-                                Return (0x00)
-                            }
-                        }
-                        Else
-                        {
-                            Return (0x00)
-                        }
+                        Return (0x0F)
                     }
 
                     Method (_CRS, 0, NotSerialized)
                     {
-                        If (LGreaterEqual (OSFX, 0x03))
-                        {
-                            If (HPTF)
-                            {
-                                Return (ATT3)
-                            }
-                            Else
-                            {
-                                Return (ATT4)
-                            }
-                        }
-                        Else
-                        {
-                            Return (ATT4)
-                        }
+                        Return (ATT3)
                     }
                 }
 
@@ -3159,21 +3117,7 @@
                     })
                     Method (_CRS, 0, NotSerialized)
                     {
-                        If (LGreaterEqual (OSFX, 0x03))
-                        {
-                            If (HPTF)
-                            {
-                                Return (ATT1)
-                            }
-                            Else
-                            {
-                                Return (ATT0)
-                            }
-                        }
-                        Else
-                        {
-                            Return (ATT0)
-                        }
+                        Return (ATT1)
                     }
                 }
 

Download patch

Enable autoinsertion of EFI strings for the graphics card

Chameleon supports autoinsertion of EFI strings for NVIDIA graphics card[7]. Unfortunately, there’s a bug with Gigabyte DSDT that prevents this from working[3]. In order to fix that you need the following patch.

--- dsdt.dsl.orig      2010-02-05 22:34:31.000000000 +0200
+++ dsdt.dsl       2010-02-08 03:18:09.000000000 +0200
@@ -401,7 +401,7 @@
         {
             Name (_HID, EisaId ("PNP0A03"))
             Name (_ADR, 0x00)
-            Name (_UID, 0x01)
+            Name (_UID, 0x00)
             Name (_BBN, 0x00)
             Method (_S3D, 0, NotSerialized)
             {

Download patch

Enable device data insertion

Some of the patches below requires the DTGP method in order to insert faked device ids, layout ids and other data to the onboard devices and thus fooling Mac OS X to believe genuine Apple components exists in the system for which the stock drivers can be load [4].

--- dsdt.dsl.orig      2010-02-09 00:34:52.000000000 +0200
+++ dsdt.dsl       2010-02-09 00:34:40.000000000 +0200
@@ -218,6 +218,38 @@
             }
         }
     }
+    Method (DTGP, 5, NotSerialized)
+    {
+        If (LEqual (Arg0, Buffer (0x10)
+                {
+                    /* 0000 */    0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, 
+                    /* 0008 */    0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
+                }))
+        {
+            If (LEqual (Arg1, One))
+            {
+                If (LEqual (Arg2, Zero))
+                {
+                    Store (Buffer (One)
+                        {
+                            0x03
+                        }, Arg4)
+                    Return (One)
+                }
+
+                If (LEqual (Arg2, One))
+                {
+                    Return (One)
+                }
+            }
+        }
+
+        Store (Buffer (One)
+            {
+                0x00
+            }, Arg4)
+        Return (Zero)
+    }
     Method (\_WAK, 1, NotSerialized)
     {
         Store (0xFF, DBG1)

Download patch

Power button

This patch enables you to put the computer to sleep by pressing the power button[4].

--- dsdt.dsl.orig      2010-02-17 03:29:10.000000000 +0200
+++ dsdt.dsl       2010-02-17 03:29:32.000000000 +0200
@@ -389,7 +389,7 @@
     {
         Device (PWRB)
         {
-            Name (_HID, EisaId ("PNP0C0C"))
+            Name (_CID, EisaId ("PNP0C0C"))
             Method (_STA, 0, NotSerialized)
             {
                 Return (0x0B)

Download patch

USB

This patch changes the device ids of the USB controller to match those of Intel ICH10 chipset which Mac OS X recognizes as built-in. It is important to have the USB ports seen as built-in by Mac OS X or otherwise you’ll get problems when resuming the machine from sleep[8],[9].

--- dsdt.dsl.orig      2010-02-19 00:22:15.000000000 +0200
+++ dsdt.dsl       2010-02-19 00:27:51.000000000 +0200
@@ -4084,6 +4084,19 @@
                     0x03, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x34, 0x3A, 0x00, 0x00
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USB1)
@@ -4104,6 +4117,19 @@
                     0x04, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x35, 0x3A, 0x00, 0x00
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USB2)
@@ -4124,6 +4150,19 @@
                     0x0C, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x36, 0x3A, 0x00, 0x00
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USB3)
@@ -4164,6 +4203,19 @@
                     0x0E, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x37, 0x3A, 0x00, 0x00
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USB4)
@@ -4184,6 +4236,19 @@
                     0x05, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x38, 0x3A, 0x00, 0x00
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USB5)
@@ -4204,6 +4269,19 @@
                     0x20, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x39, 0x3A, 0x00, 0x00
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USBE)
@@ -4224,6 +4302,24 @@
                     0x0D, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x04)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x3A, 0x3A, 0x00, 0x00
+                        },
+                        "AAPL,clock-id",
+                        Buffer (0x01)
+                        {
+                            0x0A
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (USE2)
@@ -4244,6 +4340,24 @@
                     0x0D, 
                     0x03
                 })
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x04)
+                    {
+                        "device-id",
+                        Buffer (0x04)
+                        {
+                            0x3C, 0x3A, 0x00, 0x00
+                        },
+                        "AAPL,clock-id",
+                        Buffer (0x01)
+                        {
+                            0x0A
+                        },
+                     }, Local0)
+                     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                     Return (Local0)
+                 }
             }
 
             Device (IDE1)

Download patch

SATA

This patch fakes the device ids of the onboard SATA AHCI devices to match Intel ESB2 AHCI controller. Mac OS X will detect devices connected to ESB2 controller as internal. Without this patch the controller model is not detected by Apple’s SATA AHCI driver and the controller is seen as external. Since real Macs don’t offer any eSATA ports and thus Mac OS X lacks proper SATA hot-plugging facilities[10], this doesn’t affect functionality of the SATA controller or disks connected to it. But without this patch the disks will get the orange external disk icon in Finder. With the DSDT patch applied disks connected to the motherboard SATA connectors will show the gray internal disk icon[11].

--- dsdt.dsl.orig      2010-02-17 02:02:37.000000000 +0200
+++ dsdt.dsl       2010-02-17 02:04:40.000000000 +0200
@@ -4272,6 +4272,19 @@
                     FAS1,   2
                 }
 
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                        {
+                            "device-id", 
+                            Buffer (0x04)
+                            {
+                                0x81, 0x26, 0x00, 0x00
+                            }
+                        }, Local0)
+                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                    Return (Local0)
+                }
                 Device (PRIM)
                 {
                     Name (_ADR, 0x00)
@@ -4394,6 +4407,19 @@
                     FAS1,   2
                 }
 
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x02)
+                        {
+                            "device-id", 
+                            Buffer (0x04)
+                            {
+                                0x81, 0x26, 0x00, 0x00
+                            }
+                        }, Local0)
+                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                    Return (Local0)
+                }
                 Device (PRIM)
                 {
                     Name (_ADR, 0x00)

Download patch

Audio

The following patch enables the ALC889 audio to work with stock Apple drivers[4].

--- dsdt.dsl.orig      2010-02-05 22:34:31.000000000 +0200
+++ dsdt.dsl       2010-02-09 00:24:11.000000000 +0200
@@ -341,7 +341,7 @@
             Notify (\_SB.PCI0.USBE, 0x02)
             Notify (\_SB.PCI0.USE2, 0x02)
             Notify (\_SB.PWRB, 0x02)
-            Notify (\_SB.PCI0.AZAL, 0x02)
+            Notify (\_SB.PCI0.HDEF, 0x02)
         }
 
         Method (_L02, 0, NotSerialized)
@@ -5062,7 +5062,7 @@
                 }
             }
 
-            Device (AZAL)
+            Device (HDEF)
             {
                 Name (_ADR, 0x001B0000)
                 Method (_PRW, 0, NotSerialized)
@@ -5073,6 +5073,21 @@
                         0x05
                     })
                 }
+                Method (_DSM, 4, NotSerialized)
+                {
+                    Store (Package (0x04)
+                    {
+                        "layout-id",
+                        Buffer (0x04)
+                        {
+                            0x42, 0x00, 0x00, 0x00
+                        },
+                        "PinConfigurations",
+                        Buffer (Zero) {}
+                    }, Local0)
+                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                    Return (Local0)
+                }
             }
 
             Name (BUFA, ResourceTemplate ()

Download patch

Networking

The following patch makes Mac OS X see the onboard Ethernet devices as built-in, not external. Mac OS X uses the MAC address of the machine’s primary built-in network interface as part of the machine’s unique id[4].

--- dsdt.dsl.orig      2010-02-17 01:26:56.000000000 +0200
+++ dsdt.dsl       2010-02-17 01:26:38.000000000 +0200
@@ -1321,6 +1321,33 @@
                     })
                 }
 
+                Device (LAN0)
+                {
+                    Name (_ADR, 0x00)
+                    Name (_PRW, Package (0x02)
+                    {
+                       0x0B,
+                       0x04
+                    })
+                    Method (_DSM, 4, NotSerialized)
+                    {
+                       Store (Package (0x04)
+                       {
+                          "built-in",
+                          Buffer (0x01)
+                          {
+                             0x01
+                          },
+                          "device_type",
+                          Buffer (0x09)
+                          {
+                             "ethernet"
+                          }
+                       }, Local0)
+                       DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                       Return (Local0)
+                    }
+                }
                 Name (PIC4, Package (0x04)
                 {
                     Package (0x04)
@@ -1419,6 +1446,33 @@
                     })
                 }
 
+                Device (LAN1)
+                {
+                    Name (_ADR, 0x00)
+                    Name (_PRW, Package (0x02)
+                    {
+                       0x0B,
+                       0x04
+                    })
+                    Method (_DSM, 4, NotSerialized)
+                    {
+                       Store (Package (0x04)
+                       {
+                          "built-in",
+                          Buffer (0x01)
+                          {
+                             0x01
+                          },
+                          "device_type",
+                          Buffer (0x09)
+                          {
+                             "ethernet"
+                          }
+                       }, Local0)
+                       DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+                       Return (Local0)
+                    }
+                }
                 Name (PIC5, Package (0x04)
                 {
                     Package (0x04)

Download patch

SMBIOS

This is just for the cosmetics, but I use the following smbios.plist to set the system serial number and some other hardware details.

<?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>SMserial</key>
    <string>IICOROE2TEI</string>
    <key>SMbiosvendor</key>
    <string>Gigabyte</string>
    <key>SMbiosversion</key>
    <string>F4</string>
    <key>SMbiosdate</key>
    <string>07/25/2008</string>
    <key>SMboardmanufacturer</key>
    <string>Gigabyte</string>
    <key>SMboardproduct</key>
    <string>GA-EX38-DS5</string>
    <key>SMmemtype</key>
    <string>19</string>
    <key>SMmemspeed</key>
    <string>1066</string>
    <key>SMmemmanufacter</key>
    <string>Kingston</string>
    <key>SMmempart_1</key>
    <string>KHX8500D2</string>
    <key>SMmempart_2</key>
    <string>KHX8500D2</string>
    <key>SMmempart_3</key>
    <string>KHX8500D2</string>
    <key>SMmempart_4</key>
    <string>KHX8500D2</string>
</dict>
</plist>

Boot configuration

I use the following com.apple.Boot.plist. It allows booting of Mac OS X with no delays. Also booting is limited to the disk where the Chameleon bootloader was load from since this disk also contains the Mac OS X installation.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>GraphicsEnabler</key>
    <string>Yes</string>
    <key>Legacy Logo</key>
    <string>Yes</string>
    <key>Quiet Boot</key>
    <string>Yes</string>
    <key>GUI</key>
    <string>No</string>
    <key>Scan Single Drive</key>
    <string>Yes</string>
</dict>
</plist>

References