Hibernation issue

  • Thread starter Thread starter asd
  • Start date Start date
A

asd

Hi!

We want to create a system with the hibernation feature but without
keyboard (touchscreen).
Now to my question: If there is some kind of failure and system
restarts, I get the menu
* Delete Hib-File
* Continue booting

But I don't have a keyboard to select an item of that, and the system
waits forever. Is there any solution to overcome this, e.g. a Timer,
selecting a default item after a given time?

Thanks in advance,
Tom
 
Hi,

I can't remember that I saw this option :-(
Please make a feature request if you don't find any other solution.
http://msdn.microsoft.com/embedded/community/community/feedback/feedxp/default.aspx


Also check SP2 Tech Preview ntldr it should have some new features regarding hibernation/resume that you might be able to use to
workaround this problem.
You have hibernate once resume many function. During resume even if error occur hibernation file should remain intact.

Regards,
Slobodan
PS:
Let us know if you find something.
 
I don't have much to add to Slobodan's reply but just some ideas...

I have seen that ntldr message when I was playing around the XP/SP1 hibernation feature and the hiber file.
That time I got an impression that beside checking for the resume flag the ntldr also does a binary check (e.g., CRC) on the
hiberfil.sys to verify if the file has been damaged or not (makes sense since one can change the file offline).

Unfortunately, the ntldr is not componentized. The loader is basically not skinnable and it is hard (legally not possible) to remove
its UI.
So if you really need to change the hiberfil.sys every time you boot the system (and therefore potentially can break the file), only
doable workaround to avoid that message would probably be in writing your own boot sector code that does the CRC check on the
hiberfil.sys and deletes it if not passed the check. Such code is not hard to write (especially if the file system is FAT).

Things may have been changed in XP/SP2 (XPe/SP2) as MS did some changes in the ntldr (mostly undocumented).

Regards,
KM
 
Hi Konstantin,

I wanted to write this in first reply but I did not wanted to scare asd :-)
Fortunately things are pretty simple to resolve this issue and we discussed them already :-)
http://groups.google.com/groups?q=g...=1&[email protected]

Case 1: hibernation file is damaged. ntldr treat this equally as if hiber file did not existed. No message warnings and just boot.
Case 2: Screen that you describe. This happens during the first resume when ntldr changes first four bytes of hibernation file
trough int 13 to indicate for next time that boot was unsuccessful.
Please note that rest of hibernation file is intact.

When ntldr complete resume and kernel take over then trough drivers OS will zero beginning of hiber file and make it useless when
ntld boot next time. (this can be prevented by EWF as described)

So MS to make feature hibernate once resume many times probably had to modify new ntldr behavior so it does not change first four
bytes if some special value is written there during the hibernation.

Basically you can try to use this behavior as I mentioned in previous email. Or read trough long thread and find out how to make
boot code that will filter out int 13 write request.

Regards,
Slobodan
 
Slobodan,

Oh, you are right. I forgot about zero'ing first 512 bytes of the hiberfil.sys by the kernel. :-)

However, I think the message Tom saw was not about the "properly destroyed" hiberfil.sys file (512 bytes are zero) but because it
got damaged. Althgouh in any case there is possible some UI ntldr expects which there is no control over.

Konstantin

PS. I know hy MS has changed ntldr. basically the hack I did with the ntldr that time was exactly for that purpose - preventing
changeing the HIBER flag. But I was hoping MS had some other changes. Who knows :-)
 
Is this a start of a new long thread :P

Anyhow to my knowledge there are two vital states that NTLDR recognizes.
1. First part of hiberfile is damaged.
2. First part of hiberfile is OK.

In case one there are no questions and OS boot normally.
In case two we have two subcases:
a. first four bytes are HIBR
b. first four bytes are WAKE

In case a. OS will resume without questions.
In case b. ntldr will tell you that OS was not booted in previous attempt and ask you what to do whether to do regular boot
(invalidate hibr file) or to try resuming again.

In case 1 there is no point of resuming OS that ntldr detected to have damaged hibernation file since it certainly would not work,
so why bother user with that case and asking him if he want to try resuming from damaged hibernation file.

Regards,
Slobodan
 
Slobodan,
Is this a start of a new long thread :P

I guess not. I can unlikely support this disccussion becuase of my lack of knowledge of the XP hibernate feature :-(
Anyhow to my knowledge there are two vital states that NTLDR recognizes.
1. First part of hiberfile is damaged.
2. First part of hiberfile is OK.

There are some more cases that may be irrelevant to this thread. For example, when the hiberfil.sys file on the system boot
partition is just a text file that uses linkmulti notations to the actual binary hiberfil.sys on another partition.
In case one there are no questions and OS boot normally.

Since I don't recall it exactly I might be wrong. But I think what I saw in some cases was that sometimes OS (ntldr) does not boot
if hiberfil was damanaged but pops up the menu Tom mentioned earlier.
Unfortunately I don't have a dual boot machine right now to test it. So I will do that Monday.
In case two we have two subcases:
a. first four bytes are HIBR
b. first four bytes are WAKE

In case a. OS will resume without questions.
In case b. ntldr will tell you that OS was not booted in previous attempt and ask you what to do whether to do regular boot
(invalidate hibr file) or to try resuming again.

In case 1 there is no point of resuming OS that ntldr detected to have damaged hibernation file since it certainly would not work,
so why bother user with that case and asking him if he want to try resuming from damaged hibernation file.

It may not want to detele the damaged hiberfil.sys file without asking user confirmation.

Btw, another menu of the ntldr you can see if you press F8 while resuming. This is, of course, irrelevant to Toms problems but since
it may be the menu I saw (and hence I am wrong with all this discussion :-) ). The reason I mention it here is that I am sure I saw
that menu without F8 when I was playing with the hiberfil binary.

Regards,
Konstantin
 
Konstantin,
I guess not. I can unlikely support this disccussion becuase of my lack of knowledge of the XP hibernate feature :-(

I guess that hibernation was long time ago for both of us :(
Anyhow Tom should try it since he is already playing with hibernation and could let us know.

Regards,
Slobodan
 
Back
Top