BIOS/ACPI question: detecting software reboots of XP

hi

Hopefully there are some knowledgeable BIOS folks who can answer this for me…

(1) When a user does a software reboot of XP (Start -> Shut down… -> Restart) is this something the BIOS can detect? And if so, can they setup a routine to execute something when this happens? (Yes, I do know there are windows power management messages for these events.)

(2) What happens to to the USB controllers and OS drivers when the software reboots? Do they get reset as well?

If a USB device is connected to the XP PC that undergoes the software reboot, does the USB controller on the XP side get powered down? I was curious if the USB device could detect the soft reboot by USB communication stopping.

(I’m not a BIOS person, so excuse if I just asked stupid questions.)

thanks in advance…

For 2), the controller is put into D3. I don’t think a device on the bus can distinguish between a reboot or a machine going into suspend (or just the controller being suspsend and the machine remains in S0)…are you just curious or do you want to do something in the device to detect a reboot that would behave differently vs a suspend?


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Monday, June 05, 2006 5:46 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] BIOS/ACPI question: detecting software reboots of XP

hi
?
Hopefully there are some knowledgeable BIOS folks who can answer this for me…
?
(1) When a user does a software reboot of XP (Start -> Shut down… -> Restart) is this something the BIOS can detect? And if so, can they setup a routine to execute something when this happens? (Yes, I do know there are windows power management messages for these events.)
?
(2) What happens to to the USB controllers and OS drivers when the software reboots? Do they get reset as well?
?
?If a USB device is connected to the XP PC that undergoes the software reboot, does the USB controller on the XP side get powered down? I was curious if the USB device could detect the soft reboot by USB communication stopping.
?
(I’m not a BIOS person, so excuse if I just asked stupid questions.)
?
thanks in advance…
?


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks for the reply and info about #2.

I was wondering about getting the device to reboot itself when xp was soft booted and what the possible approaches there are besides having an app process windows power management messages.

I was wondering if was possible for detection of the soft reboot at the bios/acpi level because I think at that level, if your hardware is designed to support it, you could cycle power to one or more internal devices. For the device’s point of view, it would be then be rebooted regardless of the type of xp boot (software or hard). (This approach assumes that the desired behavior is to have the device reboot whenever xp reboots, either a hard or soft reboot.)

thanks…
----- Original Message -----
From: Doron Holanmailto:xxxxx
To: Windows System Software Devs Interest Listmailto:xxxxx
Sent: Monday, June 05, 2006 7:40 PM
Subject: RE: [ntdev] BIOS/ACPI question: detecting software reboots of XP

For 2), the controller is put into D3. I don’t think a device on the bus can distinguish between a reboot or a machine going into suspend (or just the controller being suspsend and the machine remains in S0)…are you just curious or do you want to do something in the device to detect a reboot that would behave differently vs a suspend?

________________________________________
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Monday, June 05, 2006 5:46 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] BIOS/ACPI question: detecting software reboots of XP

hi

Hopefully there are some knowledgeable BIOS folks who can answer this for me…

(1) When a user does a software reboot of XP (Start -> Shut down… -> Restart) is this something the BIOS can detect? And if so, can they setup a routine to execute something when this happens? (Yes, I do know there are windows power management messages for these events.)

(2) What happens to to the USB controllers and OS drivers when the software reboots? Do they get reset as well?

If a USB device is connected to the XP PC that undergoes the software reboot, does the USB controller on the XP side get powered down? I was curious if the USB device could detect the soft reboot by USB communication stopping.

(I’m not a BIOS person, so excuse if I just asked stupid questions.)

thanks in advance…


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256http:

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServerhttp:


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256http:

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServerhttp:</http:></http:></http:></http:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

When Windows does a reboot, it first sets the BIOS “magic number” to 0x1234, then typicaly does a keyboard controller reboot. As a result the BIOS knows that it doesn’t need to do a complete memory initialization, and can possibly shorten the device initialization.

I don’t know how long this magic cookie lasts during the reboot. I think the BIOS leaves the value there so the OS can tell iti is being warm booted. I have some very vague memories that the HAL will eventualy clear this value before completing startup; but I could be misremembering that.

However, this won’t do a driver much good on power down, since while some HALs will set this value more than once on a shutdown/reboot, all of the drivers are shut down long before this value gets set.

I think I’d be inclined to register the driver for system power state transitions and look for the reboot flag.

Loren

>(1) When a user does a software reboot of XP (Start -> Shut down… ->
Restart)

is this something the BIOS can detect?

Yes, some ACPI verb is executed.

(2) What happens to to the USB controllers and OS drivers when the software
reboots? Do they get reset as well?

Depends on their drivers and how do they react on power IRPs.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com