2

Author Topic: Stuck key on sleep resume FIX FOUND - See DIFF  (Read 3754 times)

0 Members and 1 Guest are viewing this topic.

uman

  • Observer
  • Posts: 15
Stuck key on sleep resume FIX FOUND - See DIFF
« on: May 31, 2009, 06:03:52 PM »
The fix is in ApplePS2Keyboard.cpp and has to do with uninstalling/reinstalling an interrupt handler. Fix was posted by kenp at http://mydellmini.com/forum/mac-os-x/3553-fixed-zero-key-stack-after-wake-up.html.

Code: [Select]
--- ApplePS2Keyboard.cpp.org 2008-01-31 00:25:24.000000000 +0900
+++ ApplePS2Keyboard.cpp 2009-02-12 22:32:48.000000000 +0900
@@ -803,10 +803,20 @@
 
       setKeyboardEnable( false );
 
+      setCommandByte(kCB_DisableKeyboardClock, kCB_EnableKeyboardIRQ);
+
+      if ( _interruptHandlerInstalled )  _device->uninstallInterruptAction();
+      _interruptHandlerInstalled = false;
+
       break;
 
     case kPS2C_EnableDevice:
 
+      _device->installInterruptAction(this,
+                /*(PS2InterruptAction)&ApplePS2Keyboard::interruptOccurred*/
+     OSMemberFunctionCast(PS2InterruptAction, this, &ApplePS2Keyboard::interruptOccurred));
+      _interruptHandlerInstalled = true;
+
       //
       // Initialize the keyboard LED state.
       //

It should probably be applied to the method ApplePS2Keyboard::setDevicePowerState( UInt32 whatToDo ) in VoodooPS2Controller.cpp.

I would suggest that the Dell Mini's code be examined: http://code.google.com/p/mydellmini/source/browse/#svn/trunk/Kext%20Sources/ApplePS2Controller

because they have fixed some other issues WRT to keyboard layout for international Mini users versus US users..

-u

epal

  • Entrant
  • Posts: 7
Re: Stuck key on sleep resume FIX FOUND - See DIFF
« Reply #1 on: June 06, 2009, 02:59:57 PM »

Does any one have patched de voodoo driver for this fix ????

I will really love this fix :)

But i dont know where to start... i need some help

uman

  • Observer
  • Posts: 15
Re: Stuck key on sleep resume FIX FOUND - See DIFF
« Reply #2 on: June 12, 2009, 03:11:48 PM »
I am not so sure now that this fix is enough. I abandoned VoodooPS2Controller because of the lack of side-scroll and went back to ApplePS2Controller.

I compiled a version of ApplePS2Keyboard.cpp with this fix. What's weird is that it worked very well for many days. Now, after some reboots and DSDT patches (for other problems), I am getting a stuck key on wake again.

I haven't tracked down the reason yet.

Anyways, if you want to try this fix, install XCode from the Apple DVD, and then download the source and build. It's not too complex and is a good skill to have for Hackintoshes. If you don't want to learn that, then buy a real Apple. BTW, I'm not trying to me annoying or mean, just offering some friendly advice.

After owning several Macs, and several Hacks, with a real Mac, you have few problems. With a hack, you'll always be dealing with some issue or the other (kind of like with Windows). The basic skill set for a Hack really is: Unix commands/shell scripting, some dev skills, and tons of patience. If you don't have those skills, then you'll be forever at the mercy of a community's good graces, Google-Fu, and Apple's whims (as they change the source code).

-u