Wow amirstep, that's a valiant effort. I coincidentally had a look the acpi pdf over the last weekend and it frightened me. Especially when Linus Torvalds himself says things like
One of the main difficulties is that one iteration of coding-testing takes a whole reboot. Do you use any form of (remote) debugging or anything like that?
SLEEP PARTIALLY FIXED!
Mac OS is usually programmed to use the hibernatemode = 3 setting. This is a setting whereby the computer is put to 'sleep' (or S3) with option to go into hibernate mode (S4) in case of power failure or other issues.
If the hibernatemode is set to 1, the traditional 'hibernate' takes place. This can be done in the terminal by typing 'sudo pmset hibernatemode 1'. Can get the current settings by typing 'pmset -g'.
I changed my hibernate mode to 1 and hibernate works very similar to Windows 7 now. In Windows, the system takes about 10 seconds, then turns off completely. By pressing the power button, the bios restarts (Dell BIOS screen flashes on the screen) and the 'Windows is resuming' screen pops up.
In mac os now, if I select 'sleep', the system takes about 6 seconds, turns off completely. When I press the power button, the BIOS starts again and I get chameleon screen. Then a 'wake' screen starts and the computer 'wakes' where I left off with all my open applications etc.
I still can't get hibernatemode = 0 or hibernatemode = 3 (traditional 'sleep') to work. The power button LED stays on and does not blink. The fan stays on. I have to power down the computer to complete off by holding down the power button. Then I re-press the power button, the BIOS restarts, chameleon restarts but it bypasses the normal boot and the computer 'wakes up'. Not sure how to get this to work yet.
I'm also getting occasional KP with this but I cannot figure out any pattern to it. I'm messing quite a bit with DSDT so it could be related to that.