Jump to content











Photo
- - - - -

Another BSOD 7B challenge


  • Please log in to reply
19 replies to this topic

#1 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 18 April 2011 - 05:40 PM

Hi everyone,

For some time I've been playing with Wimb's great tools, in order to create a small Win7 image that can be booted on most computers (ideally anywhere...).
Note that I'm not trying to do anything exotic for now. All I do is:

  • Install Win7 directly into a 10 Gb VHD container, with WinNTSetup
  • Create a compacted 1.4 Gb VHD with Wimb's VHD_W7_Compact. I'm not even using any of the registry tweaks: I disable them all. I'm not using WinVBlock or FiraDisk: I'm using Win7 native VHD driver.
Also, I'm not trying to boot from USB, nor from a different hardware. The compacted VHD and the original one are both on the same internal HDD, on the same computer.
But from day one, I had this problem whereby the compacted VHD would only boot once. Any subsequent reboot results in a BSOD 7B.

So I started investigating a little bit...
Quickly I figured out that if after booting from the compacted VHD, I mount the image and replace the SYSTEM hive of the offline system with its pre-boot version then I can boot again (but still only once !)
In other words, the boot process is causing some changes in the registry, which prevents any further boot...

I will spare you the details of the million of experiments I carried out. Eventually I got to the point where I noticed that if you create two VHDs in Win7, a 1.4 Gb one and a 10 Gb one, the first partition will by default start respectively at sectors 128 and 2048. Now if I :

  • Create a 10Gb VHD, with the same signature as Wimb's compacted VHD.
  • Copy all the contents of the compacted VHD into this fresh, 10 Gb VHD.
  • Adjust the MountedDevices entry of the new, 10 Gb VHD, to account for the different partition offset (see first regshot comparison, where shot A is 1.4 Gb VHD and shot B is 10 Gb VHD: Attached File  Report before boot.html   4.15KB   676 downloads)
then the 10 Gb VHD will boot as many times as I want...
Therefore, it looks like there is something else than the key MountedDevices ought to be changed....

Now, if I boot my compacted VHD and shut-down, boot the equivalent 10 Gb VHD and shut-down, then compare the SYSTEM hives of the offline system, I get this second regshot result: Attached File  Report after boot.html   23.46KB   1183 downloads

I can only see one very suspicious thing, but can't really explain it:
the registry key for the boot volume (created by the initial install in 10 Gb VHD), is deleted when the compacted VHD is booted (shot A), but no new registry key is created instead (for the new boot volume, since the partition offset is different). Why ? Also, if this is not critical to boot once, why would it become critical for subsequent boots ?

Anyone has any ideas what really happens ? What ought to be done to fix the problem ?
Also why am I apparently the only one to have this problem ? (presumably Wimb has successfully used relatively small images, say 2 Gb, with 128 sectors offset to the first partition)

#2 davlak

davlak

    Frequent Member

  • Advanced user
  • 224 posts
  •  
    Italy

Posted 18 April 2011 - 06:31 PM

I had this problem whereby the compacted VHD would only boot once. Any subsequent reboot results in a BSOD 7B.

I have had the same issue, the only difference is that I've not tried to boot the compact VHD on HDD, but only on USB HD. and believed the usb was the problem.
can this help?
I'm sorry because I cannot make experiments, due to my lack of time this period, hope to be useful asap.

#3 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 18 April 2011 - 07:23 PM

Also, I'm not trying to boot from USB, nor from a different hardware. The compacted VHD and the original one are both on the same internal HDD, on the same computer.

I wonder: it's timing again?
Did you try waitbt driver?

#4 davlak

davlak

    Frequent Member

  • Advanced user
  • 224 posts
  •  
    Italy

Posted 18 April 2011 - 07:38 PM

I wonder: it's timing again?
Did you try waitbt driver?

in my case, i've installed waitbt on usb vhd using IMG_XP 3.1, with no success.
I've used 3 different usb disks, WD, Hitachi and Seagate, and each of them seems to work right with other filedisk (xp, 2003 and seven not compacted too).

#5 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 18 April 2011 - 07:51 PM

I wonder: it's timing again?
Did you try waitbt driver?

Well, everyday I learn a bit more, so I wouldn't swear... But this time I can't see how this would be timing....
Why would timing be OK on the first boot, but not OK on subsequent reboot ? Furthermore there is no USB involved, and everything is used in the way it is supposed to be used (e.g. we're not trying to use USB drivers which were not originally designed with booting from USB in mind).

I know I am not the only one who had this kind of issues.... But all other people seemed to be trying to boot from USB. Most of them also seemed to have fixed it with PWBoot. But this is not relevant here.... Or is it ?

#6 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 18 April 2011 - 09:32 PM

Why would timing be OK on the first boot, but not OK on subsequent reboot ?

Warning, pure fiction:
At first boot generic low priority settings are used to boot.
Hardware/VHD relating settings are generated and stored to registry.
Results are stored in high priority settings.
(ENUM and other: high priotity, CriticalDeviceDatabase: low priority)
This takes some time. Timing works by CHANCE, no BSOD.

At second boot hardware/VHD relating settings exist already, no need to generate them.
Booting is a split of a second faster, however something not working so far: BSOD.

Furthermore there is no USB involved

The million dollar question: is timing issue related to USB only?

have fixed it with PWBoot.

Which settings does set PWBoot?

#7 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 18 April 2011 - 09:46 PM

At second boot hardware/VHD relating settings exist already, no need to generate them.
Booting is a split of a second faster, however something not working so far: BSOD.

That makes sense. But in practise, if you compare the registry of the problematic system before and after boot (attached), I can't see anything of the sort.... Can you have a detailed look ?

The million dollar question: is timing issue related to USB only?

I think everyone in their right mind would say no :-)

Which settings does set PWBoot?

I didn't have time to investigate into details, but it looks like PWBoot is not doing anything original.... It just sets the USB drivers to boot start, and modifies the corresponding INF file in window/INF so that settings are not changed.

Attached Files



#8 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 18 April 2011 - 10:07 PM

compare the registry of the problematic system before and after boot

I suspect

New keys (2) for shot B
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}\##?#STORAGE#Volume#{fa3dc93f-5767-11e0-a884-806e6f6e6963}#0000000000010000#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}]

At first boot something is detected and stored. Both take some time.
A STORAGE\Volume entry is added to registry. This takes some time: first boot does work.
At following boot this entry exist already, no need to detect and store them, no booting delay: BSOD 0x7b timing issue

Once again: that's a guess only.

#9 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 18 April 2011 - 11:14 PM

And what happens if you empty out HKLM\SYSTEM\MountedDevices\ of its values right before shutting down from your first boot?

#10 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 19 April 2011 - 08:06 AM

At first boot something is detected and stored. Both take some time.
A STORAGE\Volume entry is added to registry. This takes some time: first boot does work.
At following boot this entry exist already, no need to detect and store them, no booting delay: BSOD 0x7b timing issue

Once again: that's a guess only.

That is a very sensible explanation. Your guesses often prove not too far from the truth :smiling9:
I have carried out another experiment which suggests it's something to do with volumes, or mounted devices.
Once I have booted my 1.4 Gb VHD once, and turned it off, if I copy the SYSTEM hive in the 10 Gb VHD then this one will happily keep booting forever.
If I copy the SYSTEM hive back into the 1.4 Gb VHD I get a BSOD. Probably because the registry has kept a trace of the boot volume, detected on very first boot.

Although I understand the mechanisms, whereby the ##?#STORAGE#Volume# entry is created on first boot, so that timing is slightly different, what I don't understand though, is why the same mechanism doesn't have the same consequences for a 10 Gb VHD ? Everything is exactly the same, except two things: the VHD size, and the offset to the first partition (128 sectors a.k.a. 00,00,01 in the registry, and 2048 sectors, a.k.a. 00,00,10 in the registry)

Also, aside from the fact that the number of system files has been reduced to a minimum, what we're trying to do is nothing exceptional: we're just cloning one system from a source VHD to a destination VHD (of a different size/geometry). The destination ought to boot more than once.

And what happens if you empty out HKLM\SYSTEM\MountedDevices\ of its values right before shutting down from your first boot?

This is a very simple option that I haven't tried... I won't be able to try it in the next few hours but it's definitely worth giving it a go !
All the MountedDevices entries are deleted before the first boot (by Wimb's tools), but I didn't think of deleting them again after the first boot....

#11 link0808987654

link0808987654

    Newbie

  • Members
  • 18 posts
  •  
    Ukraine

Posted 19 April 2011 - 11:27 AM

Try modifying not only c:\windows\system32\config\system, but also c:\windows\system32\config\system.sav

#12 maanu

maanu

    Gold Member

  • Advanced user
  • 1134 posts
  •  
    Pakistan

Posted 19 April 2011 - 07:24 PM

may be it is little offtopic , but anywhow i ll post my experiment .

1.installed win7 ULTIMATE sp0 on 10GB VHD
2.installed winvblock.
3.booted in normal 7
4.make a 1.2GB compact VHD img. (enable waitBT too )
5.booted the img from USB and HDD as RAM-LOADED and FILEDISK , no BSOD.
6.booted the same img as FILEDISK on computers at office today from USB , no BSOD.

hope it helps.

#13 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 19 April 2011 - 09:16 PM

Right, I'm not really getting any closer to understanding the problem, let alone solving it. I have tried to delete

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}\##?#STORAGE#Volume#{fa3dc93f-5767-11e0-a884-806e6f6e6963}#0000000000010000#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}]

and also all the MountedDevices entries (except DosDevices\C:). Still BSOD 7B. Yet, amongst all the differences before and after boot in post #7, one has to be critical.... But then which one ? Any guess anyone ?

#14 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 19 April 2011 - 09:47 PM

why the same mechanism doesn't have the same consequences for a 10 Gb VHD ? Everything is exactly the same, except two things: the VHD size, and the offset to the first partition (128 sectors a.k.a. 00,00,01 in the registry, and 2048 sectors, a.k.a. 00,00,10 in the registry)

A different sized file cause different access strokes at hard disk.
And OS cache may be importand. Both result to different timing.

Compacting 1.4 Gb VHD deletes files.
Does this delete boot services too?
Does deleted boot services change overall timing?

Change driver load order, ideas:
set usb?hci group to "System Reserved"
This loads usb drivers early and changes overall timing.
This may avoid 0x7B at internal booting too.

or http://www.911cd.net...showtopic=22618

The image loads two drivers:
"Boot Bus Extender" vdrvroot.sys
"SCSI miniport" vhdmp.sys

Try another group for vdrvroot and vhdmp.

Delete MountedDevices DosDevices\C: too.

#15 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 19 April 2011 - 09:48 PM

Out of desperation, there is something I want to try:
I have this 10 Gb VHD which boots fine over and over. Thanks to Wimb's tools, only 1 Gb is used.
Now if I create a 1.4 Gb VHD, with the same signature and with the first partition starting at the same offset of 2048 sectors, then I should be able to copy all the files and boot, hopefully, more than once ?
The only question is: how do I get the first partition to start at sector 2048 instead of 128 (which seems to be Win7's default for a 1.4 Gb VHD) ?

#16 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 20 April 2011 - 03:02 AM

...you empty out HKLM\SYSTEM\MountedDevices\ of its values...

I have tried to delete...and also all the MountedDevices entries (except DosDevices\C:).

Delete MountedDevices DosDevices\C: too.

What're the results?

#17 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 20 April 2011 - 07:53 AM

What're the results?

Sorry for the late reply.... After another BSOD 7B, I decided it was time to call it a day and get some sleep :smiling9:
So as you may have guessed, that didn't work either...

#18 Doodoo

Doodoo

    Frequent Member

  • Advanced user
  • 345 posts

Posted 21 April 2011 - 09:05 PM

Out of desperation, there is something I want to try:
I have this 10 Gb VHD which boots fine over and over. Thanks to Wimb's tools, only 1 Gb is used.
Now if I create a 1.4 Gb VHD, with the same signature and with the first partition starting at the same offset of 2048 sectors, then I should be able to copy all the files and boot, hopefully, more than once ?

I did try this.... In effect, the resulting 1.4 Gb is totally identical to the 1.4 Gb directly created by Wimb's tools, except the offset to the first partition is 2048 sectors (same as the source 10 Gb VHD) instead of the default 128 sectors for a VHD of that size.
And you know what ? It works !!! It boots over and over again.:cheers:

I still don't understand why, is it really timing, and eventually a matter of luck ? Or something that is genuinely predictable, and therefore can be garanteed to work all the time ?
Anyway I'm off on holidays for 10 days now... So you guys will have time to experiment and meditate :lol:

#19 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 22 April 2011 - 10:31 AM

And you know what ? It works !!! It boots over and over again.:)

VERY GOOD :cheers:

That means that the offset given in MountedDevices,is probably present at more places in the registry.
We have to search for occurrences of the offset.

:cheers:

#20 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 22 April 2011 - 10:34 AM

Earth Day :)

http://en.wikipedia.org/wiki/Earth_Day

:cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users