Jump to content

HD 7xxx-Can we eliminate the Sleep Trick?


eep357
 Share

188 posts in this topic

Recommended Posts

OK, well I don't have UEFI and from what k3nny just told told me, he has to use clover UEFI boot for it to work, so my old school BIOS having solution is:

pmset sleepnow 00:00:03 wake

in a launch script, happen so fast you'll never even realize there was problem, with auto login enabled, just boot to desktop with a little flicker :)

  • Like 2
Link to comment
Share on other sites

OK, well I don't have UEFI and from what k3nny just told told me, he has to use clover UEFI boot for it to work, so my old school BIOS having solution is:

pmset sleepnow 00:00:03 wake

in a launch script, happen so fast you'll never even realize there was problem, with auto login enabled, just boot to desktop with a little flicker :)

 

Can you please give me more details about this method ? i don't have experience whit this scrips.

 

Thanks !

Link to comment
Share on other sites

OK, this works! The timing is probably going to be a bit system specific depending on ho many HDs and your overall hardware you have and such. I created an automator app "just use it's search function to find these" with the first part being a "pause" for a few seconds and the second part as "run shell script" with the above pasted into it (had to lengthen to a bit more than 3 secs. Saved it as a app and put into my applications folder (made custom icon :) ) and set it to run at launch by adding to startup list in System Preferences>Users. I was going to just upload mine, but I really think some fine tuning for each setup is needed so it's not too long, or too short.

Link to comment
Share on other sites

OK, I got a bit more digging to do on the wake part :) I think that 00:00:03 just schedules it for 3mins after 12:00 and I got lucky cause now it don't wan't to wake anymore. I'll double check.

Link to comment
Share on other sites

at least it sleeps its self and I just have to tap the keyboard :P Anyone know the sytax on schedualing wake in seconds chime in. Man page says "For sleep cycling applications, pmset can sched-

ule a "relative" wakeup to occur in seconds from the end of system sleep,

but this event cannot be cancelled and is inherently imprecise."

but doesn't say much more...It def worked the first couple times tho

Link to comment
Share on other sites

Yeah, should be able to wake with keyboard......But I want better than just auto sleep, I want auto wake too! So, issue I had was that wake cannot be scheduled in "seconds from sleep" as far as I know. My solution isn't the most elegant but seems to be working, I'm still working out a few kinks, but here's the basics: Set a scheduled wake event to occur around 12:00:20 every day, so 20 seconds after 12:00. This would cause an already sleeping computer to wake at this time if your intention was to have it sleeping. I don't sleep except for this junk. Created automator launch app that runs shell script

systemsetup -setusingnetworktime off | systemsetup -settime 12:00:00 | pmset sleepnow

This turns off internet updated time and sets the clock to 12:00:00 right before putting the computer to sleep, then the scheduled wake event will wake it back up a few seconds later. So then my next step is to run another script that runs on wake which will set back internet updated time using

#!/bin/bash
ntpdate -u time.apple.com

to do this I'm using (and still fiddling with) an utility called SleepWatcher (launch daemon) than can run scripts on sleep or wake. The tricky part is the above command requires sudo, and I don't wan't to have to enter my password to have the time corrected when it wakes up. It's possible to do this without having to enter password and there are a few ways, but one must be very careful not to open a security hole in the process. For this reason I wouldn't want to give specific directions and I'm honestly still fiddling with the best/secure method of doing this. The automated sleep/wake part works a treat! But if I had to interact in anyway to restore my system time after each wake, it would take any gained convenience out.

 

suppose

systemsetup -setusingnetworktime on

might work instead of ntpdate and save that whole headache, will have to give that a go

Link to comment
Share on other sites

BTW, got it all working great!, as outlined above and using

systemsetup -setusingnetworktime on

on wake up. Only caveat is wake time will be rounded to nearest minute by system, so set wake time to 00:01 (can just do this in system preferences) and system time change to 00:00:50 giving it a 10 second sleep. If it takes a while to sleep and shut everything down and it misses it's wake event it won't wake, so finding the right delay is key. Mine takes a while (actually set mine for like 30 secs) because got over 10 hard drives that gotta do their thing before it fully sleeps. Once it wakes up, time is set to normal and I never even see the time change except maybe for a second right when the screen wakes up. Not as fast as EFI/UEFI, but I don't reboot that often, and at least I don't have to babysit it when I do.

Link to comment
Share on other sites

In case your vendor doesn't provide any hybrid vbios, it is possible to create your own.

I used my XFX legacy vbios and added the EFI part from a similar MSI card.

 

The XFX legacy vbios got following structure:

 

1) Legacy part from 0x00000 to 0x0FFFF

0x00000-0x00001: Signature = 0x55 0xAA

0x00002: Length = 0x80 -> 0x80 * 0x200 (block length) = 0x10000

 

2) Unused space from 0x10000 to 0x1FFFF

 

The MSI hybrid vbios - on the other hand - looks like this:

 

1) Legacy part from 0x00000 to 0x0FFFF

0x00000-0x00001: Signature = 0x55 0xAA

0x00002: Length = 0x80 -> 0x80 * 0x200 = 0x10000

 

2) EFI part from 0x10000 to 0x1FE00

0x10000-10001: Signature = 0x55 0xAA

0x10002: Length = 0x7F -> 0x7F * 0x200 = 0x0FE00

 

We can now replace the unused space in the legacy vbios with the EFI driver.

 

Additionally a flag needs to be changed, symbolizing the legacy part is not alone. To find its offset, search for the string "PCIR" and add 17 bytes. I my case it was 0x0023D.

Change it from 0x80 to 0x00.

 

Last but not least the 8-bit checksum in the last byte of the legacy part needs to be recalculated, which can be done - for example - with the "fixrom" script.

You can find the script and the background for all this information here: http://forum.netkas....59.html#msg3859

 

I suggest to verify all the changes and the file size by hand to be sure everything is alright.

 

If you do not know what you are doing, it is better to wait for your vendor to release a hybrid vbios.

Edited by k3nny
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

20130305164242.jpgVendor ID 1002

Device ID 6819

Subvendor ID 1787

SubDevice ID 201C

 

 

 

 

 

Sempre scheda grafica (ma relativa all'audio)

 

Vendor ID 1002

 

Device ID AAB0

 

Subvendor ID 1787

 

SubDevice ID AAB0

 

 

 

 

 

hi in dsdt ?

}

Device (GFX0)

{

Name (_ADR, Zero)

Method (_DSM, 4, NotSerialized)

{

Store (Package (0x10)

{

"AAPL,slot-name",

Buffer (0x07)

{

"Slot-1"

},

"device-id",

Buffer (0x04)

{

0x19, 0x68, 0x00, 0x00

},

"@0,name",

Buffer (0x08)

{

"ATY,Aji"

},

"@1,name",

Buffer (0x08)

{

"ATY,Aji"

},

"@2,name",

Buffer (0x08)

{

"ATY,Aji"

},

"@3,name",

Buffer (0x08)

{

"ATY,Aji"

},

"model",

Buffer (0x13)

{

"AMD Radeon HD 7850"

},

"hda-gfx",

Buffer (0x0A)

{

"onboard-1"

}

}, Local0)

DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))

Return (Local0)

}

}

is correct? thanks

Edited by grillaccio
Link to comment
Share on other sites

  • 2 weeks later...

When I go to 0x23D on my Sapphire HD7970 the byte is already 0x00 but I see no EFI VBIOS(10000-1FFFF is filled with 0xFFs). I have attached it here if anyone can take a look and see why is that?Tahiti.rar

 

Nice news !!

 

Saphire launch a 7950 Mac Edition !!

 

LINK:

 

http://translate.goo...058864/&act=url

 

Now we need a 7970 Mac :)

Link to comment
Share on other sites

@DAXGr:

Here is the ROM I copied the EFI part from for my video card: msi_7870_hybrid.zip

If you compare the structure of both ROMs, the offset for the flag in your ROM is probably 0x241 and is set to 0x80.

OK! Will try with UEFI Clover and 10.8.3 and see what I get, thankfully I have dual bios on the card

 

EDIT: Wait I see 7870, I have a 7970 would it be a problem?

Link to comment
Share on other sites

From which VBIOS do you plan to copy the EFI part? That might be interesting for others as well.

 

EDIT: Most probably it will be. You need to find a 7970 vbios for a card with similar hardware.

Link to comment
Share on other sites

From which VBIOS do you plan to copy the EFI part? That might be interesting for others as well.

 

EDIT: Most probably it will be. You need to find a 7970 vbios for a card with similar hardware.

I downloaded this prior to try and patch it http://www.techpowerup.com/vgabios/132176/Asus.HD7970.3072.120718.html

Link to comment
Share on other sites

grillaccio: can you please share this launch script that you have setup? i got a bit confused at your description, but would like to give it ago if you dont mind sharing!

 

k3nny: where did you get the efi driver to inject it into the bios? i have an xdx 7970 ghz edition and would like to try patching my bios

Link to comment
Share on other sites

For science it is then: xfx_hd7970_ghz.zip

The efi part is from an MSI R7970-2PMD3GD5/OC.

 

Flashing at your own risk in DOS with "atiflash -f -p 0 new.rom".

After a reboot you can see if atiflash recognizes the new vbios with "atiflash.exe -ai 0"

 

K3nny does this patch resolve the sleep trick?

Link to comment
Share on other sites

 Share

×
×
  • Create New...