Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

acpi S4 resume partition

0 views
Skip to first unread message

toxa

unread,
Jan 13, 2004, 9:17:19 PM1/13/04
to
Sorry for stupid question but I can't find good documentation about
preparing system for hibernating with acpi.
I mean, if I use acpiconf -s4 (suspend to disk) then system should to put
all memory contest info physical partition and resume from it when booting
by bootloader, shouldn't it? So I have to prepare such partition and tell
system (probably using loader.conf) to use it for hibernating. Something
like "resume=/dev/hda2" in lilo.conf in linux. Am I right? Because for now
acpiconf -s4 puts my system into shutdown/sleep, and, when I powering on, it
boots into new session, with "partitions was unproperly unmounted" errors.

_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Daniel O'Connor

unread,
Jan 13, 2004, 11:32:27 PM1/13/04
to
On Wednesday 14 January 2004 12:47, toxa wrote:
> Sorry for stupid question but I can't find good documentation about
> preparing system for hibernating with acpi.
> I mean, if I use acpiconf -s4 (suspend to disk) then system should to put
> all memory contest info physical partition and resume from it when booting
> by bootloader, shouldn't it? So I have to prepare such partition and tell
> system (probably using loader.conf) to use it for hibernating. Something
> like "resume=/dev/hda2" in lilo.conf in linux. Am I right? Because for now
> acpiconf -s4 puts my system into shutdown/sleep, and, when I powering on,
> it boots into new session, with "partitions was unproperly unmounted"
> errors.

In principle, yes..
However there is no support in FreeBSD for suspending to disk so you are out
of luck..

In theory your BIOS could support S4BIOS which means it does most of the work,
but I don't think anyone has ever had that work either.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5

Stijn Hoop

unread,
Jan 14, 2004, 1:59:31 AM1/14/04
to
On Wed, Jan 14, 2004 at 03:02:27PM +1030, Daniel O'Connor wrote:
> In theory your BIOS could support S4BIOS which means it does most of the
> work, but I don't think anyone has ever had that work either.

I had this working on a Dell Inspiron 4150, but it turned out to be much
slower than just rebooting the thing (about 60 seconds for reading/writing it
all to disk vs about 30 seconds for booting). I needed to get a Dell utility
from the website (S2D.EXE iirc) and create a suspend to disk partition *as
the first partition on the disk*.

And of course, resuming within X was not really supported because some things
like the display failed to properly reinitialize, just like with S3.

In the end I decided to dedicate the space to something else. It wasn't worth
it IMHO. An OS-based S4 might turn out to be much more useful.

--Stijn

--
"I used to think I was indecisive, but now I'm not so sure."

Amar Takhar

unread,
Jan 14, 2004, 2:06:24 AM1/14/04
to
On 2004-01-14 15:02 +1030, Daniel O'Connor wrote:
> On Wednesday 14 January 2004 12:47, toxa wrote:
> > Sorry for stupid question but I can't find good documentation about
> > preparing system for hibernating with acpi.
> > I mean, if I use acpiconf -s4 (suspend to disk) then system should to put
> > all memory contest info physical partition and resume from it when booting
> > by bootloader, shouldn't it? So I have to prepare such partition and tell
> > system (probably using loader.conf) to use it for hibernating. Something
> > like "resume=/dev/hda2" in lilo.conf in linux. Am I right? Because for now
> > acpiconf -s4 puts my system into shutdown/sleep, and, when I powering on,
> > it boots into new session, with "partitions was unproperly unmounted"
> > errors.
>
> In principle, yes..
> However there is no support in FreeBSD for suspending to disk so you are out
> of luck..
>
> In theory your BIOS could support S4BIOS which means it does most of the work,
> but I don't think anyone has ever had that work either.

Actually, I remember installing FreeBSD 4.0 on my Dell Inspiron 7500, both
suspend to disk, and suspend to memory worked *perfectly*

Unfortunatly it hasn't worked on any recent versions of FreeBSD, not sure when
it broke. Inspiron 7600's do S4 via the BIOS and write the memory contents to a
fat32 partition, there is a small utility to set the 'save-to-disk' file.

It was also fine in 4.1 IIRC, some day i'll find the time to figure out why it
dosn't work anymore.


Amar.
--
http://www.ten15.org

Daniel O'Connor

unread,
Jan 14, 2004, 2:56:02 AM1/14/04
to
On Wednesday 14 January 2004 17:29, Stijn Hoop wrote:
> On Wed, Jan 14, 2004 at 03:02:27PM +1030, Daniel O'Connor wrote:
> > In theory your BIOS could support S4BIOS which means it does most of the
> > work, but I don't think anyone has ever had that work either.
>
> I had this working on a Dell Inspiron 4150, but it turned out to be much
> slower than just rebooting the thing (about 60 seconds for reading/writing
> it all to disk vs about 30 seconds for booting). I needed to get a Dell
> utility from the website (S2D.EXE iirc) and create a suspend to disk
> partition *as the first partition on the disk*.

OK, interesting :)
I have an Inspiron 8000 and in 4.x I could suspend to disk using the BIOS
after making an image partition.

> And of course, resuming within X was not really supported because some
> things like the display failed to properly reinitialize, just like with S3.

I added a vidcontrol command to switch to the console on suspend, and to X on
resume which fixed the minor glitch I got at the top of the screen.

> In the end I decided to dedicate the space to something else. It wasn't
> worth it IMHO. An OS-based S4 might turn out to be much more useful.

Yeah same here, the BIOS suspend is crippled because it can't do DMA (I
believe) and doesn't know what can be thrown away so it takes ages. Not to
mention the PITA factor if you upgrade the amount of RAM you have..

John Baldwin

unread,
Jan 14, 2004, 4:15:06 PM1/14/04
to
On Wednesday 14 January 2004 01:33 pm, to...@cterra.ru wrote:
> On Wed, Jan 14, 2004 at 03:02:27PM +1030, Daniel O'Connor wrote:
> > On Wednesday 14 January 2004 12:47, toxa wrote:
> > However there is no support in FreeBSD for suspending to disk so you are
> > out of luck..
> >
> > In theory your BIOS could support S4BIOS which means it does most of the
> > work, but I don't think anyone has ever had that work either.
> >
> > --
>
> Does it means that all I can do is to try to get S3 (suspend to ram) state
> to work without any chance fot suspending to disk? By the way S3 put
> machine into the sleep with red-blinking power led (i think it's abnormal),
> and when I power it on led turns on back and shows me command line but
> mackine freezes.

You might have to wait a while for it to finish resuming. My dell laptop
takes about 50 seconds to a minute to fully come back after an S3 resume. It
seems to be hung during that minute as the disk doesn't do anything, but it
does eventually come back if I wait long enough.

--
John Baldwin <j...@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org

Daniel O'Connor

unread,
Jan 14, 2004, 6:27:14 PM1/14/04
to
On Thursday 15 January 2004 05:03, to...@cterra.ru wrote:
> Does it means that all I can do is to try to get S3 (suspend to ram) state
> to work without any chance fot suspending to disk? By the way S3 put

Yep..
Unless you want to write suspend to disk code 8-)

> machine into the sleep with red-blinking power led (i think it's abnormal),
> and when I power it on led turns on back and shows me command line but
> mackine freezes.

I'm only new to this ACPI stuff myself, so I don't know any handy tricks :(

Randy Bush

unread,
Jan 15, 2004, 1:40:44 AM1/15/04
to
> I'm only new to this ACPI stuff myself, so I don't know any handy
> tricks :(

nor so i. for example, my laptop seems to suspend with -s3. but
closing the lid, which suspends it in winxp, does not suspend it,
only dims the screen. is there somewhere can i read about this in
a useful, pragmitic, "to get result X configure it this way"
manner?

randy

Rahul Siddharthan

unread,
Jan 15, 2004, 2:12:21 AM1/15/04
to
Randy Bush wrote:
> nor so i. for example, my laptop seems to suspend with -s3. but
> closing the lid, which suspends it in winxp, does not suspend it,
> only dims the screen.

sysctl hw.acpi.lid_switch_state=S3
It can also be done via devd.conf, I imagine

> is there somewhere can i read about this in
> a useful, pragmitic, "to get result X configure it this way"
> manner?

Most event-based stuff can be configured via devd, and available
sysctl values can be seen via sysctl -a ...

Also, for most well-established features the handbook and faq are good
places to look.

Rahul

Randy Bush

unread,
Jan 15, 2004, 10:49:20 AM1/15/04
to
> sysctl hw.acpi.lid_switch_state=S3

yes! thanks.

> It can also be done via devd.conf, I imagine

so can a lot of things, i suspect. but the learning curve ...
i will start reading on acpi i guess. wasn't apm bad enough?

randy

Randy Bush

unread,
Jan 15, 2004, 10:54:59 AM1/15/04
to
>> nor so i. for example, my laptop seems to suspend with -s3. but
>> closing the lid, which suspends it in winxp, does not suspend it,
>> only dims the screen.
> sysctl hw.acpi.lid_switch_state=S3

i lied.

this works if X has not been started. once X starts, this does not
work in X or in a console vty.

randy

Mark Santcroos

unread,
Jan 16, 2004, 2:51:24 AM1/16/04
to
On Wed, Jan 14, 2004 at 05:17:19AM +0300, toxa wrote:
> Because for now
> acpiconf -s4 puts my system into shutdown/sleep, and, when I powering on, it
> boots into new session, with "partitions was unproperly unmounted" errors.

This looks good. However, when you power your machine on again, you have
to tell it to boot from the suspend partition, and not from your normal
boot partition.
This is at least how it works on my laptop (Dell).

Mark

Daniel O'Connor

unread,
Jan 16, 2004, 5:41:55 AM1/16/04
to
On Friday 16 January 2004 18:21, Mark Santcroos wrote:
> > it boots into new session, with "partitions was unproperly unmounted"
> > errors.
>
> This looks good. However, when you power your machine on again, you have
> to tell it to boot from the suspend partition, and not from your normal
> boot partition.
> This is at least how it works on my laptop (Dell).

I added some stuff to /etc/rc.suspend to run boot0cfg to change my default
boot partition (and to /etc/rc.resume to change it back to FreeBSD)

Basically boot0cfg -s X /dev/ad0

I also used..
vidcontrol -s 1 </dev/ttyv0
and
vidcontrol -s 9 </dev/ttyv0

to prevent video corruption on suspend.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5

_______________________________________________

Mark Santcroos

unread,
Jan 16, 2004, 5:48:34 PM1/16/04
to
On Fri, Jan 16, 2004 at 10:49:07AM -0600, Dan Nelson wrote:
> So S4BIOS does only the first half of the job, or is there some magic
> BIOS/ACPI call FreeBSD can do to make this happen automatically?

It's a hook into the BIOS indeed. The ACPI system reports to the OS
whether S4BIOS is available.

When it is, the OS doesn't need to do much itself and the BIOS does most
of the work. The tasks of the OS is to make sure all drivers are having
the right state and turning devices on and off.

> I can't believe Windows modifies the MBR on suspend...

Correct, Windows doesn't use S4BIOS at all, it's fully inplemented in
software and therefore a regular S4.

Mark

Daniel O'Connor

unread,
Jan 16, 2004, 7:08:45 PM1/16/04
to
On Saturday 17 January 2004 03:19, Dan Nelson wrote:
> > Basically boot0cfg -s X /dev/ad0
>
> So S4BIOS does only the first half of the job, or is there some magic
> BIOS/ACPI call FreeBSD can do to make this happen automatically? I

> can't believe Windows modifies the MBR on suspend...

<shrugs>
WinME and higher don't use S4BIOS anyway so it's irrelevant.

Prior to that it was dependant on the BIOS and on at least on laptop we have
at work it did modify the MBR to boot off the correct partition after an APM
suspend to disk.

to...@cterra.ru

unread,
Jan 17, 2004, 1:10:31 PM1/17/04
to
On Fri, Jan 16, 2004 at 11:46:07PM +0100, Mark Santcroos wrote:

> On Fri, Jan 16, 2004 at 07:19:19PM +0300, toxa wrote:
> >
> >
> > > This looks good. However, when you power your machine on again, you have
> > > to tell it to boot from the suspend partition, and not from your normal
> > > boot partition.
> > > This is at least how it works on my laptop (Dell).
> >
> > but HOW can I do it? :)
> > I can see nothing in man acpi, etc...
>
> It has nothing to do with acpi, look at boot0cfg.
>
> I assume you have a suspend partition?
>
> Please give me more details, then I might be able to help you.
>
here it is.
I suppose I must have suspend partition to suspend to disk. Ok, i have such one (partition, not slice, yeah?)
I suppose I have to play with boot0cfg to change boot partition (something like point to resume partition in rc.suspend and point to usual root partition in rc.resume)
But how cat I told acpi to suspend to particular partition?
Thank you

Randy Bush

unread,
Jan 17, 2004, 8:57:06 PM1/17/04
to
thinkpad t40p
-current as of 2004.01.16 19:56 gmt

>> nor so i. for example, my laptop seems to suspend with -s3. but
>> closing the lid, which suspends it in winxp, does not suspend it,
>> only dims the screen.
> sysctl hw.acpi.lid_switch_state=S3

well, this had been working for some days.

now suspend of any form locks it up solid
o i shut bluetooth down
o i am in a console vty
o either
- lid, or
- acpictl -s3
just licks the box up solid

randy

0 new messages