how grub knows there is a system in suspend/hibernate state ?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how grub knows there is a system in suspend/hibernate state ?
Dear fellows,
How grub knows there is a system in suspend/hibernate state ?
The amazing is it returns to the previous hibernated/suspend system even if it is windows XP, Vista or Linux, in a triple boot machine.
I expected when I turn on my computer again after I have put a system in hibernate mode, the grub menu shows up, then I select a system, let say, Windows XP, and then the system figures out it was in hibernate mode and resumes.
But it is not in this way this things happens. I do not have a chance to select any option in grub's menu. It starts to resume the previous system whatever it was.
How grub knows there is a system in suspend/hibernate state ?
The amazing is it returns to the previous hibernated/suspend system even if it is windows XP, Vista or Linux, in a triple boot machine.
I expected when I turn on my computer again after I have put a system in hibernate mode, the grub menu shows up, then I select a system, let say, Windows XP, and then the system figures out it was in hibernate mode and resumes.
But it is not in this way this things happens. I do not have a chance to select any option in grub's menu. It starts to resume the previous system whatever it was.
How this works ?
Well it's a module in initrd, when init starts it calls the hibernation program, which checks for a saved image, if there is one it loads it.
This is only the algorithm, for more read> http://www.thinkwiki.org/wiki/Softwa...ecreate_initrd
And for the record, a hibernation is a process which saves the content of the ram memory to a static file as an image, so every OS has some image like that. Then it shutdown the computer.
On the other hand the suspend system is a hardware based, it saves the content of the ram and then it tells the bios to switch to another power level - that is suspend.
Last edited by DamjanDimitrioski; 07-26-2009 at 10:02 AM.
Reason: s/safe/saves
thank you, but I think something happens before that controlled by grub.
In a multiple boot system controlled by grub, if a windows system is put to hibernate, grub "knows" it must boot the windows system which resumes from hibernation - and in this case, initrd has nothing to do with this process.
The same is valid if another linux system is put to hibernate; when you turn on your system againgrub "knows" what system it must call to resume.
So I guess the key here is "grub" but I was unable to find any information about how this works on grub documentation....
thank you, but I think something happens before that controlled by grub.
In a multiple boot system controlled by grub, if a windows system is put to hibernate, grub "knows" it must boot the windows system which resumes from hibernation - and in this case, initrd has nothing to do with this process.
The same is valid if another linux system is put to hibernate; when you turn on your system againgrub "knows" what system it must call to resume.
So I guess the key here is "grub" but I was unable to find any information about how this works on grub documentation....
Ok, here is the deal, when you choose to hibernate it disables grub, what ever os disables grub.
Thanks for the link, I checked, but even so, this does not make sense.
Another OS, let say, Windows, does not known anything about grub so it is unlike it could disable it. Think about...
this phrase on the link you provided, DamjanDimitrioski:
Quote:
Originally Posted by http://wiki.debian.org/Grub#FAQ
...GRUB isn't aware that your host is suspended...
is more intriguing. But the question remains, how this work ? If it is not grub, who knows what system must resume ? Than is it the BIOS ? I think this makes sense, specially on the "suspend to ram" case. The BIOS is responsible for resume a system in hibernate mode too ? So the last instruction a system (windows, linux or whatever) does is calling a function on the BIOS (one on those famous interrupts calls) that in fact put a system in hibernate or suspend mode.
I think I will google about any information that could confirm this. This time I will focus on BIOS calls/interrupts.
see'ya,
now the things are more clear in my head. So, grubs does not have anything to do with hibernate/suspend modes - it is the BIOS which is responsible for start up the OS previously in hibernate/suspend mode.
thank you DamjanDimitrioski for the valuables links. I learned a lot too !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.