Voodooprojects

Chameleon => General Discussion => Topic started by: imacken on March 20, 2010, 04:25:34 PM

Title: Sleep and shutdown without additional kexts?
Post by: imacken on March 20, 2010, 04:25:34 PM
I thought that the latest Chameleon RC did away with the need for some kexts, but I can't shutdown without OpenHaltRestart.kext, and I can't sleep without SleepEnabler.kext.
I can restart without either of them, and I've got rid of PlatformUUID.kext, but shutdown and sleep don't seem to work without them.
Is this normal?
Title: Re: Sleep and shutdown without additional kexts?
Post by: Gringo Vermelho on March 21, 2010, 06:45:57 AM
The latest "official" Chameleon release doesn't have any restart, sleep or shutdown-specific fixes.

If you're lucky, shutdown and sleep can be fixed in DSDT.

I use a Chameleon 2.0 RC4 derivative with Duvel3000's restart fix, so I can restart without any extra kexts.

If using Psystar's OpenHaltRestart makes you feel "dirty" :-) there's also EvOReboot.kext and OSXRestart.kext.
Title: Re: Sleep and shutdown without additional kexts?
Post by: imacken on March 21, 2010, 09:26:42 AM
Thanks for that.  Will any future official releases have these built-in?
Title: Re: Sleep and shutdown without additional kexts?
Post by: Gringo Vermelho on March 22, 2010, 10:21:17 PM
RC5 will probably have the restart fix.
Title: Re: Sleep and shutdown without additional kexts?
Post by: Lord Anubis on March 29, 2010, 05:51:20 PM
I use a Chameleon 2.0 RC4 derivative with Duvel3000's restart fix, so I can restart without any extra kexts.

If using Psystar's OpenHaltRestart makes you feel "dirty" :-) there's also EvOReboot.kext and OSXRestart.kext.

Hi Gringo,

what are the benefits from one over the other you did mentioned?
Title: Re: Sleep and shutdown without additional kexts?
Post by: Gringo Vermelho on March 29, 2010, 10:18:48 PM
I don't think there are any, the end result is supposedly the same. Psystar's kext was the first one of its kind. The Evo kext was made so that we could have a non-psystar alternative and I suspect there isn't much of a difference between the two.
Master Chief's kext probably works best if you're also up to date with his DSDT mods? Not sure.

I'm using the AsereBLN 1.19 Chameleon bootloader for now, which has a restart fix built-in so I don't need any of the restart kernel extensions.

Try them all and see which one works best for you.

Visit InsanelyMac and start plowing through the humongous 'DSDT fixes for Gigabyte boards' thread. With a little luck someone already posted one for your board.
Title: Re: Sleep and shutdown without additional kexts?
Post by: imacken on March 29, 2010, 10:48:48 PM
With AsereBLN 1.1.9, I only have fakesmc in my E/E.  Everything else has gone.  Sleep, restart, and shutdown all work fine.  This is mainly down to my DSDT though with various 'fixes' built-in for the Asus P6T Deluxe.
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 27, 2010, 06:06:03 AM
I am trying to get restart to work again without evoreboot (worked with it). All I get now is a shutdown instead.

I am using AnVal bootloader and I believe valv applied the same fixes as AsereBLN. To bad AsereBLN work as stopped. I have the restart fix applied with AnVal but it does nothing for me.

Ive seen DSDT fixes for restart/shutdown and sleep for particular boards. Is there any sort of generic restart fix for DSDT out there? So far my googling as come up short.

Valv if you read this.. Am I right you use Duvel3000's restart fix in your bootloader code? RestartFix=Yes is it right?

Anyone know of a generic restart fix for DSDT? If you can point me towards the part of the DSDT relevant maybe I can figure this out myself.
Title: Re: Sleep and shutdown without additional kexts?
Post by: imacken on June 27, 2010, 09:27:10 AM
Can't help with your question, but the last I heard was that AsereBLN hasn't stopped, he's just taking a few months off somewhere on his boat.
Title: Re: Sleep and shutdown without additional kexts?
Post by: valv on June 27, 2010, 05:45:38 PM
I am using AnVal bootloader and I believe valv applied the same fixes as AsereBLN. To bad AsereBLN work as stopped. I have the restart fix applied with AnVal but it does nothing for me.

Ive seen DSDT fixes for restart/shutdown and sleep for particular boards. Is there any sort of generic restart fix for DSDT out there? So far my googling as come up short.

Valv if you read this.. Am I right you use Duvel3000's restart fix in your bootloader code? RestartFix=Yes is it right?
Back in the days, when Andy implemented that fix, he did it in a slightly different manner. I based my branch on an older revision of his work. It is running for most people over there. Regarding DSDT, u should begin with looking for some other fixes like USB, that directly affect sleep, wakeup, restart...etc. Also, did u have a look at mm67's post (I 've been posting for u at IM)? Try asking him to adapt it to your file. u should also add your FADT into /Extra and see if it gets fixed.
Again, I did not rely on AsereBLN's code. It was more Andy's code on which I based my work. u could conclude this by your self if u were taking time to look for diffs. My aim, is to remain as close as possible to the trunk, without stagnating at it.
Greetz,
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 27, 2010, 06:30:27 PM
Back in the days, when Andy implemented that fix, he did it in a slightly different manner. I based my branch on an older revision of his work. It is running for most people over there. Regarding DSDT, u should begin with looking for some other fixes like USB, that directly affect sleep, wakeup, restart...etc. Also, did u have a look at mm67's post (I 've been posting for u at IM)? Try asking him to adapt it to your file. u should also add your FADT into /Extra and see if it gets fixed.
Again, I did not rely on AsereBLN's code. It was more Andy's code on which I based my work. u could conclude this by your self if u were taking time to look for diffs. My aim, is to remain as close as possible to the trunk, without stagnating at it.
Greetz,

Ohh Yeah you did point me towards that first. I was not ready for it then but I am looking into it again because I have an almost all vanilla system going.

I really want to narrow down the possibilities here for the fix. I have working shutdown but sleep still does not work. You have mentioned the FADT table before but your restart fix patches that table right? So what would be the point? Could FADT table help with sleep?

I have already sent a msg to mm67 asking that exact question. See if he could adapt his DSDT fix for more users. Hope to hear from him soon.

Title: Re: Sleep and shutdown without additional kexts?
Post by: valv on June 27, 2010, 06:57:55 PM
Could FADT table help with sleep?
not as far as I know. u better look into console for messages related to sleep issues. most likely usb related.
Title: Re: Sleep and shutdown without additional kexts?
Post by: mm67 on June 27, 2010, 07:46:14 PM
There is nothing in dsdt related to restart, it's only FACP that is fixed with some bootloaders. Tried to answer your PM but your username on Insanely makes it impossible, I only get a message that there is no such user. For sleep to work properly my system needed fixes for powermanagement and Usb, maybe try checking those first.
 
Title: Re: Sleep and shutdown without additional kexts?
Post by: valv on June 27, 2010, 07:49:54 PM
based on somewhere on efix:
Quote
Guys, the latest build's RestartFix=Yes option did not affect my restart (was working OK) but affected my shut-down... I did remove EvoReboot.kext from /E/E of course... left only with LegacyHDA.kext!

Any ideas? Did anyone else see a shut-down problem? I mean, I get "CPU halted" at the verbose screen, the display shuts but not the mobo...

EDIT1: Asere, you tell us to refer to mm67's post, but you must agree with me that his added bit of code doesn't apply to all motherboards and setups... I mean, I don't even know for which board's DSDT mm67 made this addition of the OperationRegion new code (and memory address):

Code:
    Scope (\)
    {
        Name (PICF, 0x00)
        Method (_PIC, 1, NotSerialized)
        {
            Store (Arg0, PICF)
        }
    }

    OperationRegion (PMRS, SystemIO, 0x0430, 0x1)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
               ,   4,
           SLPE,   1
    }

    Method (\_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
        Store (Local0, DBG1)
        OSTP ()
        If (LEqual (Arg0, 0x01)) {}
        If (LEqual (Arg0, 0x03)) {}
        If (LEqual (Arg0, 0x05))
        {
            Store (ESMI, Local0)
            And (Local0, 0xFB, Local0)
            Store (Local0, ESMI)
            Store (0x99, SMIP)
            Store (Zero, SLPE)
            Sleep(0x10)
        }

        If (LEqual (Arg0, 0x04))
        {
            If (LNot (PICF))
            {
                Sleep (0x64)
            }
        }
    }

EDIT2: Found the OperationRegion declaration in my DSDT with address 0x0430, it had another variable name... Apparently this address is also used by my mobo's BIOS/DSDT.

So I modified the code according to mm67's instructions and by removing EvoReBoot.kext I am now able to restart/shutdown (using RestartFix=Yes in com.apple.Boot.plist too). Many thanks.
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 28, 2010, 02:33:11 AM
Valv you are my hero.. :-)

I'll take a look at this and see if I can apply the same method... With a lot of the other DSDT patches I have found. I have not been able to simply apply them to my DSDT, because it does not match closely enough and I dont have the experience to adapt the fix myself. Ill see what I can uncover here.. Those who never try fail...
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 28, 2010, 08:26:45 PM
Ok I knew this was not going to be easy.. I am looking through my DSDT and all I can say is #$(%. My only problem is that my system will not reboot. I get shutdown instead. So hopefully this code adjustment will fix that.

I of course dont have anything that screams I'm in the right place. Memory address does not match or anything..

However I found a piece of the code that looks like it might be it... It matches on structure only.

Is this it? If so what on earth do I change? Can you guys give me some pointers on this?

Code: [Select]
    OperationRegion (PRT0, SystemIO, 0x80, 0x04)
    Field (PRT0, DWordAcc, Lock, Preserve)
    {
        P80H,   32
    }

    Method (P8XH, 2, Serialized)
    {
        If (LEqual (Arg0, Zero))
        {
            Store (Or (And (P80D, 0xFFFFFF00), Arg1), P80D)
        }

        If (LEqual (Arg0, One))
        {
            Store (Or (And (P80D, 0xFFFF00FF), ShiftLeft (Arg1, 0x08)
                ), P80D)
        }

        If (LEqual (Arg0, 0x02))
        {
            Store (Or (And (P80D, 0xFF00FFFF), ShiftLeft (Arg1, 0x10)
                ), P80D)
        }

        If (LEqual (Arg0, 0x03))
        {
            Store (Or (And (P80D, 0x00FFFFFF), ShiftLeft (Arg1, 0x18)
                ), P80D)
        }

On second thought this could be it also. It looks like I would add the method code in here. But where exactly?

Code: [Select]
Scope (\)
            {
                OperationRegion (IO_T, SystemIO, 0x0800, 0x10)
                Field (IO_T, ByteAcc, NoLock, Preserve)
                {
                            Offset (0x08),
                    TRP0,   8
                }

                OperationRegion (PMIO, SystemIO, 0x1000, 0x80)
                Field (PMIO, ByteAcc, NoLock, Preserve)
                {
                            Offset (0x2A),
                            Offset (0x2B),
                        ,   2,
                    ACPW,   1,
                            Offset (0x42),
                        ,   1,
                    GPEC,   1,
                            Offset (0x64),
                        ,   9,
                    SCIS,   1,
                            Offset (0x66)
                }

I found another topic where mm67 is talking about this but I cant figure out how to calculate where this code needs to go either way.. Here is the quote..
Quote
It's only this :
Code: [Select]

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,   4,
        SLPE,   1,
and this:
Code: [Select]

        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }
that make the shutdown work, rest of the code is Gigabyte specific. This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)
Title: Re: Sleep and shutdown without additional kexts?
Post by: mm67 on June 29, 2010, 02:21:44 AM
This code has nothing to do with restart, this only fixes shutdown. Restart fix is in bootloader.
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 29, 2010, 05:24:29 AM
This code has nothing to do with restart, this only fixes shutdown. Restart fix is in bootloader.

Is there no possible fix for restart in the DSDT? I already have restartfix=yes in my bootloader and actually fixes nothing, restart still fails. My shutdown is fine with vanilla files/DSDT. It would make sense to me that if my system can not restart and I get a shutdown an adjustment to the ACPI code for when restart is called could be possible.

Here is what I get with and without restartfix applied in AnVAL valvs bootloader that I use.

Without shutdown works.
With shutdown works
Without restart = black screen
With restart = shutdown

I thought your fix would help if it was either problem, restart or shutdown. Maybe I need a new fix specific to me. If thats the case Ill never figure this out.

Hope you can help...

Thanks

UPDATE: Valv has pointed me to this fix: http://www.insanelymac.com/forum/index.php?s=&showtopic=192518&view=findpost&p=1363388

valv also has an edit to the FADT table applied to his bootloader. I think I figure out why that fix or maybe why Duvel300 fix may not work for me. I have ACPI 2.0 and the FADT fix he refers to is for ACPI 1.0.

I've been reading so much and now I'm not sure what I need anymore. A DSDT fix, a FADT fix or some combo of both. It seems so silly all I have is restart fail me. It has to be FADT but how to extract mine and edit it. No one explains this anywhere. Duvel300 said he would make a guide but I cant find ref to it anywhere prob never happened because bootloaders started addressing this issue.

Can someone HELP ME? PLEASE!!!
Title: Re: Sleep and shutdown without additional kexts?
Post by: mm67 on June 29, 2010, 09:38:53 AM
Have you tried OSXRestart.kext ?
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 29, 2010, 11:15:58 AM
Have you tried OSXRestart.kext ?

Well evoreboot.kext worked fine for me as I assume OSXrestart.kext would also. I am trying to find a DSDT fix for this as an alternative. Since there seems to be DSDT fixes for shutdown/restart why cant this be adapted for me.

Your fix appears to only be for shutdown.

Duval300's FADT fix seems to be for restart but isnt that the same fix applied to AnVAL and AseralBLN's bootloader.

I seem to have an DSDT/ACPI table that almost got it all right but there are a few things that still need to be fixed. Restart and speedstep and thats it.

Can you help me fix my restart through the DSDT/FADT mm67?

UPDATE: I was able to extract my FADT table and it I booted with it but no change to restart. If there is an edit needed to this table I am not sure what I need to change. Any Idea? anyone?
Title: Re: Sleep and shutdown without additional kexts?
Post by: valv on June 29, 2010, 11:38:02 AM
Do u have any usb related kexts? If not, how do usb show on "system profiler" (expansion slot, or built-in)?
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 29, 2010, 02:05:55 PM
Do u have any usb related kexts? If not, how do usb show on "system profiler" (expansion slot, or built-in)?

My USB is are seen as built in. I have been looking through console looking for errors that might lead me to something. I do get some kind of failed something when I go to restart but I can not find the reference to it in the shutdown log. Is it somewhere else?

I do not have any USB kext installed either except my zydas Wifi in E/E but I have unplugged all USB items and restarted and it still hangs. Is just having the kext on the system enough? Plus before I had the zydas driver loaded on the system I believe I had the same restart issue. It may be generally USB related but I doubt its zydas.
Title: Re: Sleep and shutdown without additional kexts?
Post by: mm67 on June 29, 2010, 02:19:44 PM
Duvel's FADT fix is exactly what newer bootloaders do, there isn't any dsdt fixes for restart.
Title: Re: Sleep and shutdown without additional kexts?
Post by: 00diabolic on June 29, 2010, 03:43:35 PM
Duvel's FADT fix is exactly what newer bootloaders do, there isn't any dsdt fixes for restart.

I was afraid you were going to say that. So I'm stuck with the kext for now. Ok Thanks.. Ill worry about fixing speedstep then however I dont think Ill get working sleep without addressing this. Arnt those kinda related? It seems if you cant get one of the 3 you cant get the other 2 either. At least thats what seems to be true lol.
Title: Re: Sleep and shutdown without additional kexts?
Post by: mm67 on June 29, 2010, 03:46:36 PM
At least my system needed working power management before sleep worked properly so that might be a good idea.