Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

Hi, I am taking this excellent DSDT class. As I was reading through it I stopped here:



Is there a typo or am I too dumb to understand?
You rename it because it interferes. Then its a problem again after you rename it? whut?

Fixed... Missing word added.
 
I am surprised that nobody noticed that earlier. Dont people read this?

The human brain tends to add missing words, especially if they are obvious.
 
The human brain tends to add missing words, especially if they are obvious.

I am reading myself into the ACPI Specifiaction PDF. It is really huge and overwhelming.
However I have some entries in an original Apple DSDT dump that I cannot find there.
Which kind of makes sense, since Apple doesnt comply to the standards of the PC Manufacturers and thus we need to translate it to Apple's ACPI language.

Is there some kind of Apple ACPI Specification PDF just like the one for PCs? So I can understand what each method is for. Like "RP01".
Or is this pure reverse Engineering? Like guessing that EHC must be the equivalent to EUSB etc. and thus must be renamed like that.
________________________________________________
Edit: Ok. I think I am slowly understanding more. Apple uses the same methods. Nothing fancy there as it seems. However the names/addresses whatever you call it are different. Hence renaming. You dont/cant change methods.
If you look at the ACPI Specs, it doesnt tell you how to call your Integrated Graphics. This vocabulary , naming things or rather calling them by their names, should be OS specific then. And these PC Mainboards are basically Windows Mainboards. Well rather BIOSes.

The next thing that I dont understand yet is, why we are applying patches like renaming EHC1 to EH01.
I have both original DSDTs from iMac11,2 and my H57 board , side by side in front of me.
I keep looking at it and the USB Ports are called USB0 etc on the Gigabyte board and EHC1 etc on the iMac.

So EHC1 is basically used by Apple and I thought we want to match Apple? But instead we are renaming it to EH01.
Which basically means we want to escape from Apple. And that only leaves one conclusion, meaning we dont want parity there because we want to avoid a collision?
But we have to feed osx with information from the BIOS and let it handle the Power Savings Features etc :S

Where does OSX get the information from, how does it manage things now?
Do you let a "middleman" take care of the communication now? Is that what we refer to as "injectors"?

Sorry for having lot of questions. I am just trying to understand better. If you patch my DSDT perfectly I will stop asking though :p

Just trying to understand stuff, so I dont keep coming back and ask the same questions (like a lot of ppl do in the hackintosh scene). Rather fix the problem myself with the knowledge I gained. Although I will not set up any more hackintoshes after this. But well... Knowledge doest hurt, even if you stop applying it.

PS: I am now reading this again until I hopefully understand it. https://www.tonymacx86.com/threads/guide-10-11-usb-changes-and-solutions.173616/
 
Last edited:
I am reading myself into the ACPI
So EHC1 is basically used by Apple and I thought we want to match Apple? But instead we are renaming it to EH01.
Which basically means we want to escape from Apple. And that only leaves one conclusion, meaning we dont want parity there because we want to avoid a collision?
But we have to feed osx with information from the BIOS and let it handle the Power Savings Features etc :S

Where does OSX get the information from, how does it manage things now?
Do you let a "middleman" take care of the communication now? Is that what we refer to as "injectors"?

Answer:
EHC1 and EHC2 are typically used by both Macs and PCs to identify the two EHCI controllers (USB2). By renaming EHC1 to EH01 and EHC2 to EH02, you can effectively disable the built-in port injectors that match the SMBIOS you're using.

There is no easy way to disable the built-in port injectors for a hub. If your SMBIOS choice has a built-in injector for it, and there are issues with devices on an internal hub due to the port injector, you will need to create your own hub port injector that overrides the default. You can override the default by setting a high IOProbeScore, much like the MacBookPro9,1-EH02-hub injector for the ProBook 4540s.


Can be read in the link from the post above.
 
I am reading myself into the ACPI Specifiaction PDF. It is really huge and overwhelming.
However I have some entries in an original Apple DSDT dump that I cannot find there.
Which kind of makes sense, since Apple doesnt comply to the standards of the PC Manufacturers and thus we need to translate it to Apple's ACPI language.

Is there some kind of Apple ACPI Specification PDF just like the one for PCs? So I can understand what each method is for. Like "RP01".

Apple uses standard ACPI.
 
Also post output of:
Code (Text):

sudo touch /System/Library/Extensions && sudo kextcache -u /


haha, I know what you are doing there, wanna trick us to clear the cache aye? Nope, never!
 
Also post output of:
Code (Text):

sudo touch /System/Library/Extensions && sudo kextcache -u /


haha, I know what you are doing there, wanna trick us to clear the cache aye? Nope, never!

Why not?
 
wanna trick us to clear the cache aye? Nope, never!

Huh?
kextcache output shows the unsigned/patched kexts you have installed (and whether they are installed correctly).
It is an important diagnosis tool.
Hint: You should have already done it before asking for help.

Note: This guide is for advanced users that know what they are doing.
 
People working on hotpatching may find my utilities useful. https://github.com/gfoury/clover-config-plist-tools

check-dsdt-patches.py checks how many times a patch applies (zero is bad). It also can produce the results of hot-patching DSDT.aml, so you can examine them in iASL or in a hex editor. Run this to just check the current DSDT and config.plist:

Code:
$ check-dsdt-patches.py DSDT.aml

check-kext-patches.py does the same thing, except checking Clover config.plist kext patches against the current /System/Library and /Library. (This is a little tricky because of plugins.)

makebinpatch.py generates patch stanzas.
Code:
$ makebinpatch.py 'ABC\x00' '\x80EF\xFf' 'change ABC to EF'
               <dict>
                   <key>Comment</key>
                   <string>Change ABC to EF</string>
                   <key>Find</key>
                   <data>
                   QUJDAA==
                   </data>
                   <key>Replace</key>
                   <data>
                   gEVG/w==
                   </data>
               </dict>
$

diffplist.py compares two plist files. Normally, you'd use the -n flag to normalize them; this sorts their keys before comparing.
Code:
$ diffplist -n -U10 config1.plist config2.plist

Finally, catplist.py does what it sounds like: read a plist, and write it out in normal, indented form. It can also sort dictionary keys for fully normalized mode.

Just for RehabMan, these utilities have a "short data" mode, where elements are placed on the same line:

Code:
                   <key>Find</key>
                   <data>QUJDAA==</data>
 
Back
Top