CN106933558B - Power supply control method and device - Google Patents
Power supply control method and device Download PDFInfo
- Publication number
- CN106933558B CN106933558B CN201511027941.5A CN201511027941A CN106933558B CN 106933558 B CN106933558 B CN 106933558B CN 201511027941 A CN201511027941 A CN 201511027941A CN 106933558 B CN106933558 B CN 106933558B
- Authority
- CN
- China
- Prior art keywords
- apm
- int15
- shutdown
- processing program
- executing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/442—Shutdown
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
Abstract
The invention is suitable for the field of computer power management and provides a power control method and a power control device, wherein the power control method comprises the following steps: when the basic input/output system BIOS is upgraded to a unified extensible firmware interface UEFI, acquiring an address pointed by an interrupt vector int15 in an interrupt vector table; embedding an APM shutdown processing program in a memory area corresponding to the address pointed by the int 15; when the system is shut down, reading and executing the int15 in the interrupt vector table; by executing the int15, jumping to the address pointed by the int15, and executing an embedded APM shutdown processing program. The invention enables the system to use the ACPI power management module and support the command of the APM. When the APM command responds, the ACPI is controlled to realize the APM command, and the method has the advantages that on one hand, response efficiency and system availability are improved, and on the other hand, the control requirement of a computer on a power supply is met.
Description
Technical Field
The invention belongs to the field of computer power management, and particularly relates to a power control method and device.
Background
There are two types of Advanced Power Management on computers, namely Advanced Power Management (APM) and Advanced Configuration and Power Management Interface (ACPI). The BIOS (Basic Input Output System) uses APM, and the UEFI (Unified Extensible Firmware Interface) uses ACPI. In addition, APM is a relatively laggard power management, which is nearly eliminated at present, and only some specific industries are still in use. ACPI is the advanced power management currently in use, and has outstanding performance, so many computers upgrade the BIOS of the motherboard to UEFI in order to improve performance.
However, when the BIOS is upgraded to the UEFI, ACPI and the APM in the UEFI are incompatible, and the UEFI cannot support the APM to execute the shutdown action, which reduces the intelligence of the power control and is difficult to meet the control requirement of the computer on the power. The reason for this is that some industry operating systems still use a relatively late version kernel, and when the BIOS of the motherboard is upgraded to UEFI, the machine motherboard will no longer support APM power management, and all commands related to power management fail, such as power off. If the measure of upgrading the system is adopted to solve the problem, the consumed resources are huge, and the configuration of some systems or application programs needs to be reset and changed, backup data needs to be restored and the like, so that the control requirement of the computer on the power supply is difficult to meet.
Disclosure of Invention
The embodiment of the invention aims to provide a power control method, and aims to solve the problems that when a BIOS is upgraded to UEFI, ACPI and APM in the UEFI are incompatible, and the UEFI cannot support the APM to execute shutdown actions.
The embodiment of the invention is realized in such a way that a power supply control method comprises the following steps:
when the basic input/output system BIOS is upgraded to a unified extensible firmware interface UEFI, acquiring an address pointed by an interrupt vector int15 in an interrupt vector table;
embedding an APM shutdown processing program in a memory area corresponding to the address pointed by the int 15;
when the system is shut down, reading and executing the int15 in the interrupt vector table;
by executing the int15, jumping to the address pointed by the int15, and executing an embedded APM shutdown processing program.
Another object of an embodiment of the present invention is to provide a power control apparatus, including:
the address acquisition module is used for acquiring an address pointed by an interrupt vector int15 in an interrupt vector table when the basic input/output system BIOS is upgraded to a unified extensible firmware interface UEFI;
an APM shutdown processing program embedding module, configured to embed an APM shutdown processing program in a memory area corresponding to the address pointed to by the int 15;
an int15 executing module, configured to, when the system is shutdown, read and execute the int15 in the interrupt vector table;
and the APM shutdown processing program execution module is used for jumping to the address pointed by the int15 by executing the int15 and executing the embedded APM shutdown processing program.
In the embodiment of the invention, by executing int15, jumping to the address pointed by int15 and executing the embedded APM shutdown processing program, the problem that when the BIOS is upgraded to UEFI, ACPI and APM in the UEFI are incompatible and the UEFI cannot support the APM to execute shutdown action is solved. On the premise of normal use of a computer, the system can use an ACPI power management module and also can support an APM command, when the APM command needs to respond, the APM command is realized by controlling the ACPI, and the method has the advantages that on one hand, the response efficiency and the system availability are improved, and on the other hand, the control requirement of the computer on the power supply is met.
Drawings
Fig. 1 is a flowchart of an implementation of a power control method according to an embodiment of the present invention;
fig. 2 is a flowchart of implementing step S102 of the power control method provided in the embodiment of the present invention;
FIG. 3 is a flowchart illustrating a power control method step S103 according to an embodiment of the present invention;
fig. 4 is a block diagram of a power supply control device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example one
Fig. 1 is a flowchart of an implementation of a power control method according to an embodiment of the present invention, which is detailed as follows:
in step S101, when the BIOS is upgraded to the unified extensible firmware interface UEFI, an address pointed by the interrupt vector int15 is obtained in the interrupt vector table;
in step S102, an advanced power management APM shutdown processing program is embedded in the memory area corresponding to the address pointed to by the int 15;
step S102, specifically:
detecting whether a system shutdown event is triggered;
when the system shutdown event is triggered, the int15 is read and executed in the interrupt vector table.
In step S103, when the system is shut down, in the interrupt vector table, the int15 is read and executed;
in step S104, by executing the int15, jump to the address pointed by the int15, and execute the embedded APM shutdown processing program.
In the embodiment of the invention, the ACPI is utilized to support the APM, the configuration of some systems or application programs does not need to be reset and changed, and when the APM command responds, the ACPI is controlled to realize the APM command.
Example two
The embodiment of the invention describes the implementation process of a command written into APM power management, which is detailed as follows:
and embedding an APM shutdown processing program in a memory area corresponding to the address pointed by the int15 by writing an APM power management command.
EXAMPLE III
Fig. 2 is a flowchart of an implementation of an embedded APM shutdown processing program according to an embodiment of the present invention, which is detailed as follows:
in step S201, an address bit after PMbase shifts by 5 bits is obtained;
in step S202, in the memory area corresponding to the address pointed by the int15, by writing 3C in the acquired address bit, an APM shutdown processing program is embedded;
wherein 3C is a hexadecimal numerical value;
the PMbase is the starting address of the ACPI.
Example four
The embodiment of the invention describes an implementation process for configuring a shutdown preprocessing program, which is detailed as follows:
and a shutdown preprocessing program is configured, so that the file is prevented from being damaged due to abnormal termination of the current application program.
The shutdown preprocessing program comprises the following processing contents:
closing a sleep button signal;
reading 1byte data from a bus interface PCI configuration space register, and resetting and writing a power control bit 0;
clearing the state identification bit recorded by the GPE [31:0] of the power adapter;
judging whether a system clock alarms the RTC Alarm function, if so, performing control operation of starting up at fixed time;
clearing the reset state Initialization flag bit in the DRAM of the computer memory;
clearing all Activity events;
clearing all management information structure SMI zone bits;
clear the throttle control bit in PMBase, i.e., SLP _ SMI _ EN bit.
EXAMPLE five
Fig. 3 is a flowchart of implementing step S103 of the power control method according to the embodiment of the present invention, which is detailed as follows:
in step S301, when the system is shut down, the shutdown preprocessing routine is executed;
in step S302, after the shutdown preprocessing program is executed, the int15 is read and executed in the interrupt vector table.
EXAMPLE six
Fig. 4 is a block diagram of a power control apparatus according to an embodiment of the present invention, which can be operated in a computer with advanced power management. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 4, the power control apparatus includes:
the address acquisition module is used for acquiring an address pointed by an interrupt vector int15 in an interrupt vector table when the basic input/output system BIOS is upgraded to a unified extensible firmware interface UEFI;
an APM shutdown processing program embedding module, configured to embed an APM shutdown processing program in a memory area corresponding to the address pointed to by the int 15;
an int15 executing module, configured to, when the system is shutdown, read and execute the int15 in the interrupt vector table;
and the APM shutdown processing program execution module is used for jumping to the address pointed by the int15 by executing the int15 and executing the embedded APM shutdown processing program.
As an implementation manner of this embodiment, in the power control device, the APM shutdown processing program embedding module is configured to embed an APM shutdown processing program in a memory area corresponding to the address pointed by the int15 by writing a command for APM power management.
As an implementation manner of this embodiment, in the power control apparatus, the APM shutdown processing program embedding module includes:
the address bit acquisition unit is used for acquiring an address bit after PMbase shifts by 5 bits;
an APM shutdown processing program embedding unit, configured to embed an APM shutdown processing program in a memory area corresponding to the address pointed to by the int15 by writing 3C in the obtained address bit;
wherein 3C is a hexadecimal numerical value;
the PMbase is the starting address of the ACPI.
As an implementation manner of this embodiment, in the power supply control device, the power supply control device further includes:
and the configuration shutdown preprocessing module is used for configuring a shutdown preprocessing program and avoiding the file damage caused by the abnormal ending of the current application program.
As an implementation manner of this embodiment, in the power control apparatus, the int15 executes modules including:
the shutdown preprocessing program execution unit is used for executing the shutdown preprocessing program when the system is shut down;
and an int15 execution unit, configured to read and execute the int15 in the interrupt vector table after the shutdown preprocessing program is executed.
The apparatus provided in the embodiment of the present invention may be applied to the corresponding method embodiments, and for details, reference is made to the description of the embodiments above, and details are not repeated here.
In the embodiment of the present invention, in the memory area corresponding to the address pointed by int15, an advanced power management APM shutdown handler is embedded, and the APM shutdown handler is configured to respond to and process an APM command, so when the BIOS is upgraded to UEFI, the UEFI can respond to and process the APM command through the APM shutdown handler in int15, so that the computer can respond to the APM command simultaneously when using the ACPI power management module, and thus the present invention can obtain the technical effects that ACPI and APM in the UEFI are compatible, and the UEFI supports the APM to execute a shutdown action.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention can be implemented by software plus necessary general hardware. The program may be stored in a readable storage medium, such as a random access memory, a flash memory, a read only memory, a programmable read only memory, an electrically erasable programmable memory, a register, and the like. The storage medium is located in a memory, and a processor reads information in the memory and performs the method according to the embodiments of the present invention in combination with hardware thereof.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (8)
1. A power supply control method, comprising:
when the basic input/output system BIOS is upgraded to a unified extensible firmware interface UEFI, acquiring an address pointed by an interrupt vector int15 in an interrupt vector table;
embedding an APM shutdown processing program in a memory area corresponding to the address pointed by the int 15;
when the system is shut down, reading and executing the int15 in the interrupt vector table;
jumping to the address pointed by the int15 by executing the int15, and executing an embedded APM shutdown processing program;
the embedding of an APM shutdown processing program in the memory area corresponding to the address pointed by the int15 by writing an APM power management command specifically includes:
acquiring an address bit after PMbase shifts by 5 bits;
in a memory area corresponding to the address pointed by the int15, by writing 3C in the acquired address bit, embedding an APM shutdown processing program;
wherein 3C is a hexadecimal numerical value;
the PMbase is the starting address of the ACPI.
2. The power control method according to claim 1, wherein an APM shutdown processing program is embedded in the memory area corresponding to the address pointed to by the int15, and specifically includes:
and embedding an APM shutdown processing program in a memory area corresponding to the address pointed by the int15 by writing an APM power management command.
3. The power supply control method according to claim 1, wherein before reading and executing the int15 in the interrupt vector table at the time of system shutdown, the power supply control method further comprises:
and a shutdown preprocessing program is configured, so that the file is prevented from being damaged due to abnormal termination of the current application program.
4. The power control method according to claim 3, wherein when the system is shut down, the int15 is read and executed in the interrupt vector table, specifically:
when the system is shut down, executing the shutdown preprocessing program;
after the shutdown preprocessing program is executed, reading and executing the int15 in the interrupt vector table.
5. A power supply control device, comprising:
the address acquisition module is used for acquiring an address pointed by an interrupt vector int15 in an interrupt vector table when the basic input/output system BIOS is upgraded to a unified extensible firmware interface UEFI;
an APM shutdown processing program embedding module, configured to embed an APM shutdown processing program in a memory area corresponding to the address pointed to by the int 15;
an int15 executing module, configured to, when the system is shutdown, read and execute the int15 in the interrupt vector table;
an APM shutdown processing program execution module, configured to jump to an address pointed by the int15 by executing the int15, and execute an embedded APM shutdown processing program;
the APM shutdown processing program embedded module comprises:
the address bit acquisition unit is used for acquiring an address bit after PMbase shifts by 5 bits;
an APM shutdown processing program embedding unit, configured to embed an APM shutdown processing program in a memory area corresponding to the address pointed to by the int15 by writing 3C in the obtained address bit;
wherein 3C is a hexadecimal numerical value;
the PMbase is the starting address of the ACPI.
6. The power control apparatus according to claim 5, wherein the APM shutdown processing program embedding module is configured to embed the APM shutdown processing program in the memory area corresponding to the address pointed to by the int15 by writing a command for APM power management.
7. The power supply control device according to claim 5, further comprising:
and the configuration shutdown preprocessing module is used for configuring a shutdown preprocessing program and avoiding the file damage caused by the abnormal ending of the current application program.
8. The power control apparatus of claim 7, wherein the int15 executes modules comprising:
the shutdown preprocessing program execution unit is used for executing the shutdown preprocessing program when the system is shut down;
and an int15 execution unit, configured to read and execute the int15 in the interrupt vector table after the shutdown preprocessing program is executed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201511027941.5A CN106933558B (en) | 2015-12-31 | 2015-12-31 | Power supply control method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201511027941.5A CN106933558B (en) | 2015-12-31 | 2015-12-31 | Power supply control method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN106933558A CN106933558A (en) | 2017-07-07 |
| CN106933558B true CN106933558B (en) | 2021-08-13 |
Family
ID=59441879
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201511027941.5A Active CN106933558B (en) | 2015-12-31 | 2015-12-31 | Power supply control method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106933558B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107861790B (en) * | 2017-10-27 | 2020-05-15 | 新华三云计算技术有限公司 | Virtual machine disk space expansion method and device, host machine and readable storage medium |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6360327B1 (en) * | 1999-03-12 | 2002-03-19 | Compaq Information Technologies Group, L.P. | System with control registers for managing computer legacy peripheral devices using an advanced configuration power interface software power management system |
| US20030018892A1 (en) * | 2001-07-19 | 2003-01-23 | Jose Tello | Computer with a modified north bridge, security engine and smart card having a secure boot capability and method for secure booting a computer |
| CN101650647A (en) * | 2008-08-12 | 2010-02-17 | 武汉卓华软件有限责任公司 | Compatibility method for EFI platform |
| TWI643130B (en) * | 2013-09-12 | 2018-12-01 | 系微股份有限公司 | SYSTEM AND METHOD FOR AUTO-ENROLLING OPTION ROMs IN A UEFI SECURE BOOT DATABASE |
| CN104460925A (en) * | 2014-12-18 | 2015-03-25 | 山东超越数控电子有限公司 | Power management implementation method based on ShenWei platform |
-
2015
- 2015-12-31 CN CN201511027941.5A patent/CN106933558B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN106933558A (en) | 2017-07-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10387261B2 (en) | System and method to capture stored data following system crash | |
| US8468389B2 (en) | Firmware recovery system and method of baseboard management controller of computing device | |
| US11526411B2 (en) | System and method for improving detection and capture of a host system catastrophic failure | |
| JP6530774B2 (en) | Hardware failure recovery system | |
| US9158628B2 (en) | Bios failover update with service processor having direct serial peripheral interface (SPI) access | |
| CN102789305B (en) | Postpone hang | |
| CN103207797B (en) | Capsule type customized updating method based on universal extensible firmware interface firmware system | |
| US8219851B2 (en) | System RAS protection for UMA style memory | |
| US11977744B2 (en) | Memory anomaly processing method and system, electronic device, and storage medium | |
| US9229729B2 (en) | Initializing processor cores in a multiprocessor system | |
| JP2004295885A (en) | Computer system permitting dynamic reallocation of main memory | |
| US20190004818A1 (en) | Method of UEFI Shell for Supporting Power Saving Mode and Computer System thereof | |
| CN102799497A (en) | Data recovery system and method for non-volatile random access memory (NVRAM) | |
| CN101937344B (en) | Computer and method for quickly starting same | |
| US9239742B2 (en) | Embedded systems and methods for threads and buffer management thereof | |
| CN105739666B (en) | Conversion method for reducing power consumption and arithmetic device thereof | |
| US20120102358A1 (en) | Server having memory dump function and memory dump acquisition method | |
| CN103257922B (en) | A kind of method of quick test BIOS and OS interface code reliability | |
| US20160179626A1 (en) | Computer system, adaptable hibernation control module and control method thereof | |
| CN106933558B (en) | Power supply control method and device | |
| CN121166177A (en) | Firmware upgrading method, equipment and storage medium of baseboard management controller | |
| US20120185713A1 (en) | Server, storage medium, and method for controlling sleep and wakeup function of the server | |
| US20040098527A1 (en) | Method and apparatus for an I/O controller to alert an external system management controller | |
| KR101100894B1 (en) | Error detection and recovery method for embedded devices | |
| JP2006338445A (en) | Abnormal information storage device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20230717 Address after: 518000 1701, Yanxiang Science and Technology Building, No. 31, High-tech Middle 4th Road, Maling Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong Province Patentee after: Shenzhen Yanxiang Smart Technology Co.,Ltd. Address before: 518057 floor 5, No. 1, chuangxiang place, Yanxiang Zhigu, No. 11, Gaoxin Road, Guangming New Area, Shenzhen, Guangdong Patentee before: EVOC INTELLIGENT TECHNOLOGY Co.,Ltd. |
|
| TR01 | Transfer of patent right |