Subject: Re: SOC project idea
To: Perry E. Metzger <perry@piermont.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-users
Date: 03/08/2007 23:05:01
On Thu, Mar 08, 2007 at 04:59:48PM -0500, Perry E. Metzger wrote:
> 
> Manuel Bouyer <bouyer@antioche.eu.org> writes:
> >> A framework for hibernation is not too large a project.
> >
> > Maybe I'm missing somthing, but to resume from hibernation you'll load
> > the kernel as a normal boot, and then restore state from a large file
> > (or swap, or whatever). Then you need to be able to restore state of various
> > parts of the kernel (sockets, open files, etc ...), which may not be at the
> > same address as at hibernation time, because the kernel has done some work
> > and rebooted in between.
> 
> That's one approach -- taking it to an extreme, one could checkpoint
> all system processes and restart with a completely new kernel. Another
> edge of the design space is to completely restore the (active) system
> memory to the same contents they held just before the hibernate, with
> no need to fix up anything more than one would have to after a deep
> sleep like ACPI S3. I think the former is desirable, but the latter is
> much easier to implement and more practical.

What I don't get with this approach is how you write ram to disk, and
then restore it from disk. You need some software which can do that.
If you use a standalone program to do it you can restore the kernel
in its exact state, but then you need a standalone tool which can talk to
the disk. Or you use the kernel's disk drivers for this, but then this change
the kernel's state (the driver may need to allocate memory for example), and
restoring is tricky: you can't overwrite your currently running program with
a previous state.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--