In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >
Share
Shulou(Shulou.com)11/24 Report--
Two days ago, while browsing moments, the editor saw a screenshot of a conversation with customer service posted by a friend:
What an Amazing! Although the editor has heard that rebooting is different from turning it off before, when the computer jumps out of the pop-up window that "needs to be rebooted", I still choose to "restart later", then turn it off after using the computer, and turn it on the next time I use it, as a restart.
The editor naively thought at that time that he had not interrupted the ongoing work and completed the restart, which could be said to have maximized the efficiency.
Today, after witnessing the different results of the two ways, the editor is determined to explore:
What is the difference between "restart" and "turn it off"?
From a qualitative point of view, when we click "restart", the computer will automatically log out the user, shut down the system, reopen and load the system, and the host seems to have paused, but not completely shut down.
If you choose to turn it off and turn it on again, not only will the host be completely shut down, but we also have to manually press the power button on the host to turn the system on again.
Therefore, from the means of operation, shutdown and reboot need to press the button one more time than restart; from the process experienced by the host, shutdown and reboot experience more than restart. Emmm, seems to have said some nonsense.
However, through the different states of the host, we should be able to feel that there must be a difference between the two.
What unknown secrets are hidden behind the host that has not been completely shut down?
02. From a quantitative point of view, if you want to dig deep into the secrets behind the computer restart, you need to know what happened during the restart process.
First of all, let's take a look at what the operating system uses to distinguish between restarting and shutting down and rebooting. Here we will introduce a concept-Advanced configuration Power Management Interface (Advanced Configuration and Power Interface), or ACPI.
ACPI is an open standard for operating system power management and hardware configuration, which was jointly proposed and developed by many companies in 1997.
The overall frame diagram of ACPI believes that you must have a very big head when you see the above picture, because the editor himself is the same (dog head).
But today we are not going to dig deep into ACPI, but to see how ACPI determines the restart of the computer.
The ACPI specification defines that an ACPI-compliant computer system can have the following seven states (so-called global states):
G0 (S0): normal working state. The normal working state of the computer-both the operating system and applications are running.
G1: sleep. This state can also be subdivided into the following categories:
(1) S0ix:Modern Standby. In this state of sleep, computers can be connected to the Internet, music can be played, and most of the rest of the apps are paused. You can log in to your account and go to work at the touch of any key.
(2) S1: a sleep pattern that consumes more power. All registers in CPU are refreshed and instructions are stopped, but power to CPU and memory is maintained.
(3) S2: a deeper sleep state than S1 that shuts down the power supply to CPU. This mode is not usually used.
(4) S3: called Suspend to RAM, abbreviated as STR. This mode is the common "sleep" on our computers.
(5) S4: called Suspend to Disk, which is also what we often call "dormancy". The difference between S4 and S3 is that S4 takes longer, and if the system is powered off at this time, the data that is not saved in S3 will be lost, but it will not be affected in S4.
G2 (S5): called Soft Off. This state is similar to the G3 (S6) described below, but in this state, the system can still be awakened by some devices (such as keyboards, etc.).
G3 (S6): called Mechanical Off. All parts are powered off in this state, and you need to press the power button again to wake up.
Although it seems that we have never mentioned reboot, from several states of the computer under the ACPI specification, we can see its different operation mode and wake-up mode, which is related to the restart we will talk about soon.
In fact, you may not expect, restart is also divided into many types, and we usually come into contact with the most common restart, called hard reset, which through the signal to inform all chips, peripheral network cards, and so on together for reset operation, so that most of the system registers reset to the default value (default), and then CPU starts from reset vector to execute the program.
In this process, the system will not be completely power-off, will not enter the state of G3 (S6), CPU with the assistance of other components to execute reset-related procedures.
In the process of shutting down and then booting, the system will completely cut off the power supply, that is, enter the state of G3 (S6), so that all registers return to the initial state, the whole process will need to execute more programs, and the speed will be slower.
03. How to choose between restart and shutdown and reboot? We choose to restart the computer, which may be due to a software update or a system update, or a problem with a part of the system (like the problem encountered in the screenshot at the beginning).
In general, if the system wants us to restart, just restart as required. Because the computer needs to reload the configuration file because it is updated in the software or system, the restart will be more targeted and efficient.
When some of the functions of the computer are blocked, because restart can not guarantee that all registers will return to the default state, it will lead to restart and may not solve the problem, so it is necessary to try to solve the problem by shutting down.
At this point, the editor can't help sighing that the computer system is really too huge, and there are such rich knowledge points hidden behind a small operation. I sincerely admire the bosses in the field of computer research and learn from you!
references
[1] Advanced configuration and power interface-Wikipedia
[2] what is the principle of computer restart? -Zhihu
[3] Sindre G, Conradi R, Karlsson E A. The REBOOT approach to software reuse [J]. Journal of Systems and Software, 1995, 30 (3): 20112.
This article comes from the official account of Wechat: Institute of Physics, Chinese Academy of Sciences (ID:cas-iop), author: Eric
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.