Jump to content

Editing custom personalities for ATI Radeon HD[45]xx


bcc9
 Share

775 posts in this topic

Recommended Posts

Interesting. Since your EDID is something that is checked at run-time, then you were looking at a shadow copy of your bios in ram, and you never had a dump of your actual bios. Glad you got the underlying problem figured out.

Link to comment
Share on other sites

  • 3 weeks later...

No feedback because I have nothing to report. The idea to add something into bootloader remains idea only.

For this kind of involved patching to OSX, I believe it's best to keep the smarts out of the bootloader. But I know some have the motivation to keep /S/L/E unmodified and wish the bootloader to do all the actual patching on the fly at every boot. For that scenario, perhaps we can standardize on an xml patch file syntax (that is not boot loader specific) that can provide this. Something general purpose that could be used for any hackintosh kext changes. Maybe bsdiff encapsulated in xml for binary patches, and a lighter weight match/replace for text diffs. I know clover has some of my patches built-in but the syntax is clover-specific. If there was a standard general purpose patch syntax we could agree upon then scripts like the one here could just generate the patch config for the bootloader.
Link to comment
Share on other sites

I think this is very common syntax for kext patching

 <key>KextsToPatch</key>
 <array>
  <dict>
   <key>Name</key>
   <string>VoodooHDA</string>
   <key>Find</key>
   <data>SGVhZHBob25lcwA=</data>
   <key>Replace</key>
   <data>VGVsZXBob25lcwA=</data>
  </dict>
  <dict>
   <key>Name</key>
   <string>AppleHDAController</string>
   <key>Comment</key>
   <string>Patch_to_not_load_this_driver</string>
   <key>InfoPlistPatch</key>
   <true/>
   <key>Find</key>
   <string>0x04020000</string>
   <key>Replace</key>
   <string>0x44220000</string>
  </dict>
  <dict>
   <key>Name</key>
   <string>IOBlockStorage</string>
   <key>Find</key>
   <data>TA==</data>
   <key>Replace</key>
   <data>TA==</data>
  </dict>
  <dict>
   <key>Name</key>
   <string>AppleAHCIPort</string>
   <key>Find</key>
   <data>RXh0ZXJuYWw=</data>
   <key>Replace</key>
   <data>SW50ZXJuYWw=</data>
  </dict>
 </array>

Do you want more keys?

Link to comment
Share on other sites

I think this is very common syntax for kext patching

I don't think this clover syntax is sufficient to be a general purpose solution for supporting add/change/delete operations on the system kexts.
  • For adding to kexts, such as adding a plugin, you'd likely want the kext name to include the path to the kext. Textual additions to kexts (such as Info.plist-only kext additions) would be a lot more legible if the addition wasn't encoded in binary.
    Some examples: an Info.plist that contains most of one's codec specific AppleHDA plist changes, support for one of the ethernet drivers that isn't included in the base OS
  • For changing kexts, such as your patch example, you'd want to reference the script or thread that can be used to maintain the patch across releases. Also a range of OSX release numbers and or kext version numbers for which the patch is known to apply would help. The patch syntax should probably also provide for multiple different versions of the patch depending upon the versions. (At least with enough version information to handle the version of OSX currently running and the version of OSX that the system will boot into next).
    Some examples: My AppleHDA patch that varies depending upon OSX version but where the perl script works across a wide range of releases.
    Likewise for my AppleACPIPlatform patch for the nvidia mcp79 chipset.
    The CMOS reset patch could be handled this way as well (instead of having information about the support thread and versioning details hardcoded in the clover source).
  • For deleting, perhaps these can all be handled by modifying the kext match clauses, but it would be more failsafe to just effectively delete the kext (then you don't have to worry about changes in the kext's personality lists from release to release).

Link to comment
Share on other sites

Bootloaders can't modify kexts because HFS+ drivers are read-only. It is possible to create RW driver but this is not still happen.

A possible way is to write an startup script.... No! Kexts already loaded.

If you want to do patch for a kext then you can do it once or at every boot on the fly.

 

Other question. Will your method work with UEFI compatible VBIOS? My attempt with 7850 failed.

Link to comment
Share on other sites

  • 3 weeks later...

Bootloaders can't modify kexts because HFS+ drivers are read-only.

Bootloaders effectively can; clover does exactly this in kext_patcher.c, which is the model I thought we were discussing as a starting point.

It is possible to create RW driver but this is not still happen.

HFS+ is read/write in linux open source, changes could be ported into UEFI code if one desired. Even hfs+ journaling has opensource support at this point (complete enough for an efi solution at least).

Other question. Will your method work with UEFI compatible VBIOS? My attempt with 7850 failed.

What problem are you having, decoding the connector info from the bios or patching the osx kext? I would think the later would work independent of whether the card was started up in uefi mode.

Personally I haven't used my radeon hd in about 2 years (gave it away actually). I could check with the person who has it now, as it's in a system with UEFI system bios at this point. But I'm not sure if that's what you mean.

Link to comment
Share on other sites

  • 4 weeks later...

Sir, Many thanks for your guide. I'm trying to patch my personality to get LDVS working, Unsuccessful until now :( . I have some questions, if you answer them I'll be glad.

 

I use "Pithecia" frame buffer and it work with VGA and with 2 port matched (ATY_ActiveFlags = 10), Port 0 and 1. VGA works perfect and LDVS shows black screen with brightness control working. When I switch from VGA to LDVS, Screen become distorted, But cursor works fine and shown normally.

 

1. Are the port number of personalities In IOReg ( like Port@0 ), shows index of personalities (from top to down)? If it's true ConnectorType of Port 0 & 1 are not indicate to VGA!? So how VGA works?

Personality: Pithecia

0000000    00  04  00  00  04  03  00  00  00  01  00  00  21  03  02  04  >Port@0

0000010    04  00  00  00  14  02  00  00  00  01  00  00  00  00  04  03  >Port@1

0000020    10  00  00  00  10  00  00  00  00  01  00  00  00  00  00  01  >Port@2

 

2.When I change one of personalities it cause to load default frame buffer (AMD,FrameBuffer ...) instead of "Pithecia". Why?

Asus K54HR SEYMOUR M2 XTX 
DDR3                                             
Subsystem Vendor ID: 1043       Subsystem ID: 2002
Object Header Structure Size: 199
Connector Object Table Offset: 34
Router Object Table Offset: 0
Encoder Object Table Offset: 99
Display Path Table Offset: 12

Connector Object Id [14] which is [LVDS] 
        encoder obj id [0x1e] which is [INTERNAL_UNIPHY (osx txmit 0x10 [duallink 0x0] enc 0x0)] linkb: false
Connector Object Id [12] which is [HDMI_TYPE_A]
        encoder obj id [0x20] which is [INTERNAL_UNIPHY1 (osx txmit 0x21 [duallink 0x1] enc 0x3)] linkb: true
Connector Object Id [5] which is [VGA]
        encoder obj id [0x15] which is [INTERNAL_KLDSCP_DAC1 (osx txmit 0x00 enc 0x10?)] linkb: false

Sorry for my English.

Link to comment
Share on other sites

Again, I don't use ATI mobility hardware, so I have no first hand experience getting LVDS ports working with this driver. There is a separate thread for ATI mobility support.

The order that ports show up in the ioregistry doesn't necessarily match the order of ConnectorInfo found in the personality.

Link to comment
Share on other sites

Again, I don't use ATI mobility hardware, so I have no first hand experience getting LVDS ports working with this driver. There is a separate thread for ATI mobility support.

The order that ports show up in the ioregistry doesn't necessarily match the order of ConnectorInfo found in the personality.

Thank you very much :thumbsup_anim:

Link to comment
Share on other sites

  • 1 month later...

Hi bcc9. I'm very happy with you tool, and i use it all the time to patch the personalities after a system upgrade (to remove the ghost display of the stock Kext). The problem is that, after the last upgrade to osx 10.8.4, your tool just says ConnectorInfo count is 0 for all the personalities and the offsets seems wrong (i don't get the usual connector structures in hexdump).
I'm using ati-personality version 0.10 from first post
I attach the normal output, the verbose one and a copy of the AMD Controller (my GPU is a MSI R5770)
 

ati-personality-logsbin.zip

Link to comment
Share on other sites

@smx: Look here for the fixed version.

Thanks, this is the first time I've been made aware that users were bumping into the otool compatibility issue with this script. Xcode as of 4.6 broke my scripts by changing the (default) output style from hex to decimal in otool. I did notice this before with my ahci patch script but I forgot about this one. I'll update.
  • Like 1
Link to comment
Share on other sites

I've updated post #1 with version 0.11. otool is simply invoked as otool -Q to get its former (more useful IMO) behavior. The script also warns the user when otool is missing instead of simply failing to run correctly.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Hi..

This script doesn't work mavericks' AMD kext.

I ran it at mavericks GM and 10.8.5.

Can someone help me please?

 

 

$ perl ati-personality.pl /Volumes/mavericks/System/Library/Extensions/AMD5000Controller.kext
Kext /Volumes/mavericks/System/Library/Extensions/AMD5000Controller.kext/Contents/MacOS/*Controller
Personality: Douc
ConnectorInfo count in decimal: 0
Disk offset in decimal 635296
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Langur
ConnectorInfo count in decimal: 0
Disk offset in decimal 635344
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Uakari
ConnectorInfo count in decimal: 0
Disk offset in decimal 635392
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Zonalis
ConnectorInfo count in decimal: 0
Disk offset in decimal 635456
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Alouatta
ConnectorInfo count in decimal: 0
Disk offset in decimal 635552
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Hoolock
ConnectorInfo count in decimal: 0
Disk offset in decimal 635616
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Vervet
ConnectorInfo count in decimal: 0
Disk offset in decimal 635664
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Baboon
ConnectorInfo count in decimal: 0
Disk offset in decimal 635728
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Eulemur
ConnectorInfo count in decimal: 0
Disk offset in decimal 635776
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Galago
ConnectorInfo count in decimal: 0
Disk offset in decimal 635824
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Colobus
ConnectorInfo count in decimal: 0
Disk offset in decimal 635872
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Mangabey
ConnectorInfo count in decimal: 0
Disk offset in decimal 635920
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Nomascus
ConnectorInfo count in decimal: 0
Disk offset in decimal 635968
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Orangutan
ConnectorInfo count in decimal: 0
Disk offset in decimal 636048
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Link to comment
Share on other sites

I made a replacement ATI -> AMD in the script but still no go

Personality: Juncus
ConnectorInfo count in decimal: 0
Disk offset in decimal 649648
Personality: Osmunda
ConnectorInfo count in decimal: 0
Disk offset in decimal 649712
Personality: Pondweed
ConnectorInfo count in decimal: 0
Disk offset in decimal 649776
Personality: Spikerush
ConnectorInfo count in decimal: 3
Disk offset in decimal 649824
0000000    02  00  00  00  40  00  00  00  29  05  01  00  00  00  00  05
0000010    00  04  00  00  04  03  00  00  00  01  02  00  11  02  01  01
0000020    00  04  00  00  00  01  00  00  00  09  02  00  21  03  02  02
0000030
Personality: Typha
ConnectorInfo count in decimal: 0
Disk offset in decimal 649888

and so on

Link to comment
Share on other sites

  • 2 weeks later...

Hi. Need help with ati hd 4670 on dell cps 1647 laptop. 

What fbname i need to use for this card?

What binary need to patch with connectors info?

I done with Shrike but have no luck, reboot before desktop shows.

I made patches with clover.

Dell has 3 out ports VGA, HDMI-A, DP and monitor of laptop on LVDS. 

Link to comment
Share on other sites

The offset is still valid - you can still use it :)

 

its the ConnectorInfo count value that failed to read correctly leading not being able to hex dump the value at offset.

 

Tried on Powercolor HD 5750

 

 

Hi..

This script doesn't work mavericks' AMD kext.

I ran it at mavericks GM and 10.8.5.

Can someone help me please?

 

 

$ perl ati-personality.pl /Volumes/mavericks/System/Library/Extensions/AMD5000Controller.kext
Kext /Volumes/mavericks/System/Library/Extensions/AMD5000Controller.kext/Contents/MacOS/*Controller
Personality: Douc
ConnectorInfo count in decimal: 0
Disk offset in decimal 635296
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Langur
ConnectorInfo count in decimal: 0
Disk offset in decimal 635344
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Uakari
ConnectorInfo count in decimal: 0
Disk offset in decimal 635392
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Zonalis
ConnectorInfo count in decimal: 0
Disk offset in decimal 635456
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Alouatta
ConnectorInfo count in decimal: 0
Disk offset in decimal 635552
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Hoolock
ConnectorInfo count in decimal: 0
Disk offset in decimal 635616
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Vervet
ConnectorInfo count in decimal: 0
Disk offset in decimal 635664
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Baboon
ConnectorInfo count in decimal: 0
Disk offset in decimal 635728
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Eulemur
ConnectorInfo count in decimal: 0
Disk offset in decimal 635776
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Galago
ConnectorInfo count in decimal: 0
Disk offset in decimal 635824
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Colobus
ConnectorInfo count in decimal: 0
Disk offset in decimal 635872
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Mangabey
ConnectorInfo count in decimal: 0
Disk offset in decimal 635920
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Nomascus
ConnectorInfo count in decimal: 0
Disk offset in decimal 635968
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010
Personality: Orangutan
ConnectorInfo count in decimal: 0
Disk offset in decimal 636048
0000000    00  08  00  00  04  02  00  00  00  01  01  00  12  04  03  01
0000010

 

Link to comment
Share on other sites

I've updated the script in post #1 to include 10.9 support.

Since the kext names finally changed from ATI to AMD, I had to generalize the kext wildcarding a bit more. Also the driver code changed slightly so the connector counts were all being mis-detected.

 

I stopped using my ATI 5670 card about 2 years ago, so I may not be the fastest to keep this script up to date; anyone want to take over?

Link to comment
Share on other sites

Hi

 

I've been trying for like 4 or 5 hours and I got nothing, no sound on HDMI. No sound at all, not on hdmi, not on motherboard. 

 

I have a 5670, my hackintosh is running Maverick well, but still no audio. 

 

I dumped the card's BIOS with GPU-Z on Windows, here is the dump :

 

ATOM BIOS Rom: 

SubsystemVendorID: 0x174b SubsystemID: 0xe166
IOBaseAddress: 0x0000
Filename: 166X0306.S21
BIOS Bootup Message: 
REDWOOD XT GDDR5 64Mx32 UCODEv:12602                                        
 
PCI ID: 1002:68d8
Connector at index 0
Type [@offset 44362]: DisplayPort (10)
Encoder [@offset 44366]: INTERNAL_UNIPHY2 (0x21)
i2cid [@offset 44446]: 0x91, OSX senseid: 0x2
Connector at index 1
Type [@offset 44372]: HDMI-A (11)
Encoder [@offset 44376]: INTERNAL_UNIPHY2 (0x21)
i2cid [@offset 44473]: 0x94, OSX senseid: 0x5
Connector at index 2
Type [@offset 44382]: DVI-I (2)
Encoder [@offset 44386]: INTERNAL_UNIPHY1 (0x20)
i2cid [@offset 44510]: 0x92, OSX senseid: 0x3
Connector at index 3
Type [@offset 44392]: DVI-I (2)
Encoder [@offset 44396]: INTERNAL_KLDSCP_DAC1 (0x15)
i2cid [@offset 44510]: 0x92, OSX senseid: 0x3

 

So I guess my HDMI port is the number 1 ?

 

Keep going. 

 

I ran IORegistry, I search for "ATY". Here I found that my HDMI port would be the number 0, because it's the only one with "display-type = LCD" and I only have a HDTV plugged on this hackintosh, on HDMI port of course.

 

So wich port is the good one ? Did I miss something ?

 

I tried to edit AMD5000Controller in hex mode, to change lines for Uakari profile, like this :

 

Personality: Uakari

ConnectorInfo count in decimal: 4
Disk offset in decimal 635392
0000000    00  08  00  00  00  02  00  00  00  71  00  00  22  05  05  06
0000010    00  08  00  00  00  02  00  00  00  71  00  00  22  05  05  05
0000020    00  02  00  00  14  00  00  00  00  71  00  00  00  00  06  05
0000030    00  08  00  00  00  02  00  00  00  71  00  00  22  05  05  04
0000040

 

But after reboot, still no sound on HDMI. My computer does not detect any audio device...

 

What's next ? Buying a card wich works out of the box ? That would be cheating, I'm pretty sure I can manage that.

 

Thanks for your help.

Link to comment
Share on other sites

Hi all. I have 10.9 Mavericks installed on my Dell, creating a new Hackintosh (have Lion on an older Dell, fully working) The video card I have is a Radeon HD5570, but it's an odd one. I tried to find an older known-working card, but the "normal" ones are all discontinued. I found a 4-DVI version, though:

 

http://www.amazon.com/VisionTek-Radeon-Express-Graphics-900345/dp/B004JU260O

 

(1002:68d9 / 0x68D91002)

 

When it first came up, at least without GraphicsEnabler, it worked for at least two displays, but no QE/CI, or at least no ability to play videos. Quicktime or youtube. So, I set about trying to enhance things. Turning to trying profiles from the ati code within Chameleon, I got various results, but not yet any success so was starting to look here.Using the script to find where to edit the files I understand. But, I'm not sure from posts here what tool(s) I need to use to interrogate the card to see what is and isn't being detected or reported… I have Xcode installed, but was unable to find IORegistry. Is that still available in Xcode 5.x? Thanks.

Link to comment
Share on other sites

hi guys,

im using OSx 10.9 with ATI 5430M, i try to edit personality like this:

 

bios dump:

ATOM BIOS Rom: 
	SubsystemVendorID: 0x1028 SubsystemID: 0x0466
	IOBaseAddress: 0xe000
	Filename: BR40158.001 
	BIOS Bootup Message: 
Dell DJ1 PARK LP DDR3 64Mx16 512MB /1GB                                     

PCI ID: 1002:68e1
Connector at index 0
	Type [@offset 45440]: LVDS (7)
	Encoder [@offset 45444]: INTERNAL_UNIPHY (0x1e)
	i2cid [@offset 45496]: 0x90, OSX senseid: 0x1
Connector at index 1
	Type [@offset 45450]: VGA (1)
	Encoder [@offset 45454]: INTERNAL_KLDSCP_DAC1 (0x15)
	i2cid [@offset 45519]: 0x91, OSX senseid: 0x2
Personality: Hoolock
ConnectorInfo count in decimal: 3
Disk offset in decimal 635616
0000000    00  04  00  00  04  06  00  00  00  01  00  00  21  03  05  01
0000010    00  04  00  00  04  06  00  00  00  01  00  00  11  02  04  02
0000020    04  00  00  00  14  02  00  00  00  01  00  00  02  04  01  03
0000030

i try edit first line with:

02 00 00 00

40 00 00 00

00 09

00 00

00

02

01

01

 

the second line with:

10 00 00 00

10 00 00 00

00 09

00 00

00

02

02

02

 

then reinstall AMD5000Controller.kext with kext wizard, boot with AtiConfig=Hoolock but not full QE/CI.

 

help me with my problem.

Best regards.

Link to comment
Share on other sites

I've updated the script in post #1 to include 10.9 support.

Since the kext names finally changed from ATI to AMD, I had to generalize the kext wildcarding a bit more. Also the driver code changed slightly so the connector counts were all being mis-detected.

 

I stopped using my ATI 5670 card about 2 years ago, so I may not be the fastest to keep this script up to date; anyone want to take over?

Still no go with rev 0.12

Personality: Ikura
ConnectorInfo count in decimal: 0
Disk offset in decimal 663280
Personality: IkuraS
ConnectorInfo count in decimal: 0
Disk offset in decimal 663296
Personality: Junsai
ConnectorInfo count in decimal: 0
Disk offset in decimal 663392
Personality: Kani
ConnectorInfo count in decimal: 0
Disk offset in decimal 663488
Personality: KaniS
ConnectorInfo count in decimal: 0
Disk offset in decimal 663504
Personality: DashimakiS
ConnectorInfo count in decimal: 0
Disk offset in decimal 663600
Personality: Maguro
ConnectorInfo count in decimal: 0
Disk offset in decimal 663664
Personality: MaguroS
ConnectorInfo count in decimal: 0
Disk offset in decimal 663680
iMac:Downloads slice$ 

I have 10.9 with XCode5.0.1.

Link to comment
Share on other sites

 Share

×
×
  • Create New...