Yet another approach to software suspend
Posted Jul 20, 2007 8:36 UTC (Fri) by
khim (subscriber, #9252)
In reply to:
Yet another approach to software suspend by i3839
Parent article:
Yet another approach to software suspend
So at "resume" time, the machine just booted up, more or less, and the first kernel that's loaded can be the final one.
Are you an idiot or just play one on TV ? When the kernel boots it detects all devices anew. The structures will be put in different place in memory, modules will be loaded in different order, etc. A lot of userspace-visible changes. So you must either move all kernel structures in proper positions (it's just 100 times harder then to implement any other hibernate scheme because 99% of kernel code are not ready to see movable structures) or you should fix all userspace programs which interact with kernel in any (i.e. essentially all userspace programs: if the program stores it's own PID somewhere and this PID is used by some kernel-level process in new kernel you are screwed, for example).
Thus the only sensible way to implement wake-up is to restore old kernel in the same state - and after that you need some way to return to that restored kernel. From the perspective of this restored kernel currently active kernel was kexec'ed (even if it's totally different kernel in reality)... Thus you need a way to jump from the secondary kernel back into the original kernel. Hibernate without wake-up is not very useful, really...
(
Log in to post comments)