Archive for November 2012



niresh icon





Basic guide about nVidia kexts


We have to inject some properties in the device tree. The Chameleon v2 bootloader does that automatically for many cards, you just have to enable the GraphicsEnabler option and configure the PciRoot (only if it's not zero).


In the file com.apple.Boot.plist


        <key>GraphicsEnabler</key>


        <string>y</string>


        <key>PciRoot</key>


        <string>1</string>



You can use the app Lizard (LINK).
Check the Graphics Injection option, click on Auto-detect value in PCIRoot and save.



Posted Image



In Lizard preferences, configure the Extra folder Path. Select the Extra folder in the partition where you installed Chameleon.



Posted Image



There are kexts for that (NVenabler, NVinject, EvoEnabler, among others) but they do exactly the same thing, inject properties, they are not the drivers themselves.







It's also possible to pass the properties manually to Chameleon.



In the file com.apple.Boot.plist (or using Lizard)


        <key>device-properties</key>


        <string>[hexadecimal EFI string]</string>



To get the currently injected properties you can use the command

ioreg -lw0 -p IODeviceTree -n efi -r -x | grep device-properties | sed 's/.*<//;s/>.*//;' > device-properties.hex


To convert the file device-properties.hex (hexadecimal EFI string) to plist (property list file) you can use OSX86Tools (osx86tools).



Posted Image



OSX86Tools can also be used to generate an EFI string.



Posted Image

nVidia Injection [guide]


First about display-cfg. It describes what type of screen is attached.

The last two bytes are made up as following:
If some condition (unknown yet, we thought it had to do with if a screen is attached to that output, which it had not) is met we get:
BYTE: Display-Number
BYTE
: I2C Read Offset
BYTE
: 0xFF
BYTE
: 0xFF

If the unknown condition above is not met its build up as following regarding the type of screen attached.

For ANALOG:
BYTE: Display-Number
BYTE
: I2C Read Offset
BYTE
: 0xFF
BYTE
: 0x00

For TV:
BYTE: Display-Number
BYTE
: I2C Read Offset
BYTE
: 0xFF
BYTE
: 0x01

And for everything else like LVDS, TMDS and Display-Port
BYTE: Display-Number
BYTE
: I2C Read Offset
BYTE
: DCB Entry OR (guessing)
BYTE
: 0x03

There is one display-cfg for each screen. Here an example (note we have to swap bytes to inject):

ANALOG
@0,display-cfg <00FFXX00>  XX = I2C Read Offset
@1,display-cfg <00FFXX01>  XX = I2C Read Offset
TV
@0,display-cfg <01FFXX00>  XX = I2C Read Offset
@1,display-cfg <01FFXX01>  XX = I2C Read Offset
ELSE
@0,display-cfg <03YYXX00>  XX = I2C Read Offset; YY = DCB ENTRY OR VALUE (guessing)
@1,display-cfg <03YYXX01>  XX = I2C Read Offset; YY