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 = DCB ENTRY OR VALUE (guessing)

Now about NVCAP: It describes which outputs can be used simultaneously and the following:
BYTE: NVCAP_VERSION (hardcoded, goes from 0 to 5)
BYTE
: HAS_CLAM_SHELL (lid)
BYTE
: UNKNOWN (most built-in cards and MacPro 7300GT have that set to 1)
BYTE
: UNKNOWN (most built-in cards have that set to 1. something about backlight?)
WORD
: OUTPUT GROUP 3 (guessing, it describes what outputs are usable together with S-Video out)
WORD
: OUTPUT GROUP 1 (describes what outputs are grouped to Display-A)
WORD
: OUTPUT GROUP 2 (describes what outputs are grouped to Display-B)
BYTE
:
BYTE
:
BYTE
:
BYTE
:
BYTE
: BUILT-IN (guessing, built-in cards apart from 7300GO (AppleTV) have this set to 1)
BYTE
: UNKNOWN (hardcoded value)
BYTE
: EDID_MANUFACTURER_RESERVED_TIMINGS (BYTE 0x25 of the primary screens EDID)
BYTE
:
BYTE
:
BYTE
: UNKNOWN (MacBookPro 8600MGT (15") 128MB Vram has this set to 1)

About the Output groups, they are generated like following. It all depends on the DCB table in your video bios. You can find your DCB table by looking at offset 0x36 of a nvidia bios. You byte swap the word at 0x36, thats the address of the DCB table.

In the DCB table we have entries describing what type of connection can be used for a physical output, like ANALOG, ANALOG/DVI etc. Let's take an example DCB (iMac 7600GT).
DCB ENTRY 0: ANALOG
DCB ENTRY
1: LVDS
DCB ENTRY
2: TMDS
DCB ENTRY
3: TV

In this case we have LVDS at index 1 (so we set bit 1), it is always alone on an output group. So OUTPUT GROUP 1 would be
hex: 0x0002
binary
: 0000 0000 0000 0010

All the other entries will be grouped to OUTPUT GROUP 2, so we have DCB ENTRY 0,2 and 3 (so we set bit 0,2 and 3) grouped which would be
0x000D
binary
0000 0000 0000 1101

As you can see we set bit X (X is the DCB ENTRY INDEX) to group an entry to an output group.

The same is done for OUTPUT GROUP 3, it's just generated when we have a TV entry in our DCB. It would be of big help if somebody with iMac 7600GT an tell us what outputs do work simultaneously with an S-Video adapter since iMac 7600GT is the only one having just the TV entry in this output group.

Now about NVMT: it describes the capabilities of the primary screen:
BYTE: NVMT_VERSION
BYTE
: DISPLAY_TYPE (0 = ANALOG, 1 = TV, 3 = the rest)
BYTE
: UNKNOWN
BYTE
: UNKNOWN
WORD
: EDID_MANUFACTURER
WORD
: EDID_PRODUCT_CODE
WORD
: SCREEN WIDTH
WORD
: SCREEN HEIGHT
WORD
: SCREEN WIDTH + SOME VALUE
WORD
: SCREEN WIDTH + SOME VALUE
WORD
: SCREEN WIDTH + SOME VALUE
WORD
: ZEROED
WORD
: SCREEN HEIGHT + SOME VALUE
WORD
: SCREEN HEIGHT + SOME VALUE
WORD
: SCREEN HEIGHT + SOME VALUE
WORD
: ZEROED
DWORD
: SOME VALUE * 10000
WORD
:
BYTE
:
BYTE
:
--BYTE:
BYTE
:
BYTE
:
7 DWORDS: ZEROED
BYTE
: 0xFF HARDCODED
BYTE
: 0xFF HARDCODED6 BYTES: ZEROED
DWORD
:
BYTE
:
BYTE
:
6 BYTES: ZEROED
BYTE
:
BYTE
:
BYTE
:
BYTE
:
--WORD: the --BYTE is this value >> 8
BYTE
:
BYTE
:

Looking at NVMT is quite a mess, too much is unknown yet. If somebody has any further info for instance how to calculate the screen width/height values please help.

NVDA,Features:
according to 8800GT Efi driver it is:
SUBSYSTEM_ID << 16 | 0x02FF
built-in
injected when the card is built-in. To check with: REGISTER STRAP_INFO_2 & 0x10
device-type
"NVDA,Parent" (HARDCODED)
Ext_Present
injected when there is a second screen available at boot.
@X,built-in@X,use-backlight-blanking
injected when the attached screen is fixed and not removable (LVDS)
@0,AAPL,boot-display
injected for the primary screen
@X,backlight-control
injected with the value of AAPL,backlight-control
@0,name
"NVDA,Display-A" (HARDCODED)
@1,name
"NVDA,Display-B" (HARDCODED)
@X,device-type
"display" (HARDCODED)
@X,compatible
"NVDA,NVMac" (HARDCODED)

MULTIPLE NVIDIA card installation


IMPORTANT, READ INSTRUCTIONS FROM START TO FINISH BEFORE BEGINNING

part one:

getting card details

use a program called textwrangler, google it, it's an excellent text editor with some
features that will make following this guide alot easier for yourself I promise you,

Creat a text file on your desktop called whatever, i'll call mine info.txt

now copy the corresponding string between the < > below of the Video RAM size your
video card has labelled as "video ram":
the digit after 0x are multiples of 256, the ones after 0x0 are multiples of 16.
<0x08000000> - 128Mb
<0x10000000> - 256Mb
<0x14000000> - 320Mb
<0x20000000> - 512Mb
<0x28000000> - 640Mb
<0x30000000> - 768Mb
<0x38000000> - 896Mb
<0x50000000> - 1280Mb
<0x60000000> - 1536Mb

next choose the type of outputs on the particular card labelled as "connectors":
the connector layout: Mainboard side of card / SLI connector side of card
<BAAAAAAAAwAMAAAAAAAABwAAAAA=> - DVI-I / DVI-I
<BAAAAAAAAQAGAAAAAAAAAAAAAAA=> - VGA / DVI-I
<BAAAAAAAAwAEAAAAAAAABwAAAAA=> - DVI-I / VGA

now complete part one for your second card if you are going with 2 cards, and remember
to keep the details for each card clearly labelled for that card.

Part two:

getting the card location

if your going to use 2 cards, you must do this step twice, starting with your primary
card inserted into your PC without the secondary card in the system, then repeat the
process with the secondary card in the secondary slot it will occupy with the primary
card removed. so in short, get first card location, swap out the card then get the
secondary card location.

this is how:

you need root access, go here to learn how to get it: support.apple.com/kb/ht1528
with your primary or only card installed in the slot you intend to use it in, extract
gfxutil to your desktop, open terminal and type:

su [hit enter]

[enter your root password then hit enter]

cd \Users\[your username]\Desktop\ [hit enter]

./gfxutil -f display [hit enter]

OK once you enter that last line you should get an outpu on screen like:

PciRoot(0x4)/Pci(0x1,0x0)/Pci(0x0,0x0)

label it as "location"

copy it by dragin over with your mouse and right click, copy, then paste into you text
file "info.txt" you recorded you video card details to, if using 2 cards make sure it's
labelled for the card currently in your system then repeat with your second card fitted
to it's slot again, only if you going to use 2 cards.

Your almost done, your info.txt should read something like this:

card a

video ram:0x20000000
connectors:BAAAAAAAAwAMAAAAAAAABwAAAAA=
location:PciRoot(0x4)/Pci(6x1,0x0)/Pci(0x0,0x0)

card b (only if using 2 cards)

video ram:0x20000000
connectors:BAAAAAAAAwAMAAAAAAAABwAAAAA=
location:PciRoot(0x4)/Pci(0x6,0x0)/Pci(0x0,0x0)


part three:

modding the in.plist

this is the part where you cop over your collected data to the template in.plist file.
open it with textwrangler.

locate the text "LOCATION" and paste your location info in it's place.

locate the text "VRAMINFO" and paste your video ram info in it's place.

locate the text "CONNECTORS" and paste your connectors info in it's place.

locate the text "VIDEOCARDNAME" and paste your video card name in it's place.
<key>model</key>
<string>NVIDIA GeForce GTX 275 - 896MB</string> for example.

now if your only using one video card you can delete everything after "</dict>" up until the second
occurrence of </dict>so there will be a total of 2 x </dict> at the end of the file like this:

</dict>
</dict>
</plist>

now procede to part four.

If your using 2 video cards, do the same again for card b

locate the text "LOCATIONB" and paste your location info in it's place.

locate the text "VRAMINFOB" and paste your video ram info in it's place.

locate the text "CONNECTORSB" and paste your connectors info in it's place.

locate the text "VIDEOCARDNAMEB" and paste your video card name in it's place.
<key>model</key>
<string>NVIDIA GeForce 8800GT- 512MB</string> for example.


part four:

this part is where you convert your in.plist to an EFI string.

save your info.txt and in.plist.

Open terminal again with root access and type:

cd /Users/[your username]/Desktop/

./gfxutil -i xml -o hex ./in.plist ./out.hex

ok, now open the out.hex file with textedit, hit Command + A to select all and Command + C
to copy to your clipboard.

go back to terminal and type:

nano /Library/Preferences/SystemConfiguration/com.apple.Boot.plist

this opens up the nano text editor, use the arrow keys to go </dict> and enter a line
above it indented just like the others above that, and enter:

<key>device-properties</key>
<string>"PASTE EFI STRING HERE"</string>

so when your done it will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$
<plist version="1.0">
<dict>
<key>Graphics Mode</key>
<string>1920x1200x32</string>
<key>GraphicsEnabler</key>
<string>Yes</string>
<key>Kernel Flags</key>
<string></string>
<key>device-properties</key>
<string>ce0700000100000002000000e20300001500000002010c00d041030a04</string>
</plist>

The EFI string you paste may look wierd but as long as it has no leading or trailing
spaces between <string>and</string> you all good.

now to save the file, you press Control + X, then hit Y to confirm overwrite of old file.

Your done. Shutdown the PC, install all video cards into their slots and Boot the PC, and it
should work, if not, try NVEnabler.kext for single cards, or research the forums and OSX
HCL pages on the OSX86 Wiki links above. This is AFAIK the only way to get 2 differing
NVIDIA cards to work in the same OSX system.



Edit AppleGraphicsPowerManagement.kext to unleash nvidia's GTX 570/580 full power and save energy at the same time


We wrote a long explanation why and how to edit these thresholds. You may want to read all of this or just copy and paste these values to your AppleGraphicsPowerManagement.kext and change to your vendor device.
I might add, these values are not written into stone. I have used the power efficiency thresholds for a week and I am very happy with them. You however, might find thresholds that works better for your everyday usage. I encourage to edit these values and run tests on them. I added a high performance mode as well, to show the difference.

Power efficiency thresholds:
(focused to stay in G-state 2 during everyday usage and therefore saves up to 55W~110W)
Threshold_High
0
45
75
100
Threshold_Low
0
0
87
98
<key>MacPro5,1</key>
                                 
<dict>
                                         
<key>Vendor10deDevice1081</key>
                                         
<dict>
                                                 
<key>Heuristic</key>
                                                 
<dict>
                                                         
<key>ID</key>
                                                         
<integer>0</integer>
                                                         
<key>IdleInterval</key>
                                                         
<integer>250</integer>
                                                         
<key>SensorOption</key>
                                                         
<integer>1</integer>
                                                         
<key>SensorSampleRate</key>
                                                         
<integer>4</integer>
                                                         
<key>TargetCount</key>
                                                         
<integer>5</integer>
                                                         
<key>Threshold_High</key>
                                                         
<array>
                                                                 
<integer>0</integer>
                                                                 
<integer>45</integer>
                                                                 
<integer>75</integer>
                                                                 
<integer>100</integer>
                                                         
</array>
                                                         
<key>Threshold_Low</key>
                                                         
<array>
                                                                 
<integer>0</integer>
                                                                 
<integer>0</integer>
                                                                 
<integer>87</integer>
                                                                 
<integer>98</integer>
                                                         
</array>
                                                 
</dict>
                                                 
<key>LogControl</key>
                                                 
<integer>1</integer>
                                                 
<key>control-id</key>
                                                 
<integer>18</integer>
                                         
</dict>
                                         
<key>default-control-id</key>
                                         
<integer>18</integer>
                                 
</dict>


High performance thresholds:
(focused on G-state 1 (caution) this mode still switches quickly between 2 and 1 
Threshold_High
0
85
75
100
Threshold_Low
0
0
95
98
<key>MacPro5,1</key>
                                 
<dict>
                                         
<key>Vendor10deDevice1081</key>
                                         
<dict>
                                                 
<key>Heuristic</key>
                                                 
<dict>
                                                         
<key>ID</key>
                                                         
<integer>0</integer>
                                                         
<key>IdleInterval</key>
                                                         
<integer>250</integer>
                                                         
<key>SensorOption</key>
                                                         
<integer>1</integer>
                                                         
<key>SensorSampleRate</key>
                                                         
<integer>4</integer>
                                                         
<key>TargetCount</key>
                                                         
<integer>5</integer>
                                                         
<key>Threshold_High</key>
                                                         
<array>
                                                                 
<integer>0</integer>
                                                                 
<integer>85</integer>
                                                                 
<integer>75</integer>
                                                                 
<integer>100</integer>
                                                         
</array>
                                                         
<key>Threshold_Low</key>
                                                         
<array>
                                                                 
<integer>0</integer>
                                                                 
<integer>0</integer>
                                                                 
<integer>95</integer>
                                                                 
<integer>98</integer>
                                                         
</array>
                                                 
</dict>
                                                 
<key>LogControl</key>
                                                 
<integer>1</integer>
                                                 
<key>control-id</key>
                                                 
<integer>18</integer>
                                         
</dict>
                                         
<key>default-control-id</key>
                                         
<integer>18</integer>
                                 
</dict>

Realtek ALC662 working on 32/ 64bit

1) remove anything permitted to audio enabling (AppleHDA, VoodooHDA, AppleAzaliaAudio, etc..)
2) Run Disk Permissions with Disk Utility, Kext Wizard, Kext Utility... (Prefer running Disk Utility and then Kext Utility)
3) Reboot
4) Put the AppleHDA.kext to System/Library/ Extensions
5)Put the ALC662.kext on Extra/Extensions
6) Put the dsdt.aml to /Extra
7) Run Terminal and type this:

sudo perl -pi -e 's|\x85\x08\xec\x10|\x62\x06\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

8) Run Disk Utility first and then.. kext utility
9) Reboot
10) If it worked, go eat rice

UPDATED: iDeneb v1.6 10.5.8 LE (For old PC) [2012]

You can now download the iDeneb v1.6 10.5.8 Lite Edition from the Internet Archive. Here is the direct link to access the files, including the `.iso` for installation:



This version is suitable for older PCs with Intel/AMD processors that support SSE2/SSE3.



Description: MAC OS X 10.5.8 Leopard - Operating system based on Unix, originally designed for computers Apple, but then ported to the usual IBM-compatible PC. With the DVD drive you can install the operating system "alternative" iDeneb v.1.6 Build and set the necessary software. The list of supported hardware see below. Deneb v1.6 10.5.8 - is a universal build for Intel / AMD with support for SSE2 / 3. In this version there are only six additional languages: Japanese, German, French, Spanish, Italian, Russian.



iATKOS ML: Upgrade from previous versions [guide]


Upgrade from previous versions: 

- You can upgrade your existing Lion (I0.7.x) and Mountain Lion (10.8.x) installations to Mountain Lion 10.8.2 or make a refresh install to your 10.8.2 system (keeping your applications, user accounts, user settings and user data) by using iATKOS ML2. To upgrade from Snow Leopard (10.6.x), you should first upgrade to Lion (10.7.x) by using iATKOS L, #Niresh Lion, or any other methods. 
- I advice you to do a clean install to another HDD on your computer before upgrade, to see that it actually works on your computer. 
- You will need to re-install your special device drivers after upgrade. i.e. your m-audio firewire sound driver, your 3G modem driver, your All video card driver.
- Some of your applications that runs on the previous versions of OS X may not be compatible with Mountain lion 10.8.2, so know that they may fail after upgrade. Search for your existing software/driver compatibility for Mountain Lion before upgrading to Mountain Lion. 
- You will need to prepare your selection list just like a clean install. 
1- Select the destination for installation  
2- Click Customize* and select what you need  
3- Click Install 
by uphuck, cheers :D