Jump to content

X4500 Brightness Control Achieved


Benjan
 Share

15 posts in this topic

Recommended Posts

4500 Brightness Control Achieved on Thinkpad T400 with Snow Leopard 10.6.3

 

After some searching and researching, I finally got Brightness Control work now.

Actually, most files are from 10.6.2 or even older. Still no QE/CI, but who cares, at least we got Native resolution(1440x900x32@60Hz) and brightness control now.

 

PS: Actually, display brightness will be controlled by ACPI via original Fn keys, not the slider in Display preference panel which is disabled to achieve the goal.

 

Maybe this will bring out new problems like sleep issue, discuss with you guys later.

 

Link sources:

 

http://ipis-osx.wikidot.com/asus-hotkeys

http://www.insanelymac.com/forum/lofiversi...hp/t101966.html

Link to comment
Share on other sites

1. First, get these files and tools:

 

AppleIntelGMAX3100FB.kext

 

otool(command line tool from Xcode installation)

 

Hex Fiend.app

 

2. Copy your kext file to desktop, and run this command in terminal :

otool -vtV /Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB

Search for "SetBacklight", and get the position value of "pushl %ebp": "0x00006190" in my case.

00006187 nop

00006188 nop

00006189 nop

0000618a nop

0000618b nop

0000618c nop

0000618d nop

0000618e nop

0000618f nop

__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:

00006190 pushl %ebp

00006191 movl %esp,%ebp

00006193 pushl %esi

00006194 pushl %ebx

00006195 subl $0x10,%esp

00006198 movl 0x08(%ebp),%esi

0000619b movl 0x0c(%ebp),%ecx

0000619e movl 0x00000384(%esi),%ebx

000061a4 incl %ecx

 

3. Run this command in terminal :

otool -l /Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB

 

Get offset value below section" sectname __text segname __TEXT": mine is "892", which is "0x37C" in hex

/Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB:

Load command 0

cmd LC_SEGMENT

cmdsize 736

segname

vmaddr 0x00000000

vmsize 0x00017dc0

fileoff 892

filesize 97544

maxprot 0x00000003

initprot 0x00000003

nsects 10

flags 0x0

Section

sectname __text

segname __TEXT

addr 0x00000000

size 0x00013f4e

offset 892

align 2^4 (16)

reloff 98436

nreloc 1586

flags 0x00000000

reserved1 0

reserved2 0

Section

sectname __cstring

segname __TEXT

addr 0x00013f50

size 0x000017fc

 

 

 

4. Figure out the value to hex edit, 0x6190+0x37C=0x650C, now open "/Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB" with Hex Fiend.app. And find the position "0x650C"(pls note, this value is in hex), it's "55" followed by "89 E5 56" for me, we should just simply change "55" to "C3", so we get "C3 89 E5 56", then save it.

 

06508 90 90 90 90

0650C 55 89 E5 56

06510 53 83 EC 10

 

 

5. After hexing is done, we run this again to test it:

otool -vtV /Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB

 

And you should see "pushl %ebp" is replaced by "ret", if you don't see this, something maybe wrong.

00006187 nop

00006188 nop

00006189 nop

0000618a nop

0000618b nop

0000618c nop

0000618d nop

0000618e nop

0000618f nop

__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:

00006190 ret

00006191 movl %esp,%ebp

00006193 pushl %esi

00006194 pushl %ebx

00006195 subl $0x10,%esp

00006198 movl 0x08(%ebp),%esi

0000619b movl 0x0c(%ebp),%ecx

0000619e movl 0x00000384(%esi),%ebx

000061a4 incl %ecx

 

6. Install this new kext with kext helper or whatever, finally reboot and enjoy brightness control with your native key strokes .

 

Edit: It's Hex Fiend, sorry for my mistake.

Link to comment
Share on other sites

okay what keys do you use to control the backlight on yours cause i got everything set right take a look mine has FN+ F6=down F7=up

 

__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:

00006110 ret

00006111 movl %esp,%ebp

00006113 pushl %esi

00006114 pushl %ebx

00006115 subl $0x10,%esp

00006118 movl 0x08(%ebp),%esi

0000611b movl 0x0c(%ebp),%ecx

0000611e movl 0x00000384(%esi),%ebx

00006124 incl %ecx

00006125 andl $0x0000fffe,%ecx

0000612b movl %ecx,__ZN20AppleIntelGMAX3100FB9MetaClassC2Ev(%esi)

00006131 movl %ebx,%eax

 

or could you zip yours up so i could try yours to see if it works

Link to comment
Share on other sites

okay what keys do you use to control the backlight on yours cause i got everything set right take a look mine has FN+ F6=down F7=up

 

__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:

00006110 ret

00006111 movl %esp,%ebp

00006113 pushl %esi

00006114 pushl %ebx

00006115 subl $0x10,%esp

00006118 movl 0x08(%ebp),%esi

0000611b movl 0x0c(%ebp),%ecx

0000611e movl 0x00000384(%esi),%ebx

00006124 incl %ecx

00006125 andl $0x0000fffe,%ecx

0000612b movl %ecx,__ZN20AppleIntelGMAX3100FB9MetaClassC2Ev(%esi)

00006131 movl %ebx,%eax

 

or could you zip yours up so i could try yours to see if it works

Thanks, I got no backlight after sleep(actually sleep not work rightly before doing this).

 

 

I have Fn+Home=Up, Fn+End=Down, which I believe is presetted in ACPI, and I'm trying to get bezel icon to show up, maybe a little hack in dsdt would be the job.

Link to comment
Share on other sites

1. First, get these files and tools:

 

AppleIntelGMAX3100FB.kext

 

otool(command line tool from Xcode installation)

 

Hex Fiend.app

 

2. Copy your kext file to desktop, and run this command in terminal :

otool -vtV /Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB

Search for "SetBacklight", and get the position value of "pushl %ebp": "0x00006190" in my case.

00006187 nop

00006188 nop

00006189 nop

0000618a nop

0000618b nop

0000618c nop

0000618d nop

0000618e nop

0000618f nop

__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:

00006190 pushl %ebp

00006191 movl %esp,%ebp

00006193 pushl %esi

00006194 pushl %ebx

00006195 subl $0x10,%esp

00006198 movl 0x08(%ebp),%esi

0000619b movl 0x0c(%ebp),%ecx

0000619e movl 0x00000384(%esi),%ebx

000061a4 incl %ecx

 

3. Run this command in terminal :

otool -l /Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB

 

Get offset value below section" sectname __text segname __TEXT": mine is "892", which is "0x37C" in hex

/Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB:

Load command 0

cmd LC_SEGMENT

cmdsize 736

segname

vmaddr 0x00000000

vmsize 0x00017dc0

fileoff 892

filesize 97544

maxprot 0x00000003

initprot 0x00000003

nsects 10

flags 0x0

Section

sectname __text

segname __TEXT

addr 0x00000000

size 0x00013f4e

offset 892

align 2^4 (16)

reloff 98436

nreloc 1586

flags 0x00000000

reserved1 0

reserved2 0

Section

sectname __cstring

segname __TEXT

addr 0x00013f50

size 0x000017fc

 

 

 

4. Figure out the value to hex edit, 0x6190+0x37C=0x650C, now open "/Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB" with Hex Fiend.app. And find the position "0x650C"(pls note, this value is in hex), it's "55" followed by "89 E5 56" for me, we should just simply change "55" to "C3", so we get "C3 89 E5 56", then save it.

 

06508 90 90 90 90

0650C 55 89 E5 56

06510 53 83 EC 10

 

 

5. After hexing is done, we run this again to test it:

otool -vtV /Users/[your username]/Desktop/AppleIntelGMAX3100FB.kext/AppleIntelGMAX3100FB

 

And you should see "pushl %ebp" is replaced by "ret", if you don't see this, something maybe wrong.

00006187 nop

00006188 nop

00006189 nop

0000618a nop

0000618b nop

0000618c nop

0000618d nop

0000618e nop

0000618f nop

__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:

00006190 ret

00006191 movl %esp,%ebp

00006193 pushl %esi

00006194 pushl %ebx

00006195 subl $0x10,%esp

00006198 movl 0x08(%ebp),%esi

0000619b movl 0x0c(%ebp),%ecx

0000619e movl 0x00000384(%esi),%ebx

000061a4 incl %ecx

 

6. Install this new kext with kext helper or whatever, finally reboot and enjoy brightness control with your native key strokes .

 

Edit: It's Hex Fiend, sorry for my mistake.

 

Looks like it's a no go for me :censored2: :

0000610d	nop
0000610e	nop
0000610f	nop
[b]__ZN20AppleIntelGMAX3100FB14hwSetBacklightEm:
[/b]00006110	ret
00006111	movl	%esp,%ebp
00006113	pushl	%esi
00006114	pushl	%ebx
00006115	subl	$0x10,%esp
00006118	movl	0x08(%ebp),%esi
0000611b	movl	0x0c(%ebp),%ecx
0000611e	movl	0x00000384(%esi),%ebx
00006124	incl	%ecx
00006125	andl	$0x0000fffe,%ecx
0000612b	movl	%ecx,__ZN20AppleIntelGMAX3100FB9MetaClassC2Ev(%esi)
00006131	movl	%ebx,%eax

I have a toshiba satellite l300 and the brightness button does not show up at all in System Preferences/Display and the ACPI Fn buttons on the keyboard don't seem to work either. What may have gotten wrong here?

Link to comment
Share on other sites

I`m using only the 915resolution boot file and the brightness control works fine.

 

Yeah, it works for you because you have the brightness controlled by the BIOS, not by ACPI. I know that the first eeepc was also like that. All in one: Lucky you!

 

@benjan: why is the brightness slider disabled?

Link to comment
Share on other sites

I`m a GMA4500 owner too, what kind of luck is that? :(

 

at least you don't have to use that 'shades' program and get native brightness control which isa good thing when you use your laptop unplugged :)

Link to comment
Share on other sites

Yeah, it works for you because you have the brightness controlled by the BIOS, not by ACPI. I know that the first eeepc was also like that. All in one: Lucky you!

 

@benjan: why is the brightness slider disabled?

 

 

Since you have uneven brightness control with slider if you have framebuffer loaded. And I'm guessing this is to give control back to ACPI. Sorry if I'm wrong, sometimes.

 

Guys,

 

Here I attached my kext files. Make it yours accordingly.

 

 

Added it

X4500.zip

Link to comment
Share on other sites

Since you have uneven brightness control with slider if you have framebuffer loaded. And I'm guessing this is to give control back to ACPI. Sorry if I'm wrong, sometimes.

 

Guys,

 

Here I attached my kext files. Make it yours accordingly.

 

Hey, where are the files?

Link to comment
Share on other sites

 Share

×
×
  • Create New...