Page 2 of 2
Re: Booting at the last state
Posted: Wed Sep 24, 2008 7:44 am
by jal
Jeko wrote:What do you think about saving all the RAM memory in a file before the shutdown of the computer and load it in the next boot? With this method you can save the state of your computer, with all the applications running... Is it a stupid idea?
The state of the computer is not just the RAM. There's also devices that need to be taken care off.
JAL
Re: Booting at the last state
Posted: Wed Sep 24, 2008 7:53 am
by Solar
Yep. Your devices have undergone a power cycle, and might need some setup (firmware loading etc.) so their previous state is recovered (if that is possible).
You'd also want to think about security. I consider it a really bad idea to have a computer come out of hibernation directly onto the previous user's desktop - the person waking up the computer might not be the same as the one that hibernated it. And whatever happened to any open network sessions...
Re: Booting at the last state
Posted: Wed Oct 08, 2008 2:41 am
by mystran
Solar wrote:Yep. Your devices have undergone a power cycle, and might need some setup (firmware loading etc.) so their previous state is recovered (if that is possible).
You'd also want to think about security. I consider it a really bad idea to have a computer come out of hibernation directly onto the previous user's desktop - the person waking up the computer might not be the same as the one that hibernated it. And whatever happened to any open network sessions...
Obviously drivers need to know you just came up from hibernate, but ignoring that...
1: lock the desktop on resume, and you're solved the security problem.. you can allow multiple parallel desktop sessions like modern Windows, so you can't even claim that'll cause any problems.
2: any network connection will inevitably have to deal with losing the connection anyway, and power-cycling isn't in any way special.. in fact, with protocols like TCP, you might not even (strictly) need to make the protocol stack aware of hibernates.. it'll timeout the old connections and recover normally anyway.
Re: Booting at the last state
Posted: Wed Oct 08, 2008 2:44 am
by mystran
Oh, I wanna add.. there are research systems like EROS that can boot into the previous state even when they lost power without anyone telling 'em in advance. The basic idea IIRC is to keep the whole state of the system transactional, and constantly save changes to disk upon IPC, such that when you lose power, you just recover the last known state kinda like a database would do.
Re: Booting at the last state
Posted: Wed Oct 08, 2008 4:22 am
by Candy
For that last item I disagree.
Making the entire OS transactional is a too large overhead for a feature as this. You can assume that a user work station will not power fail without advance notice, or that if it does the user will tolerate a longer bootup time.
The scenarios I see are:
- Laptop power fail - you're informed in advance, so you can save & turn off in time
- UPS power fail - same as laptop
- Mains unplug / physical loss of power without backup - user knows that the system has been compromised in its integrity and will expect you to recover. The file system should always remain usable, but if you lose 10 seconds of work (or something) that should be quite acceptable.
A few personal opinions:
- All programs should autosave reliably & quickly enough for you to not notice.
- All programs should keep their state the same when you shut down & restart them. Firefox does this if you have 2 or more tabs (in a question - just always do it), Notepad++ always does it, Word never does it.
- The file system should take care of versioning and backups. All editing should directly edit a file; if you want to keep the current and new version, make your computer do versioning instead of "remembering to copy the file".
Re: Booting at the last state
Posted: Wed Oct 08, 2008 5:21 am
by mystran
Candy wrote:For that last item I disagree.
You disagree to whether it's a good idea, but I wasn't commenting to that. I was just saying that there exist systems that do it.
edit: oh my.. what a wonderful English I just wrote here. But I'm going to leave it as it is, as a good example of bad grammar.