A beginner’s introduction to the ACPI Table.

I remember how hard it was to understand the DSDT editing principles when I started to look at this…

For years I thought that only by achieve Mac OS X’s installation at my machine, using modified kexts for every single need, I was an real Hacker (read it Hackintosher)…

But I was wrong… A real Hacker have to “truly” place his hands at the work… He really has to modify things by himself… Not to wait for someone make his job…

But the information… Specificaly concerning to the ACPI Table (Advanced Configuration and Power Interface), was very scarce (and still is), so I had to get help…

So, one day I was having a conversation through the chat with oldnapalm, when he made the things very clear to me… He told me, “kyndder, DSDT = BIOS”

Those words, made me understand the principle on a very simple way…

To edit the DSDT is just like changing the BIOS’s settings through the BIOS setup… Like increase Fan speed, change SATA mode to AHCI, switch between on-board/discrete GPU, etc… But in a different way… Instead of only switch on/off an specific feature, you can do a bit more…

The main thing while editing the DSDT to be used for OS X, is to keep in mind that the way OS X handles the ACPI table is a bit different than other OSes…

For example, depending on the OEM (Original Equipment Manufacturer), the USB EHCI controller may be called as Device EUSB at your DSDT, but OS X expects Device EHCI, the same for the UHCI controller that may be called Device USBE and OS X expects Device UHCI

Device (USB4) --Wrong for OS X, it expects UHC4 instead.
            {
                Name (_ADR, 0x00130000)
                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0B, 0x04))
                }
            }

Another example is the DTGP Method that MUST be present at the DSDT in order to inject custom parameters to some devices…

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)
}

A lot more easy to understand thinking this way right?

But the DSDT (Differentiated System Description Table) isn’t the only ACPI table that we must correct in order to have our Hackintoshes even closer to a Real Mac…

There is also the SSDT Table (Secondary System Description Table) that must be corrected…

The SSDT Table contains additional information for some devices, because of this, the same system may have more than 4 SSDT Tables that can be named as SSDT-1, SSDT-2, and so on… But at the begin, we must focus at the SSDT Table that controls the CPUPM (CPU Power Management), to know the right one for you, you must look at it’s TableID that usually are CpuPm or Cpu0Ist

The same example explained above for the USB device applies to the SSDT… OS X expect Methods APSS and ACST to control P-States (Processor States, read it from low to higher activity) and C-States (Computer States, read it from low to idle activity) respectively, but also, depending on the OEM, you will find _PSS and _CST Methods at your original SSDT Table…

Method (_CST, 0, NotSerialized)  --Wrong, OS X expects ACST.
        {
            Return (Package (0x04)
            {
                0x03, 
                Package (0x04)
                {
                    ResourceTemplate ()
                    {
                        Register (FFixedHW, 
                            0x01,               // Bit Width
                            0x02,               // Bit Offset
                            0x0000000000000000, // Address
                            ,)
                    }, 

                    One, 
                    Zero, 
                    0x03E8
                },

Now, having all this in mind (and believe me, it’s far from all you can do), will be much more easy to think about ACPI Tables…

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s