DSDT fix for LID sleep - no need for ClamshellDisplay.kext

All versions of Mac OS X

Moderator: SilverZero

Forum rules
The S netbook is NOT an Apple product and was never intended to run Mac OSX. Fortunately, enthusiasts have found ways to make OSX run on our netbook. However, the process may not be smooth for some. Make sure you have patience and time to get it to run. Most importantly, motivation to read and learn. This forum contains enough information to get OSX running. Most problems you may encounter can be solved just by reading through the forums or searching. So please take the time and read through the forums!

DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby humph » Thu Mar 04, 2010 5:47 pm

Hi all, if you are reading this for the first time, here below is the latest news, also see my post further down page http://s10lenovo.com/viewtopic.php?f=15&t=4024#p27879.

This procedure will enable, via DSDT edits and a free app (FunctionFlip) you to not need ClamShellDisplay or any other kext, and to get lid close working including backlight OK on wakeup, plus also use of Fn1/Fn2 etc as brightness control. Also use of other Fn buttons for volume etc.

I have an S9e, but I see no reason why it will not work on other machines, provided you:
a) Can sleep OK by use of SleepEnabler or other solutions such as Meklort's new vanilla speedstep kexts.
b) Have good DSDT for GFX, or use one of the Chameleon spins that has "GraphicsEnabler" for GMA950

The credit for this solution goes to Prasys, 18Seven, slice & tea from other forums.

If I can find time and the right words I guess I should write this up in an easy-to-follow procedure.

(This para is out of date, leaving in for history).
Finally managed to figure out where to make the DSDT edit to get sleep to work on lid close.
I have S9e, but I presume S10/e have very similar DSDT, so hope this helps others, as Lenovo DSDT looks nothing like the examples I've seen on most forums where the LID sleep fix is shown! See below:

EDIT 3/9..Ignore this code below. See update #2 at end of this post.

Code: Select all
           Device (LID)
            {
            Name (_HID, EisaId ("PNP0C0D"))
            Name (LSTS, Zero)
            Method (_LID, 0, NotSerialized)
            {
                If (ECON)
                {
                    TRAP (0x49)
                    Sleep (0x64)
                }
                Else
                {
                    Store (One, LSTS)
                    Store (One, LIDS)
                }

                If (LEqual (LIDS, Zero))
                {
                    Store (Zero, ^^PCI0.GFX0.LBB)
                    Notify (SLPB, 0x80)            //Added to make sleep on Lid close work
                    Return (Zero)
                }
                Else
                {
                    Store (CM2B, ^^PCI0.GFX0.LBB)
                    Return (One)
                }
            }
        }

        OperationRegion (EXCO, SystemIO, 0x72, 0x02)
       ... etc etc etc


Now no need for ClamshellDisplay in /S/L/E :)

UPDATE 3/9: Trying to get this working more "nicely": using PNLF in DSDT will make for correct LID sleep (w/o the above messy hack and provided GFX is injected correctly also) and also give backlight control to the OS, rather than BIOS control on Fn-up/down. But so far not found a solution to getting backlight control working nicely on hardkeys (only in Display Preference Pane) when PNLF is used.

UPDATE 3/9 #2: Got it working w/o the ugly hack above. Can now use F1/F2 to control backlight. See:
http://prasys.co.cc/2009/12/getting-fn-toggle-key-to-work-on-hackbooks/
http://www.projectosx.com/forum/index.php?showtopic=779

UPDATE 3/31: This approach works for 10.6.3
(although you might need to use some 10.6.2 as I still do today, I've not tested with 10.6.3 frambuffer, GMA etc yet as I have all the GFX related stuff still from 10.6.2 in /E/E and Extensions.mkext so that I have a 100% vanilla /S/L/E running at 10.6.3. Will check/update later).

UPDATE 4/1: Tested OK when upgrading dependancy kexts (framebuffer/GMA/audio etc) that I have in /E/E.
Last edited by humph on Fri Apr 02, 2010 1:34 pm, edited 5 times in total.
humph
Experienced
 
Posts: 96
Joined: Thu Aug 13, 2009 12:44 pm

Advertisement

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby SilverZero » Thu Mar 04, 2010 9:55 pm

This is for Snow Leopard, correct?

I'm not sure if this is already integrated into the latest Enabler, but I know vaniii has been working pretty closely with meklort to get things like this utilized. If it's not, you might want to PM vaniii or something. :)
User avatar
SilverZero
Moderator
 
Posts: 1374
Joined: Wed Apr 08, 2009 3:47 pm
Location: The Great Northwest
Color and Model: Sold
OS(s) installed: All of them

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby phattbam » Fri Mar 05, 2010 12:07 pm

anyway we can manually make those coding changes?
phattbam
Master
 
Posts: 450
Joined: Wed Sep 23, 2009 10:48 am
Color and Model: Black S10
OS(s) installed: Win7 Ultimate AND OSX SL 10.6.4

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby qubit » Fri Mar 05, 2010 2:50 pm

phattbam wrote:anyway we can manually make those coding changes?


You need to disassemble the DSDT file here is a brief guide : http://www.linux.it/~malattia/wiki/index.php/Disassemble_your_DSDT and I'm not sure the programs linked on the page are for osx, though I presume so and you can always try and see if they work. They wont cause any damage to your system if they don't. In a word of warning, running a manually edited DSDT file is very risky should you make a mistake in the edit as it refers to the ACPI table which controls all the low level power states of your device like the fan, speed step etc... On this basis, I would recommend following SilverZero's idea and waiting for vaniii to release a solution ;)
~~ Classic Black Ol'School S10 w/Triple Boot ~~
~~ OS X 10.6.4 modified NetBookInstaller 0.8.4RC1, modified DSDT ~~
~~ Ubuntu 10.04 ~~
~~ Windows7 ~~
~~NetBook Installer~~
~~XDA Developers - HTC Desire Android Development~~
User avatar
qubit
Experienced
 
Posts: 118
Joined: Sun Feb 22, 2009 11:19 pm
Color and Model: Classic Black S10
OS(s) installed: OS X Linux Win7

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby phattbam » Fri Mar 05, 2010 3:34 pm

thanks. i'll hang tight for now
phattbam
Master
 
Posts: 450
Joined: Wed Sep 23, 2009 10:48 am
Color and Model: Black S10
OS(s) installed: Win7 Ultimate AND OSX SL 10.6.4

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby humph » Fri Mar 05, 2010 5:51 pm

The whole DSDT thing was also daunting to me not that long ago. However it's not that bad when you get into it. Editing DSDT.dsl files is easy using TextWrangler, plus there are "safeguards" you can take to avoid problems:
a) Do a "Find Differences" between your saved edited version and the original one, to see that the only changes you have are the ones you want.
b) When you recompile to DSDT.aml, the compiler will often find errors and refuse to compile if you've made a hash of things - although it's possible to not have any compile errors, but be using the wrong values in settings for registers etc that could in theory I guess cause hardware issues (damage).

To easily disassemble/compile DSDT, Google & get the latest GUI tool "iASLMe", just released a couple of weeks ago. It's very easy to use. Drag the DSDT.aml over the icon for the app, and it decompiles to make a .dsl. Do same with .dsl and it makes your new .aml (compiled) version.

The code section above runs when lid closed and the line added just tells the sleep button that it's been "virtually" pressed. May not be very elegant, but works...
humph
Experienced
 
Posts: 96
Joined: Thu Aug 13, 2009 12:44 pm

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby humph » Tue Mar 09, 2010 6:17 am

Hi all.

Pls forgive me for replying to self to "renew" the post.
However, it's a significant breakthrough that I think it's something many will want to know about!

I now have gotten LID sleep using the "proper" DSDT solution (PNLF), but more importantly, have managed to give full control over backlight to the OS, and can change backlight using F1, F2 as on real mac.

Forget the DSDT hack in the initial post, the important stuff is:
1) check that AppleACPIEC loads on your machine (kextstat). If not, then you'll have to fix that first.

2) Add PNLF http://www.projectosx.com/forum/index.php?showtopic=779

3) Follow Prasys' notes http://prasys.co.cc/2009/12/getting-fn-toggle-key-to-work-on-hackbooks/
Dont think you need Key4Mac to get F1 etc working, but you do need FunctionFlip.
humph
Experienced
 
Posts: 96
Joined: Thu Aug 13, 2009 12:44 pm

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby phattbam » Tue Mar 09, 2010 9:04 am

humph wrote:Hi all.

Pls forgive me for replying to self to "renew" the post.
However, it's a significant breakthrough that I think it's something many will want to know about!

I now have gotten LID sleep using the "proper" DSDT solution (PNLF), but more importantly, have managed to give full control over backlight to the OS, and can change backlight using F1, F2 as on real mac.

Forget the DSDT hack in the initial post, the important stuff is:
1) check that AppleACPIEC loads on your machine (kextstat). If not, then you'll have to fix that first.

2) Add PNLF http://www.projectosx.com/forum/index.php?showtopic=779

3) Follow Prasys' notes http://prasys.co.cc/2009/12/getting-fn-toggle-key-to-work-on-hackbooks/
Dont think you need Key4Mac to get F1 etc working, but you do need FunctionFlip.


is this fool proof? I would like to sue the F1 and F2 for brightness control along with a fixed lid sleep
phattbam
Master
 
Posts: 450
Joined: Wed Sep 23, 2009 10:48 am
Color and Model: Black S10
OS(s) installed: Win7 Ultimate AND OSX SL 10.6.4

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby humph » Tue Mar 09, 2010 4:43 pm

Hi phattbam (again!),

Pretty solid I think. O course, there are many steps where its possible to make errors!!

Main issue I just discovered is compiling/decompiling DSDT using iasl...If you just grabbed the latest version of iasl precompiled by someone else on, say, a C2D machine, then that gives errors running on Atom processor. Choices are:
a) Get Nov 2009 version of iASLMe - seems to run on Atom OK. But is old version of iasl inside.
b) Best - get iasl sources (see ProjectOSX) and compile latest sources yourself. Works (seems to, for me) on Atom OK. Need to install XCode to do the build, however.

Also need to ensure "correct" GFX GMA950 graphics stuff in DSDT also (referenced in the links anyway).

Worst case, is you get panic on boot due to bad DSDT (or accidentally copying dsdt.dsl to DSDT.aml...I know!) and need to select your good backup DSDT at Chameleon boot (-v DSDT=/Extra/DSDT.aml.bak or whatever/wherever yours is).
humph
Experienced
 
Posts: 96
Joined: Thu Aug 13, 2009 12:44 pm

Re: DSDT fix for LID sleep - no need for ClamshellDisplay.kext

Postby phattbam » Tue Mar 09, 2010 5:39 pm

I would like to do all that but I'm afraid I'll botch up the job and I'll regret tampering with it.
phattbam
Master
 
Posts: 450
Joined: Wed Sep 23, 2009 10:48 am
Color and Model: Black S10
OS(s) installed: Win7 Ultimate AND OSX SL 10.6.4

Next

Return to Mac OS X

Who is online

Users browsing this forum: No registered users and 2 guests

cron