New Tiny SSDT example

David, also known as toleda in our community, asked me for help last year (October), but you know me… I am always busy. Or pretending to be too busy, and thus I forgot about his request for help. Then. A few days ago I received another e-mail about it and I thought… Oops I did it again. Sorry David. I complete forgot. Anyway. I have some good news, because we solved the last piece of the SSDT puzzle.

Let’s first go back in time. Look at the WiKi of my late sister Samantha. There you will find three really amazing Tiny SSDT examples. Her work in 2011 enabled us to keep the DSDT and/or SSDT tables and still be able to disable/hide and/or rename Devices. Which was a great step forward for running OS X on our hacks. Oh yeah. I almost forgot. She also found a way to decompress/compress the ZLIB files.

David, and many people with him, used her TinySSDT examples and came up with great solutions to make things even easier. Audio among others. But one thing was still impossible, and that was that we couldn’t simply rename Device (B0D3) to Device (HDAU) but I have good news because now we can. You can find my TinySSDT example, for a GA-Z87MX-D3H with F6 BIOS right here.

In short. We found a new way to disable individual devices, including LNKx, PS2n and ThermalZones. Something that was not possible before. David already confirmed that it is working for him, so let’s go have some more fun with it. Have a look at the code (the new TinySSDT example) it and please remember this; In case you asked for my help, and I forgot you, then feel free to remind me about it 😉

Edit

The last piece of the audio puzzle is to find a way to load patched copies of the XML files. A puzzle I tried to solve last year, but David was unable to reproduce my success, so I am still using my dummy AudioHDA.kext trick. Which is neat, but it is time for some improvements.

Too bad that I lost the code, because now I have to do it all over again, but I can’t help it that my main SSD decided that it had enough of me and all my read/write attempts. Well. If only I had made backups, or pushed it to some repository, but I didn’t. Stupid but anyway. You know me. I may be slow, from time to time, but I think that I can pull it off again. Let me see what I can come up with 😉

Advertisements

8 thoughts on “New Tiny SSDT example

  1. No, but does it make something wrong? Or you just want to achieve as much nativity und mac-likeness what possible? I understand, if it make you fun time to hack with things, but gives it something for the normal hackintos users? I always delete the LNKx and PS2n Devices from my DSDT, so what is the point?

    • Nothing wrong, and yes. You can already remove code of LNKx and PS2n devices, but now we can do that without having to use a patched DSDT. This is new.

      Yes. I personally like to experiment with code, like ACPI tables, because one day someone, someone else perhaps, will come up with a new use case for it.

  2. But Macs do have Devices LNKA-LNKH under Device LPCB. This is from MacPro6,1:

    Device (LPCB)
    {
    Name (_ADR, 0x001F0000)
    Scope (\_SB)
    {
    OperationRegion (\_SB.PCI0.LPCB.LPC1, PCI_Config, 0x40, 0xC0)
    Field (\_SB.PCI0.LPCB.LPC1, AnyAcc, NoLock, Preserve)
    {
    Offset (0x20),
    PARC, 8,
    PBRC, 8,
    PCRC, 8,
    PDRC, 8,
    Offset (0x28),
    PERC, 8,
    PFRC, 8,
    PGRC, 8,
    PHRC, 8
    }

    Device (LNKA)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x01)
    Method (_DIS, 0, Serialized)
    {
    Or (PARC, 0x80, PARC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,10,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLA, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLA, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PARC, 0x0F), IRQ0)
    Return (RTLA)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PARC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PARC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKB)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x02)
    Method (_DIS, 0, Serialized)
    {
    Or (PBRC, 0x80, PBRC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,11,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLB, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLB, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PBRC, 0x0F), IRQ0)
    Return (RTLB)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PBRC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PBRC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKC)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x03)
    Method (_DIS, 0, Serialized)
    {
    Or (PCRC, 0x80, PCRC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,10,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLC, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLC, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PCRC, 0x0F), IRQ0)
    Return (RTLC)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PCRC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PCRC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKD)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x04)
    Method (_DIS, 0, Serialized)
    {
    Or (PDRC, 0x80, PDRC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,11,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLD, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLD, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PDRC, 0x0F), IRQ0)
    Return (RTLD)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PDRC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PDRC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKE)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x05)
    Method (_DIS, 0, Serialized)
    {
    Or (PERC, 0x80, PERC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,10,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLE, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLE, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PERC, 0x0F), IRQ0)
    Return (RTLE)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PERC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PERC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKF)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x06)
    Method (_DIS, 0, Serialized)
    {
    Or (PFRC, 0x80, PFRC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,11,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLF, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLF, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PFRC, 0x0F), IRQ0)
    Return (RTLF)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PFRC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PFRC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKG)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x07)
    Method (_DIS, 0, Serialized)
    {
    Or (PGRC, 0x80, PGRC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,10,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLG, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLG, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PGRC, 0x0F), IRQ0)
    Return (RTLG)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PGRC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PGRC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }

    Device (LNKH)
    {
    Name (_HID, EisaId ("PNP0C0F"))
    Name (_UID, 0x08)
    Method (_DIS, 0, Serialized)
    {
    Or (PHRC, 0x80, PHRC)
    }

    Name (_PRS, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {1,3,4,5,6,7,11,12,14,15}
    })
    Method (_CRS, 0, Serialized)
    {
    Name (RTLH, ResourceTemplate ()
    {
    IRQ (Level, ActiveLow, Shared, )
    {}
    })
    CreateWordField (RTLH, 0x01, IRQ0)
    Store (Zero, IRQ0)
    ShiftLeft (0x01, And (PHRC, 0x0F), IRQ0)
    Return (RTLH)
    }

    Method (_SRS, 1, Serialized)
    {
    CreateWordField (Arg0, 0x01, IRQ0)
    FindSetRightBit (IRQ0, Local0)
    Decrement (Local0)
    Store (Local0, PHRC)
    }

    Method (_STA, 0, Serialized)
    {
    If (And (PHRC, 0x80))
    {
    Return (0x09)
    }
    Else
    {
    Return (0x0B)
    }
    }
    }
    }

    • Sure. You can find the data in extracted DSDT’s, but that doesn\t mean it is used by OS X. Please check out the output of IORegistryExplorer and find that it isn’t there.

  3. So if you hide a device in your Tiny SSDT, will it still show up in the ioreg -lw0 output? I am hiding the COPR, FANx, TZ00, and TZ01, but they still show up in ioreg.

Leave a Reply

Fill in your details below or click an icon to log in:

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