OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 7:03 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Booting at the last state
PostPosted: Wed Sep 03, 2008 3:18 am 
Offline
Member
Member
User avatar

Joined: Fri Mar 17, 2006 12:00 am
Posts: 500
Location: Napoli, Italy
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?

_________________
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling

http://sourceforge.net/projects/jeko - Jeko Operating System


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Wed Sep 03, 2008 5:03 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

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?


It's called "hibernate"...


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Wed Sep 03, 2008 5:55 am 
Offline
Member
Member
User avatar

Joined: Fri Mar 17, 2006 12:00 am
Posts: 500
Location: Napoli, Italy
Brendan wrote:
Hi,

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?


It's called "hibernate"...


Cheers,

Brendan


Wow! So it's not a stupid idea... :wink:

_________________
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling

http://sourceforge.net/projects/jeko - Jeko Operating System


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Wed Sep 03, 2008 8:43 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

Jeko wrote:
Wow! So it's not a stupid idea... :wink:


Hehe - Microsoft thinks it's a good idea.

I'm not so sure - I think Microsoft likes it because their OS initialization is far too slow, so recycling everything (including most of the OS initialization) from the previous boot speeds it up heaps (and not needing to re-open applications, etc was an accident). :D


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Wed Sep 03, 2008 9:49 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
@OP: Remember that if there is a memory leak or something was about to crash, that will also be carried forward to the next session - unless your OS is "memory leak proof" :D

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Wed Sep 03, 2008 9:51 am 
Offline
Member
Member
User avatar

Joined: Fri Mar 17, 2006 12:00 am
Posts: 500
Location: Napoli, Italy
AJ wrote:
@OP: Remember that if there is a memory leak or something was about to crash, that will also be carried forward to the next session


Yes, you're right. So for Windows the hibernate function isn't a good thing... Windows is about to crash starting from the bootloader

_________________
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling

http://sourceforge.net/projects/jeko - Jeko Operating System


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Thu Sep 04, 2008 11:35 am 
Offline
Member
Member
User avatar

Joined: Mon Feb 19, 2007 10:40 am
Posts: 261
Location: India
Somehow though my hibernate button worked in windows a few years ago, now it has been disabled by windows... Can't find the reason.. Tried reinstalling windows.. I have not changed my hardware also...


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Fri Sep 05, 2008 1:32 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
Hi,

In some versions of windows, you have to specifically enable this. See Control Panel -> Power Options -> Hibernate -> Enable Hibernation.

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Sat Sep 06, 2008 12:27 am 
Offline
Member
Member
User avatar

Joined: Thu Dec 21, 2006 3:03 am
Posts: 1029
Location: Hobart, Australia
I have found that running Disk Cleanup (cleanmgr) and deleting the temporary hibernation file (which I did in an effort to save some space needed for grabbing files at a LAN party) turns off hibernation. Doing what AJ suggests turns it back on again.

_________________
My Personal Blog | My Software Company - Loop Foundry | My Github Page


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Sat Sep 06, 2008 9:13 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
JackScott wrote:
...which I did in an effort to save some space needed for grabbing files at a LAN party...


[-X


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Sat Sep 06, 2008 10:41 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 18, 2008 4:40 pm
Posts: 1686
Location: Langley, Vancouver, BC, Canada
I use hibernate all the time on my laptop since my desktop is messy and vista's time from login to usability is about 3 minutes. And this is a really good computer.

If you have a configuration file designed and a FAT12 (or 16 or 32) driver that can save files, you can write the OS up to save the RAM onto disk, set the config file to "yes, boot from the hiberfile next time please!" and write the bootloader to do the loading!

_________________
Image
Image
Solar wrote:
It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.

I wish I could add more tex


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Tue Sep 23, 2008 1:13 am 
Offline
Member
Member
User avatar

Joined: Fri Mar 07, 2008 5:36 pm
Posts: 2111
Location: Bucharest, Romania
I think it's similar to hibernating, but it can't be done as you describe it. The moment you "hibernate", there may be network connections or devices connected to the PC, applications that have to deal with time, etc. All those could get corrupted. Sure, closing all network connections first could be done. But if you start unmounting devices, closing network devices and even closing applications, we're getting close to normal shut down.

EDIT: think that if you have to unmount a USB drive, you have to close all applications that use that specific USB drive.

_________________
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Tue Sep 23, 2008 3:12 pm 
Offline

Joined: Mon Aug 11, 2008 10:49 am
Posts: 14
Location: Massachusetts
Love4Boobies wrote:
I think it's similar to hibernating, but it can't be done as you describe it. The moment you "hibernate", there may be network connections or devices connected to the PC, applications that have to deal with time, etc. All those could get corrupted. Sure, closing all network connections first could be done. But if you start unmounting devices, closing network devices and even closing applications, we're getting close to normal shut down.

EDIT: think that if you have to unmount a USB drive, you have to close all applications that use that specific USB drive.


Well a lot of those issues apps have to deal with anyway. An app would normally not be put to sleep for three days while running - but under a pre-emptive multi-tasking (non-realtime) OS programs basically have to cope with whatever time slices they get - as well as any delays in between...

The open network connections essentially come back closed after the resume - network apps always need to be prepared for the fundamentally inherent nature of their connection, so if nothing else they should recognize they've lost the link...

As for apps accessing files on a removable drive (or a non-removable drive, for that matter...) - presumably the apps would be shut down before the filesystem is unmounted. How much you do to safeguard those apps from various scenarios (like swapping the drive for another one, etc.) is I guess up to the designer to decide...

_________________
---GEC
Progress means holding on to the good and replacing the bad. Be a fan if you like, but don't let it blind you!
I want to write a truly new command-line OS shell. Design is tough...


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Tue Sep 23, 2008 9:10 pm 
Offline
Member
Member

Joined: Sun Jul 06, 2008 7:50 pm
Posts: 151
Location: New Zealand
some one told me that hidernation can cause your hard drive to screw up. Plus the up side it loads the os much faster


Top
 Profile  
 
 Post subject: Re: Booting at the last state
PostPosted: Tue Sep 23, 2008 11:07 pm 
Offline
Member
Member
User avatar

Joined: Fri Mar 07, 2008 5:36 pm
Posts: 2111
Location: Bucharest, Romania
PatrickV wrote:
some one told me that hidernation can cause your hard drive to screw up.


That's absolutely not true. It's just writing a chunk of data on the hard drive. It's as risky as installing programs or copying files.

_________________
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 107 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group