Booting at the last state

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Booting at the last state

Post by Jeko »

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
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Booting at the last state

Post by Brendan »

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.
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Re: Booting at the last state

Post by Jeko »

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
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Booting at the last state

Post by Brendan »

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.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Booting at the last state

Post by AJ »

@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
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Re: Booting at the last state

Post by Jeko »

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
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Re: Booting at the last state

Post by salil_bhagurkar »

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...
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Booting at the last state

Post by AJ »

Hi,

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

Cheers,
Adam
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Re: Booting at the last state

Post by JackScott »

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.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Booting at the last state

Post by AJ »

JackScott wrote:...which I did in an effort to save some space needed for grabbing files at a LAN party...
[-X
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Booting at the last state

Post by Troy Martin »

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
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Booting at the last state

Post by Love4Boobies »

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 ]
tetsujin
Posts: 14
Joined: Mon Aug 11, 2008 10:49 am
Location: Massachusetts
Contact:

Re: Booting at the last state

Post by tetsujin »

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...
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Booting at the last state

Post by PatrickV »

some one told me that hidernation can cause your hard drive to screw up. Plus the up side it loads the os much faster
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Booting at the last state

Post by Love4Boobies »

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 ]
Post Reply