Jump to content

Editing custom personalities for ATI Radeon HD[45]xx


  • Please log in to reply
765 replies to this topic

#441
helob

helob

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 218 posts

I successfully managed to edit the Lion kexts without issue, once I had the correct locations provided by the script. The card now works perfectly in both SL and Lion. As for running the script, I have Lion installed on another drive in this machine, so I simply modified the script itself to look on the Lion drive for the kexts and then ran it as normal from Snow :) Then I modified the Lion kexts from within Snow, rebooted into Lion et voila :)
Modding the script to point to your Lion installation is relatively easy, if you look at the script you'll see the paths defined in a number of places, just change them all to point to the correct location. For example by default the script has '/System/Library/Extensions' defined as the kext path, I changed that to '/Volumes/OSX/System/Library/Extensions'. Obviously change '/OSX/' to the name of the Lion volume on your machine.

Hope that helps :)

Thank you for sharing with us your experience.
I will try as per your method.
Will share result with rest.
I hope you don't mind me asking questions if I face any problem.
Thank you.

#442
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,281 posts
  • Gender:Male
You could just cp /usr/bin/otool and /usr/bin/lipo to your lion partition. That's what I did :)

#443
helob

helob

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 218 posts

You could just cp /usr/bin/otool and /usr/bin/lipo to your lion partition. That's what I did ;)


Thanks for the Tips. This is what I was looking for.

No need to copy lipo. Its already in lion partition.

Thank you for sharing with us your experience.
I will try as per your method.
Will share result with rest.
I hope you don't mind me asking questions if I face any problem.
Thank you.


Works like a charm :) .
Since then, BCC9 has provide tips ( add otool to /usr/bin/ of Lion partition ) so no need to edit script. Can run straight in Lion :) .
Thanks again for your advise.
Have a nice day.

#444
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,281 posts
  • Gender:Male

Thanks for the Tips. This is what I was looking for.

No need to copy lipo. Its already in lion partition.

Oops, right. I couldn't remember if I had copied that one as well and it looked like I had.
If someone wants to add a disk volume-name command line argument to the script and post it that'd be cool too :)

#445
samsonluk

samsonluk

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Location:HK
@BCC9, I tried to dump ATI Framebuffer Personality "Eulemur" block and apply some patch for my ATI HD5470M from ATIFramebuffer.kext by following your instructions in the first post but seems I can't get the correct block/hex dump output as expected... the following are perform under Lion GM 64bit

ATIFramebuffer.kext "Eulemur" block output directly from your ati-personality.pl:
$ ./ati-personality.pl -a -x
...
...
Kext ATI5000Controller
...
Personality: Eulemur
ConnectorInfo count in decimal: 3
Disk offset in decimal 167376
0000000 04 00 00 00 14 00 00 00 00 01 00 00 01 02 01 04
0000010 00 08 00 00 00 02 00 00 00 71 00 00 12 04 04 02
0000020 10 00 00 00 10 00 00 00 00 00 00 00 00 10 00 01
...
...
$ cd /System/Library/Extensions/ATIFramebuffer.kext/Contents/MacOS
 $ ls -l
 total 576
 -rwxr-xr-x  1 root  wheel  291708 Jun 24 14:16 ATIFramebuffer
 $ dd if=ATIFramebuffer of=~/tmp/Eulemur bs=1 skip=167376 count=48
 48+0 records in
 48+0 records out
 48 bytes transferred in 0.004008 secs (11976 bytes/sec)
 $ cd ~/tmp
 $ xxd < Eulemur >! hex
 xxd: hex: No such file or directory
			  
 $ xxd < Eulemur > hex
 $ xxd < Eulemur
 0000000: 7362 760f 8fd5 0100 0081 fb71 7561 007f  sbv........qua..
 0000010: 2c81 fbe3 0000 000f 8429 0600 0081 fbe4  ,........)......
 0000020: 0000 000f 8532 0700 008b 5d14 895c 2404  .....2....]..\$.
As you can see the above hex dump are completely different from output of your ati-personality.pl, what am I did wrong in the above? Please note that I have taken out "!" from xxd command line because it reported "No such file or directory".

#446
Azimutz

Azimutz

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 759 posts
  • Gender:Male
  • Location:Almadan - Pt.
  • Interests:At the moment, OSx86.. In general, music, audiophile, computers.. to much to mention...

what am I did wrong in the above?

You posted the answer:
...
Kext ATI5000Controller
...
On 10.6.8 and Lion fb personalities are on the Controllers, not ATIFramebuffer :)

----------//----------

bcc9, here is a weird one for you; the 64 bit offset for the first personality (Caretta) is not correct...
32 bit:
 Kext ATI1300Controller
 Personality: Caretta
 ConnectorInfo count in decimal: 1
 Disk offset in decimal 377996
 0000000	00  02  00  00  14  00  00  00  00  00  00  00  10  01  02  01
 0000010
 
 64bit:
 Kext ATI1300Controller
 Personality: Caretta
 ConnectorInfo count in decimal: 1
 Disk offset in decimal 110544
 0000000	98  03  00  01  10  01  01  01  02  03  00  00  00  00  00  05
 0000010
... it should be 110528. This happens only with the first personality, others are fine.

Just out of curiosity, do you have any clue of what is this 0x00001000 connector type on Iago and Hypoprion?..
mini dvi / dp are the only ones that cross my mind...

Thanks...

#447
samsonluk

samsonluk

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Location:HK
@Azimutz, thank you so much. :)

#448
Azimutz

Azimutz

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 759 posts
  • Gender:Male
  • Location:Almadan - Pt.
  • Interests:At the moment, OSx86.. In general, music, audiophile, computers.. to much to mention...
My pleasure, Samsonluk :)

----------//----------

bcc9, one doubt i forgot; i'm assuming it's not possible to add connector info to a personality, just edit a present one...
Am i assuming correctly?

#449
samsonluk

samsonluk

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Location:HK
My attempt to patch Framebuffer "Eulemur" to work with Dell N4010 HD5470M is almost done - big thanks to bcc9 and mucha to provide all the required utilities and information. However, there are 2 type of personality I cannot determine by myself and need your expert advices, they are the Transmitter and Encoder bytes. Below is the ROM BIOS decode output of my HD5470M:

./radeon_bios_decode < N4010HD5470_BIOS_1002_68E0_04561028.rom
ATOM BIOS Rom:
SubsystemVendorID: 0x1028
SubsystemID: 0x0456
IOBaseAddress: 0x2000
Filename: BR037821.001
BIOS Bootup Message:
Dell Green UM8 PARK M2 XT DDR3 64Mx16 1GB

PCI ID: 1002:68e0
Connector at index 0
Type [@offset 45058]: LVDS (7)
Encoder [@offset 45062]: INTERNAL_UNIPHY (0x1e)
i2cid [@offset 45132]: 0x93, OSX senseid: 0x4

Connector at index 1
Type [@offset 45068]: HDMI-A (11)
Encoder [@offset 45072]: INTERNAL_UNIPHY1 (0x20)
i2cid [@offset 45155]: 0x90, OSX senseid: 0x1

Connector at index 2
Type [@offset 45078]: VGA (1)
Encoder [@offset 45082]: INTERNAL_KLDSCP_DAC1 (0x15)
i2cid [@offset 45182]: 0x97, OSX senseid: 0x8


My partially patched "Eulemur", for the bytes in RED Color are those that I cannot determain:
Personality: Eulemur (Modified for HD5470)
ConnectorInfo count in decimal: 3
Disk offset in decimal 167376
0000000 02 00 00 00 40 00 00 00 09 01 00 00 00 02 00 04
0000010 00 08 00 00 00 02 00 00 00 71 00 00 01 04 01 01
0000020 10 00 00 00 10 00 00 00 00 00 00 00 00 10 02 08

#450
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,281 posts
  • Gender:Male

Please note that I have taken out "!" from xxd command line because it reported "No such file or directory".

I use tcsh as my shell, instead of the default bash. With csh based shells, >! has a different meaning. Didn't mean to use a shell-script specific syntax in the example; fixed.

#451
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,281 posts
  • Gender:Male

bcc9, here is a weird one for you; the 64 bit offset for the first personality (Caretta) is not correct...

Oops, I had code to handle that case (where the load instruction that we want to use is not the last of the routine), but the check was broken as of version 0.5. Fixing.

Just out of curiosity, do you have any clue of what is this 0x00001000 connector type on Iago and Hypoprion?..
mini dvi / dp are the only ones that cross my mind...

No idea; have you checked which apple platform uses this (and what connectors it has)?

#452
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,281 posts
  • Gender:Male
Ok, post #1 now has a new version of ati-personality.pl: version 0.7. Changes:
  • It fixes the "caretta" personality reporting regression.
  • the wormy count was mis-reported in 10.7 - fixed.
  • -a is auto-set for 10.7 (ie the script detects the OS version and knows that 10.7 has multiple kexts to dump automatically).
  • 32-bit kext reporting now works for 10.7 (where the kexts have new compiler optimizations)

bcc9, one doubt i forgot; i'm assuming it's not possible to add connector info to a personality, just edit a present one...
Am i assuming correctly?

You could take a personality with the right # of connectors for your case and scribble into it whatever you want...
You might want to revise the info under IOKitPersonalities in the controller's info.plist if you're re-appropriating a personality that is much different from your hardware.

#453
zapsu

zapsu

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
Where I can find otools?

#454
Matafonoff

Matafonoff

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts

typedef struct {
int ConnectorType; /* known values below */
#define CONNECTORTYPE_LVDS 0x00000002 /* Ie internal Low Voltage display,
such as laptop */
#define CONNECTORTYPE_DVI_DUAL 0x00000004 /* Dual link(?) DVI */
#define CONNECTORTYPE_VGA 0x00000010 /* Per mucha */
#define CONNECTORTYPE_SVIDEO 0x00000080 /* Per mucha */
#define CONNECTORTYPE_DVI 0x00000200 /* Single link DVI(?), Per azimutz */
#define CONNECTORTYPE_DP 0x00000400 /* Displayport */
#define CONNECTORTYPE_HDMI 0x00000800

int controlflags;
int features;
byte link_i2cid; /* Bits 0-3: i2cid
Bits 4-7: link transmitter link */
byte dac_digidx; /* Bits 0-3: link encoder number
Bits 4-7: link dac number */
byte hotplugid;
byte senseid; /* Sense line is bits 0-3
Use hw i2c flag is bit 4 */
/* i2cid = (senseid & 0xf-1)+0x90 */
/* senseid = (i2cid & 0xf) +1*/
} ConnectorInfo;


Hi everyone!
Where did you get this structure info from? I'm curently writing ATI framebuffer patcher witch will help you to patch FB with some GUI not terminal.
I'd like to have some info on controlflags constants and some info about where can I find other values for this structure for patching?

UPD

As soon as I've posted this - I found solution using google (You couldn't trust me but I searched about 3-4 days before!).

If you're interested in some of theese values - download and read this RTF document

#455
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,281 posts
  • Gender:Male

Where did you get this structure info from?

The information I provided in post #1 comes from study of the driver code, the io registry, the linux ATI driver source code, and to a lesser extent, some plain old testing. Also some two system remote gdb sessions to verify things. It takes quite a lot of work to come up with this stuff and translate it into higher level information.

Still I think it's premature to make a newbie utility out of this information with some of the blanks left unfilled.

#456
Azimutz

Azimutz

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 759 posts
  • Gender:Male
  • Location:Almadan - Pt.
  • Interests:At the moment, OSx86.. In general, music, audiophile, computers.. to much to mention...

Oops, I had code to handle that case (where the load instruction that we want to use is not the last of the routine), but the check was broken as of version 0.5. Fixing.

Hi bcc9, sorry for the delay. Script is fine now.

No idea; have you checked which apple platform uses this (and what connectors it has)?

About the 0x00001000 connector type, i only took a look around Mactracker and Apple site; got only suspictions.
Will take a look at ioreg's with time, to see if i can get confirmations. We also have a new connector around, Thunderbolt.

You could take a personality with the right # of connectors for your case and scribble into it whatever you want...
You might want to revise the info under IOKitPersonalities in the controller's info.plist if you're re-appropriating a personality that is much different from your hardware.

Ok, confirms some stuff i was thinking.

Thanks for all the work; nice tools, very useful info :(
Will keep you posted, if i find anything useful; i only began scratching the surface regarding this stuff.

If you're interested in some of theese values - download and read this RTF document

Hi Matafonoff.. your rtf did help me to fill in some blanks.. thanks :)

#457
samsonluk

samsonluk

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Location:HK
Is it normal for VGA shown as always connected while nothing is connected to the VGA port?

Posted Image

Posted Image

My HD5470 BIOS dump as follow:
PCI ID: 1002:68e0
Connector at index 0
Type [@offset 45058]: LVDS (7)
Encoder [@offset 45062]: INTERNAL_UNIPHY (0x1e)
i2cid [@offset 45132]: 0x93, OSX senseid: 0x4
Connector at index 1
Type [@offset 45068]: HDMI-A (11)
Encoder [@offset 45072]: INTERNAL_UNIPHY1 (0x20)
i2cid [@offset 45155]: 0x90, OSX senseid: 0x1
Connector at index 2
Type [@offset 45078]: VGA (1)
Encoder [@offset 45082]: INTERNAL_KLDSCP_DAC1 (0x15)
i2cid [@offset 45182]: 0x97, OSX senseid: 0x8

and the patched "Eulemur" Framebuffer that I use for this card, QE/CI enabled and works fine:
0000000 02 00 00 00 40 00 00 00 09 01 00 00 12 01 00 04
0000010 00 08 00 00 00 02 00 00 00 01 00 00 20 00 01 01
0000020 10 00 00 00 10 00 00 00 00 00 00 00 10 10 02 08


#458
Azimutz

Azimutz

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 759 posts
  • Gender:Male
  • Location:Almadan - Pt.
  • Interests:At the moment, OSx86.. In general, music, audiophile, computers.. to much to mention...

Is it normal for VGA shown as always connected while nothing is connected to the VGA port?

Don't think so; if nothing is connected it should show "Status: No Display Connected".
Maybe something needs to be changed on this line:
0000020 10 00 00 00 10 00 00 00 00 00 00 00 10 10 02 08
...!?

#459
samsonluk

samsonluk

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Location:HK

Maybe something needs to be changed on this line:
0000020 10 00 00 00 10 00 00 00 00 00 00 00 10 10 02 08
...!?

In fact, I have test a few changes on the above line before this post and no help, that's why I asked... While remote connect with VNC I can actually see 2 desktops from the client side, and drag things between them works...

#460
Azimutz

Azimutz

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 759 posts
  • Gender:Male
  • Location:Almadan - Pt.
  • Interests:At the moment, OSx86.. In general, music, audiophile, computers.. to much to mention...

In fact, I have test a few changes on the above line before this post and no help, that's why I asked... While remote connect with VNC I can actually see 2 desktops from the client side, and drag things between them works...

Weird stuff... i'm out of answers ;) i still didn't had time to play with changing personality connectors.
Also, i just found a weird thing while looking for another fb for you to try (Eulemur is not a laptop fb);
Nomascus show 5 ports on 10.6.7 drivers and only 4 on 10.6.8 ??? :rolleyes:

bcc9, when/if you read this, can you check if it's a ati-personality.pl glitch or...
Nomascus is the only one with this diff.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy