Open hacker1024 opened 2 years ago
Weird - with the current fix added in https://github.com/hacker1024/Dell-Inspiron-7586-Hackintosh/commit/00532c7b94a2dcf84b6a37f366b835f796bf7252, the brightness keys stop working if the EC fan control is disabled...
As the moment, _OSI patching is required to enable the brightness keys (https://github.com/hacker1024/Dell-Inspiron-7586-Hackintosh/commit/00532c7b94a2dcf84b6a37f366b835f796bf7252). This is not recommended by Dortania, due to the problems it can cause with other operating systems.
It would be better if a DSDT hotpatch was implemented to remove the check. Here's the relevant DSDT code:
The idea is to change
If ((\_SB.OSID () >= 0x20))
toIf (One)
, similarly to the existing I2C patch.Here's what the binary looks like:
And with
If (One)
:My initial thought was to simply make a find/replace based on these differing binary snippets. Several variants are possible, depending on the positions of
NoopOp
s:My experience with this sort of binary code is mainly in the Android field, with Dalvik opcodes. I'm not sure if instruction alignment is as important in ACPI land as it is in Dalvik, but I think it's possible that one of these patches is invalid due to weird
A0
IfOp positions. I need to look into the ACPI specification more.Neither of these hotpatches work at the moment. When enabled, the "System DSDT" view in MaciASL shows what I expect -
If (One)
and a bunch of NoopOps - but the brightness keys don't work.I'm probably misunderstanding the way these binary if statements work. I'll look into the ACPI specification and see if I can work out what's going on, just like @al3xtjames did on Reddit for the I2C patch.
(Btw @al3xtjames, if you notice anything immediately fixable with the patches above, I'd really appreciate your input. I haven't tried very hard myself to solve the problem yet though, so no pressure.)