Jump to content



Member Since 16 Feb 2011
Offline Last Active Apr 15 2012 05:59 PM

Topics I've Started

Howto: configure Lion to auto generate MKext

16 October 2011 - 10:15 AM

I've find the way to configure kextd to generate mkext instead of pre link kernelcache in standard directory /System/Library/Caches/com.apple.kext.caches/Startup/.
It is useful if you are using a custom kernel like /mach_kernel_atom because kernelcache is built with /mach_kernel.

For this I've modified the file /usr/standalone/bootcaches.plist of lion, replacing in "PostBootPaths" dictionary the "kernelcache v1.1" dictionary with "MKext2" dictionary found in Snow Leopard bootcaches.plist.

This file seems to be not altered by updates. (testing with 10.7 --> 10.7.2 combo)

Here is my files as an exemple.
Attached File  bootcaches.zip   3.43KB   236 downloads

ACPI Backlight Driver

18 September 2011 - 11:07 AM

New version 1.2:
  • Added Boolean property in info.plist "BQC use index" to be use if your _BQC returns an index to _BCL entries (not tested)
  • Added an optional DSDT optimization : you can add a method SAVE with same parameters than _BCM and on the same device in order to split the DSDT code that set the backlight value in the PWM control register (usually located in EC) and the DSDT code that save the value in CMOS (usually in the RTC second bank of RAM : OperationRegion (xxxx, SystemIO, 0x72, 0x02) but triggered by a SMI interrupt to ensure CMOS checksum computation)

New version 1.1:
  • Added : look at power supply status at start up
  • Code correction : more checks on pointers and function return

This is a driver for laptops which backlight are controlled by ACPI Methods: if you have _DOS _BCL _BCM _BQC in you DSDT. A good reading for DSDT editing if need is Advanced Configuration and Power Interface (ACPI) Specification 4.0a APPENDIX B: Video Extensions.

This driver provides native backlight management for laptops with backlight managed by ACPI : slider in the display pref pane and sun bezel when you press backlight up/down hotkey (with an other driver than can understand your keyboard Fn keys...), power management by the OS : dim before sleep, reduce level when AC is unpluged.
Attached File  sun_bezel.png   434.73KB   526 downloadsAttached File  display.png   52.46KB   623 downloads
It replaces an other driver I've written.ACPIBacklightDisplay.kext This old driver shall be removed.
Tested on SL 10.6.8 and Lion 10.7.0 to 10.7.2. May works on older version, but not tested.
Reported to work on 10.6.7.

Pre requested: having AppleBacklightDisplay loaded.
For this, you must have this properties injected among others by DSDT _DSM+DTGP (or graphics enabler ? or EFI strings...):
"AAPL,HasPanel",                        Buffer (0x04)                        {                            0x01, 0x00, 0x00, 0x00                        },                        "AAPL,Haslid",                        Buffer (0x04)                        {                            0x01, 0x00, 0x00, 0x00                        },                        "AAPL,backlight-control",                        Buffer (0x04)                        {                            0x01, 0x00, 0x00, 0x00                        },                                                                        "@0,backlight-control",                        Buffer (0x04)                        {                            0x01, 0x00, 0x00, 0x00                        }, 			"@0,AAPL,boot-display",                        Buffer (0x04)                        {                            0x01, 0x00, 0x00, 0x00                        },									"@0,built-in",                        Buffer ()                        {                            One                        },

It works for NVIDIA and Intel graphics. Seems problematic for some ATI users for the moment. (ATI is always more complicated!!)

There also must be this device in DSDT, in the \_SB scope:
Scope (\_SB){    ...    Device (PNLF)    {        Name (_HID, EisaId ("APP0002"))        Name (_CID, "backlight")        Name (_UID, 0x0A)        Name (_STA, 0x0B)    }...}

If you don't have the _DOS Method, add a fake one in the GPU device (IGPU, GFX0... or what ever the name, it is the parent of the device where you find _BCL, _BQC, _BCM).
Method (_DOS, 1, NotSerialized){//nothing to do}

If you have several devices with _BCL _BCM _BQC the driver will take the first it finds, so you will have to find with one is the good one to do an other DSDT trick. For this locate in ioreg on with device the graphic driver is loaded. Then add this into PNLF:
Method (_BCL, 0, NotSerialized)                        	{                        		return (\_SB.PCI0.IXVE.IGPU.LCDD._BCL())                        	}                        		                        Method (_BCM, 1, NotSerialized)	                        {	                            \_SB.PCI0.IXVE.IGPU.LCDD._BCM(Arg0)	                        }		                        Method (_BQC, 0, NotSerialized)	                        {	                        	return (\_SB.PCI0.IXVE.IGPU.LCDD._BQC())	                        }   							Method (_DOS, 1, NotSerialized)		                    {		                        \_SB.PCI0.IXVE.IGPU._DOS(Arg0)		                    }
Replacing _SB.PCI0.IXVE.IGPU and _SB.PCI0.IXVE.IGPU.LCDD of my example with your good path.

Then install this kext in S/L/E (with Kext Utility or similar !)
Attached File  ACPIBacklight.kext.zip   21.75KB   2528 downloads

If all goes right, you shall see this on the kernel log:
ACPIBacklightPanel: Found Backlight Device: LCDD
ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.IXVE.IGPU
ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.IXVE.IGPU.LCDD
ACPIBacklightPanel: Version 1.0

Source: Attached File  ACPIBacklight.kext_src.zip   27.98KB   660 downloads
© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy