Linux power Management (3) _generic pm reboot process (transferred from the Snail Nest Technology, www.wowotech.net)

Source: Internet
Author: User

Linux power Management (3) _generic pm reboot process 1. Objective

In the process of using a computer, shutting down and restarting is the first two operations learned. Similarly, these two operations exist in Linux, called Shutdown and restart. This is the object to be described in this article.

In the Linux kernel, the mainstream shutdown and restart are implemented by "reboot" system calls (specifically reference KERNEL/SYS.C), which is why this article uses the Generic process of reboot PM as the title. In addition, in addition to our common shutdown and restart operations, this system call also provides other reboot methods, which are explained here.

2. Reboot mode supported by kernel

Perhaps you will wonder, reboot is the meaning of restarting, so it is reasonable to use it to achieve restart, but how to use it to achieve shutdown operation? The answer is this: after the shutdown, sooner or later will be turned on Ah! So the shutdown is a special restart process, but the duration is a bit long. So, depending on the way the kernel behaves, the reboot is divided into the following ways:

* Commands accepted by the _reboot () system call.

* RESTART RESTART system using default command and mode.

* cad_on ctrl-alt-del sequence causes RESTART command.

* Power_off Stop OS and remove all POWER from system, if possible.

* Sw_suspend SUSPEND system using software SUSPEND if compiled in.

#define Linux_reboot_cmd_restart 0x01234567

#define LINUX_REBOOT_CMD_CAD_ON 0x89abcdef

#define Linux_reboot_cmd_power_off 0x4321fedc

#define Linux_reboot_cmd_sw_suspend 0xd000fce2

#define LINUX_REBOOT_CMD_KEXEC 0x4558454

    RESTART, normal restart, is also the restart we normally use. After the action is performed, the system restarts.
    HALT, stops the operating system, and then gives control to other code (if any). The concrete manifestation, depends on the concrete realization of the system.
    Cad_on/cad_off, Allow/ Suppresses the restart (RESTART) action via the Ctrl-alt-del combo key.
    note 1:ctrl-alt-del The response of the combo key is implemented by a specific driver (such as keypad).
    Power_off, normal shutdown. After performing this action, the system stops the operating system and removes all power.
    RESTART2, another way to restart. You can carry a string type of cmd at reboot, which will be sent to any process that cares about the restart event before the restart,,  will also pass to the machine-related code that eventually performs the restart action. The kernel does not specify the form of the CMD, which is defined entirely by the specific machine.
    Sw_suspend, the hibernate operation described in the previous article, is described in the next article and is not covered here.
    KEXEC, restarts and executes the other kernel Image that has been loaded (requires config_kexec support), Not to be covered at this stage.

Linux power Management (3) _generic pm reboot process (transferred from the Snail Nest Technology, www.wowotech.net)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.