关闭电脑需要按住电源按钮多长时间?
How long do you need to hold down the power button to turn off a PC?

原始链接: https://www.osnews.com/story/146273/how-long-do-you-need-to-hold-down-the-power-button-to-turn-off-a-pc/

雷蒙德·陈描述了按住 PC 电源按钮 12 秒会强制硬件级关机而不通知操作系统,而 Windows 在 8 秒后进行内核转储并稍后上传到 Windows 错误报告。作者感到困惑,因为大多数 PC 在约 4–5 秒后就关机,使得这类转储似乎很少见。ATX 电源按钮行为由主板微控制器处理,因此时序各异;作者想知道 ATX 规范是否建议 12 秒,或者 Windows 是否根据硬件调整转储时序。陈确认这些“长按电源按钮”转储确实会出现,包括一个由专门团队分析的“黑屏”子类型。确切解释仍部分未解。

帖子讨论按住 PC 电源按钮多久。链接的文章/Chen 笔记表明 Windows 在按住 8 秒后创建内核转储并发送给 Microsoft。评论者争论更长按压(如 12 秒)是否仅在操作系统无响应时适用。硬件细节占主导:ACPI 规定 4 秒电源按钮覆盖,而 Intel PCH 设置允许 4–14 秒;许多系统需要 3–8 秒,部分笔记本/Surface 需要更久。现代笔记本的嵌入式控制器处理硬关机,但它们可能锁死;部分设备有电池重置小孔。用户报告主板、Mac 和笔记本的时长各不相同。总体而言,关机时长取决于硬件且可配置,Windows 也会为长按生成诊断信息。
相关文章

原文

Raymond Chen published another story from the Windows development trenches, this time about what happens when you hold down the power button.

If you hold a PC’s power button for 12 seconds, it will turn off at the hardware level without notifying the operating system. This is a safety feature so that you can turn of the computer even if the operating system’s “Shut down” command isn’t working.

After eight seconds of the power button being held down, the Windows kernel realizes that the user is trying to do a force-power-off of the system, and it quickly takes a kernel dump that can be uploaded to the Windows Error Reporting service the next time you turn the system on.

↫ Raymond Chen

I’m a bit confused by these numbers, because I have never seen a PC take this long to power off when holding down the power button; usually it takes only a few seconds to do so, meaning Windows would never generate said kernel dump. I tried reading through the various ATX specification documents to find more information on this, but then I remembered I’m not an electrical engineer so I have no idea what I’m looking at.

The baseline is that ATX always provides standby power to the motherboard, and pressing the power button shorts the power button pin to ground, telling the PSU to power on fully. Pressing the power button if the computer is running tells the operating system to initiate a shutdown (although you can change this behaviour), but if you hold the button down for a certain number of seconds, it forces a power-off. So far, so good; basic information.

It seems that the length of time you need to hold down the power button to force a power-off is dependent on the motherboard in question, handled by a microcontroller or some other IC. Virtually every source I can find says this timing is set to about 4-5 seconds, which is quite a bit shorter than the number of seconds given by Chen. Perhaps motherboard manufacturers consider the 12 seconds to be too long, and just do their own thing, regardless what the ATX specification suggests?

What further complicates matters is that Chen details how the kernel dumps created after pressing the power button for 8 seconds do, in fact, get sent to Microsoft once the computer turns on again. In fact, he is one of the people who gets to see these dumps and respond to them, so obviously they are indeed rolling in. Does this mean there’s a huge number of computers out there that require you to hold down the power button for 12 seconds to force a shutdown that nobody’s ever seen?

These emergency kernel dumps are internally classified as “long power button hold” (LPBH) failures. One of the pieces of information recorded in these emergency kernel dumps is whether the screen consists entirely of black pixels. Those failures are sub-classified as “black screen LPBH”, and they go to a special virtual team for analysis. (I happen to be a member of this black screen LPBH team.)

↫ Raymond Chen

What’s going on here? Obviously, I’m not going to doubt Chen, so there must be something here I don’t quite understand or that I’m missing. The ATX specification might suggest 12 seconds, but could Windows perhaps adapt its kernel dump behaviour – dumping much sooner than 8 seconds – based on the motherboard it’s running on, maybe through information provided by the chipset drivers?

I would love it if someone more knowledgeable than me can help us unravel this small mystery.

联系我们 contact @ memedata.com