Jump to content

Editing custom personalities for ATI Radeon HD[45]xxx


  • Please log in to reply
759 replies to this topic

#141
kizwan

kizwan

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,422 posts

Something very strange is happening to my pc...

This is stock Vervet from 10.6.6

0000000	00  04  00  00  00  04  00  00  00  01  00  00  12  04  04  02
0000010	04  00  00  00  14  00  00  00  00  01  00  00  01  12  01  04
0000020	00  02  00  00  14  00  00  00  00  01  00  00  00  00  06  03
0000030	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  01

You should try patch the Vervet connection table. There is a script at first post which you can use to gather required information. OR you can do it manually. All required information to do it manually is also available at first post.

This is an example how to patch the connection table manually:-
(Run the commands in /System/Library/Extensions/ATIFramebuffer.kext/Contents/MacOS/ folder OR in the same folder where ATIFramebuffer binary file located)
lipo -detailed_info ATIFramebuffer
==
Fat header in: ATIFramebuffer
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
	cputype CPU_TYPE_X86_64
	cpusubtype CPU_SUBTYPE_X86_64_ALL
	offset 4096					--> start_offset_for_architecture = 4096 (for 64bit)
	size 149936
	align 2^12 (4096)
architecture i386
	cputype CPU_TYPE_I386
	cpusubtype CPU_SUBTYPE_I386_ALL
	offset 155648					  --> start_offset_for_architecture = 155648 (for 32bit)
	size 148908
	align 2^12 (4096)
otool -arch i386 -vt ATIFramebuffer | c++filt
== (for example Vervet)
VervetInfo::createInfo(unsigned char, PlatformParameters&):
0000d488	pushl	%ebp
0000d489	movl	%esp,%ebp
0000d48b	movl	0x0c(%ebp),%ecx
0000d48e	movl	$0x0000ece8,0x08(%ecx)
0000d495	movb	$0x04,0x03(%ecx)	--> (4 connection)
0000d499	xorl	%edx,%edx
0000d49b	movl	%edx,%eax
0000d49d	shll	$0x04,%eax
0000d4a0	addl	$0x00011200,%eax	--> virtual_address = 0x00011200
0000d4a5	movl	%eax,0x0c(%ecx,%edx,4)
0000d4a9	incl	%edx
0000d4aa	movzbl	0x03(%ecx),%eax
0000d4ae	cmpl	%edx,%eax
0000d4b0	jg	0x0000d49b
0000d4b2	xorl	%eax,%eax
0000d4b4	leave
0000d4b5	ret
otool -arch i386 -l ATIFramebuffer
== (I only show the section where virtual_address (0x00011200) is in the range of addr to addr+size)
Section
  sectname __data
   segname __DATA
	  addr 0x000111c0				--> start_address_for_segment = 0x000111c0
	  size 0x00000494
	offset 70904				--> offset_for_segment = 70904
	 align 2^5 (32)
	reloff 93996
	nreloc 2
	 flags 0x00000000
 reserved1 0
 reserved2 0

start_offset_for_architecture + offset_for_segment + virtual_address - start_address_for_segment = offset_in_file
32bit: 155648 + 70904 + 0x00011200 - 0x000111c0 = 0x26000 + 0x114F8 + 0x00011200 - 0x000111c0 = 0x37538
(correction - original connection table)
--> 00037538	 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 02  
--> 00037548	 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 04  
--> 00037558	 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 03  
--> 00037568	 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 01

ATOM BIOS Rom:
	SubsystemVendorID: 0x103c SubsystemID: 0x1448
	IOBaseAddress: 0x4000
	Filename: BR38421.001
	BIOS Bootup Message:
MADISON Lenovo-Yx60-Madison Pro DDR3 64Mx16 500E/600M					  

Connector at index 0 type: LVDS (7)
Connector's i2cid: 96
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 90
Connector at index 2 type: VGA (1)
Connector's i2cid: 97

senseid = (i2cid And 0xf) +1
LVDS: (96 And 0xf) + 1 = 7
HDMI: (90 And 0xf) + 1 = 1
VGA: (97 And 0xf) + 1 = 8

Patched senseid:-
(correction)
--> 00037538	 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 07	 (LVDS but with wrong connector-type 0x400. Correct connector-type is 0x2)
--> 00037548	 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 01	 (HDMI connector-type 0x800 - change the first 15 bytes with the one from 4th row***)
--> 00037558	 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 08	 (VGA but with wrong connector-type 0x200. Possible correct connector-type is 0x10**)
--> 00037568	 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 02	 (Change the senseid from 01 to something else for example 02 to prevent duplicate entry in IORegistry for display which connected to HDMI)
** Please refer to this post.
*** Actually not necessary to move the connection entry, just need to change the senseid. Meaning, the 4th connection (4th row) is already for HDMI since connector-type is 0x800. Just need to patch senseid with your HDMI senseid. In this example, the original senseid (01) already matched yours, so no need to patch.


In this example, we only change/patch Vervet connection table for 32bit mode which means you'll need to boot to 32bit (arch=i386). If you want to patch connection table for 64bit mode, you'll need run the above commands for 64bit architecture (-arch x86_64) & recalculate the offsets. At least external monitor connected to HDMI port will work. To get LVDS working you'll need to patch the first 15 bytes (LVDS 0x2: 02 00 00 00 XX XX XX XX XX XX XX XX XX XX XX 07). Try use any framebuffer which support LVDS as reference.

#142
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia
Thank you Kizwan i will follow the above post as it looks like the same setup for me :(

#143
checcco

checcco

    InsanelyMac Protégé

  • Members
  • PipPip
  • 96 posts
@kizwan thanks for your post, but I dont think you've read mine :( I know perfectly how to patch...this is what I don't understand:

The fourth line of Vervet has HDMI and 01 as senseid, and that's perfect for my card without patching... But I've got images on my internal monitor, not HDMI monitor! But if I unplug my external HDMI monitor, I lose images on internal too...

#144
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia

@kizwan thanks for your post, but I dont think you've read mine :( I know perfectly how to patch...this is what I don't understand:

The fourth line of Vervet has HDMI and 01 as senseid, and that's perfect for my card without patching... But I've got images on my internal monitor, not HDMI monitor! But if I unplug my external HDMI monitor, I lose images on internal too...


@Kizwan or BBC9


How would I go about patching ATIFramebuffer in 10.7 if 10.7 kext has no personalities inside of the file? Maybe it autoselects?

ATY,RadeonFramebuffer i think is the new one which handles all FB's.

@Checcco i think we are on same boat here, your connections look like they match with mine, Your probably more knowledgeable with all this numbers and stuff and how to convert hex back and forth, haven't done patch since AppleHDA quite a while ago.

#145
checcco

checcco

    InsanelyMac Protégé

  • Members
  • PipPip
  • 96 posts

@Kizwan or BBC9


How would I go about patching ATIFramebuffer in 10.7 if 10.7 kext has no personalities inside of the file? Maybe it autoselects?

ATY,RadeonFramebuffer i think is the new one which handles all FB's.

@Checcco i think we are on same boat here, your connections look like they match with mine, Your probably more knowledgeable with all this numbers and stuff and how to convert hex back and forth, haven't done patch since AppleHDA quite a while ago.


I'm gonna give up... I've tried EVERYTHING....I've found no way to make osx to work on my LVDS...And I haven't read any case of success on HP laptops... So maybe HP laptops have something "different"...

#146
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,278 posts
  • Gender:Male

@Kizwan or BBC9


How would I go about patching ATIFramebuffer in 10.7 if 10.7 kext has no personalities inside of the file? Maybe it autoselects?

As of 10.7, the hardcoded personalities have moved from ATIFramebuffer to the platform specific kexts (ATI1300Controller, ATI1600Controller, etc.)
You can see them with the same
otool -arch i386 -vt <kext-name> | c++filt | grep createInfo
command that I showed in post #1, where <kext-name> represents the ATI*Controller.kext you wish to examine.
Not all the ATIController kexts have hardcoded personalities so perhaps some autodetect.Actually all the ones I looked at do have hardcoded personalities.

I have been unable to get ##### to run on any of my systems so I have not been able to install 10.7, so I can't write definitively about how the driver is behaving.
Perhaps someone can help me with ##### :wacko:

I got images on my internal display, my HDMI monitor was black but system profiler said it was plugged.
Unplugging the external monitor resulted in black screen on internal laptop too... Why?

That suggests that you have in fact found the senseid for your hdmi port but the other bytes (I'd suspect bytes 12,13,14) are not right for your hardware.
I think you should start with a closer match to your actual hardware (vervet doesn't even have an LVDS entry), and modify the senseid byte of that table's HDMI connector to match the value you discovered.

#147
wmarsh

wmarsh

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 900 posts

Can you add any clarity on the last section?

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*/

New user mucha seems to have figured out the remaining 3 digits in this section.
http://www.insanelym...howtopic=252061

#148
kizwan

kizwan

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,422 posts

Thank you Kizwan i will follow the above post as it looks like the same setup for me :)

Sorry, I put wrong connection table in the post. The Vervet connection table which supposedly original was actually already modified. I use modified ATIFramebuffer as reference. :P

#149
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,278 posts
  • Gender:Male

New user mucha seems to have figured out the remaining 3 digits in this section.
http://www.insanelym...howtopic=252061

Great, will be happy to update the docs if some concrete details are posted.

#150
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia

Great, will be happy to update the docs if some concrete details are posted.

I can give you step by step instructions how to get 10.7 running, PM me i'm here all day, all you need is ##### 1.4 and 2 kexts fakesmc and nullcpupowermanagement kexts.

if 10.7 is hardcoded in ATI5000Controller then in 10.7, 3 kexts load ATI5000Controller, ATISupport, ATIRadeonX3000 but the Framebuffer kext don't load, what would be stopping this, I'm guessing if i change the config of port allocation this issue will still exist?

I'm gonna give up... I've tried EVERYTHING....I've found no way to make osx to work on my LVDS...And I haven't read any case of success on HP laptops... So maybe HP laptops have something "different"...


@Checcco I won't give up, i will use all the information here and figure something out, I can get my card to work using Eulemur in 10.6.6 using 10.7 kexts so there must be a way to get something working in 10.7. Lion would be lovely accelerated.

Just downloading Xcode 4.1 atm huge blody thing :)

#151
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia
If the FB has swapped from ATiFramebuffer to ATI5000Controller then why does ATI5000Controller load and ATIFramebuffer doesn't when the kernal is loading card in slot 1, gets to desktop. No changes.
Obviously one of the kexts finds card ID 68C1 in slot one.

I will go install xcode and investigate 5000 controller binary.

#152
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,278 posts
  • Gender:Male

If the FB has swapped from ATiFramebuffer to ATI5000Controller then

I only said that the createInfo() routines, which initialize the personality specific tables, have moved from ATIFramebuffer to the individual controller kexts instead. Helps us see which personalities are intended for which controllers :D

#153
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia

I only said that the createInfo() routines, which initialize the personality specific tables, have moved from ATIFramebuffer to the individual controller kexts instead. Helps us see which personalities are intended for which controllers :D


otool -arch i386 -vt ATI5000Controller | c++filt | grep createInfo

DoucInfo::createInfo(unsigned char, PlatformParameters&):

LangurInfo::createInfo(unsigned char, PlatformParameters&):

UakariInfo::createInfo(unsigned char, PlatformParameters&):

ZonalisInfo::createInfo(unsigned char, PlatformParameters&):

AlouattaInfo::createInfo(unsigned char, PlatformParameters&):

HoolockInfo::createInfo(unsigned char, PlatformParameters&):

VervetInfo::createInfo(unsigned char, PlatformParameters&):

BaboonInfo::createInfo(unsigned char, PlatformParameters&):

EulemurInfo::createInfo(unsigned char, PlatformParameters&):

GalagoInfo::createInfo(unsigned char, PlatformParameters&):

ColobusInfo::createInfo(unsigned char, PlatformParameters&):

MangabeyInfo::createInfo(unsigned char, PlatformParameters&):

NomascusInfo::createInfo(unsigned char, PlatformParameters&):

OrangutanInfo::createInfo(unsigned char, PlatformParameters&):

Now only 14 :(

I only said that the createInfo() routines, which initialize the personality specific tables, have moved from ATIFramebuffer to the individual controller kexts instead. Helps us see which personalities are intended for which controllers :)


Personality: Douc
ConnectorInfo count in decimal: 2
Effective address for ConnectorInfo table in hex: 10
Personality: Langur
ConnectorInfo count in decimal: 3
Effective address for ConnectorInfo table in hex: 10
Personality: Uakari
ConnectorInfo count in decimal: 4
Effective address for ConnectorInfo table in hex: 10
Personality: Zonalis
ConnectorInfo count in decimal: 6
Effective address for ConnectorInfo table in hex: 10
Personality: Alouatta
ConnectorInfo count in decimal: 4
Effective address for ConnectorInfo table in hex: 10
Personality: Hoolock
ConnectorInfo count in decimal: 3
Effective address for ConnectorInfo table in hex: 10
Personality: Vervet
ConnectorInfo count in decimal: 4
Effective address for ConnectorInfo table in hex: 10
Personality: Baboon
ConnectorInfo count in decimal: 3
Effective address for ConnectorInfo table in hex: 10
Personality: Eulemur
ConnectorInfo count in decimal: 3
Effective address for ConnectorInfo table in hex: 10
Personality: Galago
ConnectorInfo count in decimal: 2
Effective address for ConnectorInfo table in hex: 10
Personality: Colobus
ConnectorInfo count in decimal: 2
Effective address for ConnectorInfo table in hex: 10
Personality: Mangabey
ConnectorInfo count in decimal: 2
Effective address for ConnectorInfo table in hex: 10
Personality: Nomascus
ConnectorInfo count in decimal: 4
Effective address for ConnectorInfo table in hex: 10
Personality: Orangutan
ConnectorInfo count in decimal: 2
Effective address for ConnectorInfo table in hex: 10

So i will have to patch ATI5000Controller in my situation yes? So in the above their is 4 personalities with 3 connectors, My laptop has VGA/HDMI/LVDS.
Personality: Eulemur
Personality: Langur
Personality: Hoolock
Personality: Baboon

First before I get into any of this I have to find out how I can even enable graphics without injectors or DSDT's as Lion doesn't have any bootloaders yet?

#154
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,278 posts
  • Gender:Male

Now only 14 :D

Only 14 for that 1 controller, but now 40 total across all controllers, so more than in 10.6.6.

Effective address for ConnectorInfo table in hex: 10

Obviously those addresses are wrong; my perl script needs adjusting for 10.7 apparently.

So i will have to patch ATI5000Controller in my situation yes? So in the above their is 4 personalities with 3 connectors, My laptop has VGA/HDMI/LVDS.

Still can't get 10.7 installed over here so I can't say what is necessary&sufficient at this point.

First before I get into any of this I have to find out how I can even enable graphics without injectors or DSDT's as Lion doesn't have any bootloaders yet?

Netkas has claimed you don't need to inject, but without seeing for myself I don't know if he was just referring to one particular ATI model or what.

#155
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia
Netkas did claim this however the system picks up i have a card in slot 1 but nothing is effected after this, my ID is in both ATI5000Controller and ATIRadeonX3000 kexts but for some reason my card doesnt do anything. it show's like this in sys profiler.

Display: Type: GPU Bus: PCIe PCIe Lane Width: x16 VRAM (Total): 4 MB Vendor: ATI (0x1002) Device ID: 0x68c1 Revision ID: 0x0000 Displays:Display: Resolution: 1366 x 768 Pixel Depth: 32-Bit Color (ARGB8888) Main Display: Yes Mirror: Off Online: Yes

Imagine having a 4MB video card and trying to acellerate Lion haha :D

#156
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,278 posts
  • Gender:Male

Imagine having a 4MB video card and trying to acellerate Lion haha :(

I think I used to have a 4MB video card back in 1995 :D
So why not take all your formerly working injection strings and move them to your dsdt.

#157
kizwan

kizwan

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,422 posts
I did further test with 10.6.6 kexts & I found bytes which set the ATY,ControlFlags.

Based on the success report I read, I found ATY,ControlFlags for LVDS is 0x40 & HDMI is 0x204.

LVDS: 02 00 00 00 40 00 00 00 09 01 00 00 02 01 00 01
HDMI: 00 08 00 00 04 02 00 00 00 01 00 00 22 05 05 02


I test this with Peregrine framebuffer & now I have output on the internal display for the first time!!! :thumbsup_anim:

However, if the external monitor connected to HDMI port, both screen blank/black.

#158
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia

I think I used to have a 4MB video card back in 1995 :thumbsup_anim:
So why not take all your formerly working injection strings and move them to your dsdt.


I remember 1995 days and computers very clearly :) 95 prob was my intel 120mhz pentium it hooned in games, frame rate pausing changing res from 640 to 800. 16mb upped it to 32mb ram :) ultra gaming machine.


I would use a DSDT but ##### has a dsdt folder and if I place dsdt in there i cannot boot, loading of kernel pauses, Also kext folder if i place kexts, pauses lol

#159
checcco

checcco

    InsanelyMac Protégé

  • Members
  • PipPip
  • 96 posts

@Checcco I won't give up, i will use all the information here and figure something out, I can get my card to work using Eulemur in 10.6.6 using 10.7 kexts so there must be a way to get something working in 10.7. Lion would be lovely accelerated.


Atlee, bcc9 guide never worked for us... Changing senseid to Nomascus didn't make our 5650m to work... We got our internal display to work with 10.7 kexts, but never recognized. We got our display working but don't know why. Like I said some post earlier, probably we need to tweak something else...You claimed Eulemur is the right fb, but a lot of people (included me) got the same result with uakari, vervet, baboon and langur... Before digging in 10.7 kexts (that may be incomplete) we should continue to try and understand why bcc9 guide ain't working for us on 10.6.6, why we can't have any 0x2 connector-type to work...

Luckily this new guy mucha seems to have found how to tweak the other bits of a personality... This like I said could be a solution... :thumbsup_anim:

Little tip for everybody:
Analyzing every perosnality I found out that for arch=i386 in 10.6.6 ATIFramebuffer start_offset_for_architecture + offset_for_segment - start_address_for_segment is ALWAYS 0x26338 so you can get the offsite in file this way:

offset_in_file = virtual_address + 0x26338

#160
atlee

atlee

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 723 posts
  • Gender:Male
  • Location:South NSW, Australia

Atlee, bcc9 guide never worked for us... Changing senseid to Nomascus didn't make our 5650m to work... We got our internal display to work with 10.7 kexts, but never recognized. We got our display working but don't know why. Like I said some post earlier, probably we need to tweak something else...You claimed Eulemur is the right fb, but a lot of people (included me) got the same result with uakari, vervet, baboon and langur... Before digging in 10.7 kexts (that may be incomplete) we should continue to try and understand why bcc9 guide ain't working for us on 10.6.6.


Eulemur gave me proper 3D acceleration.

Hoolock works but no 3D, Vervet works no 3D, same with Uakari, same with Baboon, and alot of others. But I found only one Personality that gave me 100% 3D and it was Eulemur.

@checcco in 10.6.6 click on DVD Player using all other FB's, for me DVD Player gave me error, Frontrow gave me blank screen. Eulemur didn't give me any errors or blank screen.

However PCI0 --> POP2@3 same as GFX1 i think. --> VGA0 tells me that VGA port worked and setting a higher resolution then VGA can handle made the Internal screen pop on. This would tell me that the ports are no initiating properly.

I dont really wish to go back to 10.6.6 that means reinstall everything lol :thumbsup_anim: I will probably go back to 10.6.6 and we'll figure this out together maybe. only takes me about 1hour or so complete reinstall.

@bcc9 empty your inbox please have a new flavour of usb to try.





0 user(s) are reading this topic

0 members, 0 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