Waking system up from suspend-to-ram at specified time.

Ian Smith smithi at nimnet.asn.au
Mon Jul 30 15:21:25 UTC 2012

In freebsd-questions Digest, Vol 425, Issue 13, Message: 13
On Sat, 28 Jul 2012 21:37:48 +0200 Piotr Czachur <zimnyx at gmail.com> wrote:
 > Dear users,
 > Does FreeBSD support waking system up from S3 (suspend to RAM) state
 > at specified time? On Linux, it can be achieved using rtcwake command
 > that uses RTC support in kernel.

Not yet, unless I've missed something since 2010 (not impossible :) 

 > If it's not supported, maybe I can somehow enable waking from S3 using
 > BIOS autoresume option? It powers my box on from complete off, but
 > fails to wake it up from S3. What works for now is waking from S3
 > using Wake-on-LAN.
 > Cheers,
 > Piotrek

On my Thinkpad T23, BIOS autostart (not autoresume) time setting also 
works only from a cold start.  WoL also worked from 'off' but not from 
S3, but that was on 8.1-STABLE.  What version are you running, and on 
what machine?  Some reports indicate success may depend on which BIOS.

I'll forward you offlist a couple of never-completed drafts that turned 
up in postponed messages from 2010 while hunting mail about this, to 
(bcc'd) avg@, brucec@ and mav@, after researching this in response to an 
ACPI PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern%2F73823&cat=

Then at least, you also had to modify Linux shutdown behaviour to avoid 
writing the clocktime back to the RTC if a wake time had been set, as 
RTC writes did not preserve the RTC wake interrupt bit, for some reason.

FreeBSD also does not preserve (gratuitously zeroes) that bit on all RTC 
writes, which is easily enough fixable, mostly in writertc.c, with few 
other places needing mods that I could see.  Ah yes, plus a (cleanroom) 
utility not unlike rtcwake, but once writertc() is fixed that should be 
relatively trivial, without needing to mess with the shutdown code.

Present circumstances don't permit me to work on this further, but I do
think it could be a worthwhile and not so hard project for 'someone' :)

cheers, Ian

More information about the freebsd-questions mailing list