Contribute
Register

Apple Backlight Injector Brightness not saved

Status
Not open for further replies.
Wait, that's not where Clover loads the variable on boot, is it?

Yes.

SetNvramVariable looks like it's writing to Nvram.plist, which we know is working.

No. nvram.plist is created by shell scripts that run at system restart/shutdown.

EDIT: Found it. It's FakeSMC's job to handle this.

No.
 
Where is "read value from nvram.plist and pass to macOS"? That's what I can't find.

EDIT: Found it. It's FakeSMC's job to handle this.
I'm also looking for "read value from nvram.plist and pass to macOS", can you tell me where it is in FakeSMC?
 
I'm also looking for "read value from nvram.plist and pass to macOS", can you tell me where it is in FakeSMC?

It is not in FakeSMC.kext.
Read post #78.
 
Oooh yeah. Got it now. Thanks RehabMan. It only runs "delete" if olddata is NOT 0, so really the problem has to do with the line:
Code:
  return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
 
Last edited:
Oooh yeah. Got it now. Thanks RehabMan. It only runs "delete" if old attribute is 0, so really the problem has to do with the line:
Code:
  return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);

Someone should verify what is in NVRAM early in the boot sequence.
To do it, you need to create a kext that will wait for the NVRAM service to show, then read the value, and write it to the kernel log.
The function IntelBacklightPanel::loadFromNVRAM in IntelBacklight.kext has the code you need (just wrap it up in a kext and change it to read "backlight-level" instead of "intel-backlight-level").
 
Haha, so now I ask on-topic: Do you know where I can learn to make an injector kext? I haven't found many resources for that (and I would also like to make one for an HDMI port fix). I've tried using your Backlightinjector as a template in the past, but my attempt didn't seem to load, so there's probably some stuff I don't know about how to make kexts properly.
 
Haha, so now I ask on-topic: Do you know where I can learn to make an injector kext? I haven't found many resources for that (and I would also like to make one for an HDMI port fix).

Injector kext is off-topic.
I don't think you what an injector kext actually is...

I've tried using your Backlightinjector as a template in the past, but my attempt didn't seem to load, so there's probably some stuff I don't know about how to make kexts properly.

Injector kexts don't load. They only inject IOKitPersonality data in the IOCatalog.
 
I'm asking about this:
just wrap it up in a kext and change it to read "backlight-level" instead of "intel-backlight-level"
How do I "wrap it up in a kext"? I'm sure it's simple once one knows how to do it. Where do I learn how to do it? I can't keep going if I don't know how to do it. :/
 
I'm asking about this:

How do I "wrap it up in a kext"? I'm sure it's simple once one knows how to do it. Where do I learn how to do it? I can't keep going if I don't know how to do it. :/

In order to do that you need to have an understanding of how to write a kext.
Studying existing kexts is the best way.
Read also Apple documentation for kext development (that's how I started).
A very simple kext for study would be the first kext I ever wrote: ACPIPoller.kext...
 
Haven't tried anything fancy yet, but this is logged in bdmesg:
Code:
0:713  0:000   Adding Key: backlight-level: Size = 2, Data: 6C 05
 
Status
Not open for further replies.
Back
Top