Reputation: 475
Windows 8 and 10 are by default booting with Hiberboot enabled, so when you go to Start->Power->Shutdown, the system actually goes into S4, not S5. I need to be able in some circumstances to force Windows to perform a full boot instead of "wake" from S4, regardless of how it was previously shut down. I tried to force my UEFI BIOS BootMode to always be BOOT_WITH_FULL_CONFIGURATION, but it does not help - Windows still takes the fast boot path.
In the past, it was possible to set the DIAG mode with Simple Boot Flag in the BIOS; that might work for me, but it does not seem like it is still supported in Windows 8/10. Is there some UEFI variable or some other means of communicating to the OS to boot in either full or diagnostic mode?
Upvotes: 1
Views: 374
Reputation: 475
Here is what I did to solve this problem. I register an ExitBootServices event callback, and in that routine I check if the boot mode is BOOT_ON_S4_RESUME. I also check my other internal conditions, so if the system wakes from S4 and I need to force a diagnostic/full boot, I just do gRT->ResetSystem (...). The ExitBootServices event is far enough into the Windows boot process, so a sudden reset at that point makes it scrap the Hiberfil data and do a full boot.
There seems to be no visible adverse effects, such as any error messages - it boots clean after the reset. Visually, the reset happens right after showing a Windows logo, so the user experience should also be okay. I do not know if this method will make it to production code, but I think it was a successful experiment.
Upvotes: 1