CN107943259B - Power failure reset method and device based on VxWorks system - Google Patents

Power failure reset method and device based on VxWorks system Download PDF

Info

Publication number
CN107943259B
CN107943259B CN201610892762.6A CN201610892762A CN107943259B CN 107943259 B CN107943259 B CN 107943259B CN 201610892762 A CN201610892762 A CN 201610892762A CN 107943259 B CN107943259 B CN 107943259B
Authority
CN
China
Prior art keywords
cpu
function
hardware circuits
reset
operating system
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.)
Expired - Fee Related
Application number
CN201610892762.6A
Other languages
Chinese (zh)
Other versions
CN107943259A (en
Inventor
赵建立
和艳丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Potevio Information Technology Co Ltd
Original Assignee
Potevio Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Potevio Information Technology Co Ltd filed Critical Potevio Information Technology Co Ltd
Priority to CN201610892762.6A priority Critical patent/CN107943259B/en
Publication of CN107943259A publication Critical patent/CN107943259A/en
Application granted granted Critical
Publication of CN107943259B publication Critical patent/CN107943259B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means

Abstract

The invention relates to a power failure reset method and a device based on a VxWorks system, wherein the method comprises the following steps: when the program of an operating system is abnormal, all hardware circuits of a CPU minimum system in the operating system are powered down; and if the power-down time of the hardware circuit reaches a preset time period, all the hardware circuits with power down are electrified, so that the time sequences of the reset CPU in the CPU minimum system and all the reset hardware circuits are consistent. The method can ensure that the reset time sequence and the power-on reset time sequence of all chips of the CPU minimum system are consistent, and realize the normal starting of the VxWorks operating system.

Description

Power failure reset method and device based on VxWorks system
Technical Field
The invention relates to a communication technology, in particular to a power failure reset method and a power failure reset device based on a VxWorks system.
Background
The VxWorks operating system is an embedded real-time operating system designed by Windriver company, can provide good reliability and excellent real-time performance, and is widely applied to the fields with extremely high requirements on high-precision technology and real-time performance, such as communication, military, aviation, aerospace and the like.
In an embedded board card of the VxWorks operating system, a CPU and some peripheral circuits of the CPU form a CPU minimum system, and the CPU minimum system comprises a network card, a serial port, an internal memory, a FLASH chip and the like.
In the VxWorks operating system, if the software abnormity such as program run-off, memory boundary crossing and the like causes the reset of a CPU, the reset is a reboot function of the operating system, after the reboot is executed, the CPU is reset, and after the CPU is reset and restarted, the peripheral circuit of the CPU is controlled to reset.
At present, a CPU (central processing unit) calls a reboot reset due to program exception in a VxWorks operating system, only the CPU can be reset, peripheral circuits connected with the CPU, such as a network card, a switching chip, a clock chip, a DDR (double data rate) chip and the like, cannot be reset simultaneously, when the CPU is reset and started, the peripheral circuits are reset again, the reset time sequence and the power-on reset time sequence of all chips of a minimum system of the CPU cannot be kept consistent, and hardware exception is triggered sometimes to cause the system to be started abnormally.
Disclosure of Invention
Aiming at the defects, the invention provides a power-down reset method and a power-down reset device based on a VxWorks system, which can ensure that the reset time sequence of all chips of a CPU minimum system is consistent with the power-on reset time sequence, and realize the normal start of the VxWorks operating system.
In a first aspect, the power failure reset method based on the VxWorks system provided by the invention comprises the following steps:
when the program of an operating system is abnormal, all hardware circuits of a CPU minimum system in the operating system are powered down;
and if the power-down time of the hardware circuit reaches a preset time period, all the hardware circuits with power down are electrified, so that the time sequences of the reset CPU in the CPU minimum system and all the reset hardware circuits are consistent.
Optionally, before the step of powering down all hardware circuits of the CPU minimal system in the operating system, the method further includes:
the CPU is reset.
Optionally, the CPU minimal system comprises: a CPU in an embedded board card of an operating system and a peripheral circuit of the CPU.
Optionally, the peripheral circuitry of the CPU includes one or more of:
the device comprises a network card, a switching chip, a clock chip, a DDR chip and a FLASH chip.
Optionally, the preset time period is determined according to the time required by the CPU reset.
Optionally, resetting the CPU includes:
and the operating system calls a rebot function to reset the CPU.
Optionally, powering down all hardware circuits of the CPU minimal system in the operating system, including:
calling the FUNCA function by the reboot function to power down all hardware circuits of the CPU minimum system in the operating system;
the FUNCA function is a hook function which is hung on a reboot function called when the CPU is abnormally reset through a system function rebootHooded in advance, and has the function of powering down all hardware circuits of a CPU minimum system in the operating system.
Optionally, powering on all hardware circuits powered down includes:
calling the FUNCA function by the reboot function to power on all hardware circuits with power failure;
the FUNCA function is a hook function which is hung on a reboot function called when the CPU is abnormally reset through a system function rebootHooded in advance, and has a function of electrifying all hardware circuits of a CPU minimum system in the operating system.
In a second aspect, the present invention provides a power failure reset device based on a VxWorks system, including:
the power-down module is used for powering down all hardware circuits of a CPU minimum system in an operating system when a program of the operating system is abnormal;
the judging module is used for judging whether the power-down time of a hardware circuit in the power-down module reaches a preset time period;
and the power-on module is used for powering on all the hardware circuits with power failure when the judging module determines that the power failure time of the hardware circuits reaches a preset time period, so that the time sequences of the reset CPU in the CPU minimum system and all the reset hardware circuits are consistent.
In a third aspect, the present invention provides an operating system comprising any of the apparatus described above.
According to the technical scheme, when the program of the operation system is abnormal, all hardware circuits of the CPU minimum system can be powered off for the preset time period, and then the power is supplied, so that the consistency of the reset CPU in the CPU minimum system and the time sequence of all hardware circuits is ensured, and the normal starting of the VxWorks operation system is realized.
Drawings
The characteristic information and advantages of the invention will be more clearly understood by reference to the accompanying drawings, which are schematic and should not be understood as imposing any limitation on the invention, in which:
fig. 1 is a flowchart of a power failure reset method based on a VxWorks system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a power failure reset device based on a VxWorks system according to an embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited by the specific embodiments disclosed below.
The invention relates to the technical field of embedded systems, in particular to a method for automatically calling a rebot function by an operating system when a CPU (central processing unit) based on a VxWorks system is abnormally reset, and at the moment, the peripheral circuit of the whole CPU including the CPU is powered off and then powered on again. And ensuring the complete power-down reset of the minimum system of the CPU.
As shown in fig. 1, fig. 1 is a schematic flow chart of a power failure reset method based on a VxWorks system according to an embodiment of the present invention, where the method includes the following steps:
101. and when the program of the operating system is abnormal, powering down all hardware circuits of a CPU minimum system in the operating system.
For example, the CPU minimum system mentioned in this step may include: a CPU in an embedded board card of an operating system and a peripheral circuit of the CPU.
In addition, the peripheral circuit of the CPU in the present embodiment may include one or more of the following: the device comprises a network card, a switching chip, a clock chip, a FLASH chip and a DDR chip.
It should be noted that the program exception of the operating system may be understood as any program exception of the current operating system, and the present embodiment is not particularly limited to the user program exception running on the CPU, and includes both the user program and the program of the vxWorks operating system itself.
102. And if the power-down time of the hardware circuit reaches a preset time period, all the hardware circuits with power down are electrified, so that the time sequences of the reset CPU in the CPU minimum system and all the reset hardware circuits are consistent.
Specifically, before the step of powering down all hardware circuits of the CPU minimal system in the operating system, the method further includes:
the CPU is reset. For example, the operating system may call a rebot function to reset the CPU.
It should be noted that the preset time period in the step 102 is determined according to the time required for the CPU to reset.
In practical applications, the step 101 of "powering down all hardware circuits of the CPU minimal system in the operating system" may include:
calling the FUNCA function by the reboot function to power down all hardware circuits of the CPU minimum system in the operating system;
the FUNCA function in this step may be a hook function hooked to a reboot function called when the CPU is abnormally reset through a system function reboothooded, and has a function of powering down all hardware circuits of the CPU minimum system in the operating system.
In addition, the aforementioned "powering on all hardware circuits powered down" in step 102 may include:
calling the FUNCA function by the reboot function to power on all hardware circuits with power failure;
at this time, the FUNCA function here is a hook function hooked to a reboot function called at the time of abnormal reset of the CPU through a system function reboothooded, and has a function of powering on all hardware circuits of the CPU minimum system in the operating system.
That is, in this embodiment, the function FUNCA is pre-defined, and the power-down reset operation for the CPU minimum system is completed in this function.
For example, a system function rebootHooded is hooked on a CPU reset function reboot, a custom FUNCA function is added in the rebootHookAdd function, the reboot function is automatically executed when the CPU is abnormally reset, the FUNCA function is automatically called when the reboot is already hooked with the automatically called FUNCA function, and the FUNCA function completes the power-down reset of the minimum system of the CPU. Namely, the user-defined FUNCA function is hung to the reboot function through the rebootHookAdd function of the system function, and when the reboot is executed, the FUNCA function is automatically called, so that the power-down reset of the CPU minimum system is completed.
Therefore, the method can call the self-defined FUNCA function in a mode of hanging the reboOTHoodAdd to the reboot function, power-down reset is carried out on the CPU minimum system hardware chip, then power-down reset of the CPU minimum system is completed, abnormal starting caused by inconsistent reset time sequences of the minimum system hardware chip is avoided, and normal starting of the system is guaranteed.
In addition, an embodiment of the present invention further provides a power failure reset device based on a VxWorks system, and as shown in fig. 2, the device further includes: a power-down module 21, a judgment module 22 and a power-up module 23;
the power-down module 21 is configured to power down all hardware circuits of a minimum CPU system in an operating system when a program of the operating system is abnormal; for example, calling the FUNCA function powers down all hardware circuits of the CPU minimal system in the operating system;
the judging module 22 is used for judging whether the power-down time of the hardware circuit in the power-down module reaches a preset time period;
the power-on module 23 is configured to power on all the hardware circuits that are powered off when the determining module determines that the power-off time of the hardware circuits reaches the preset time period, for example, the power-on module 23 may call a FUNCA function to power on all the hardware circuits that are powered off; the reset CPU in the CPU minimum system is consistent with the time sequence of all the reset hardware circuits.
Optionally, in other embodiments, the power-down reset apparatus may further include a reset module, not shown in the figure, and the reset module may be configured to reset the CPU before the power-down module powers down all hardware circuits of the CPU minimum system. In practical application, the reset module can call a reboot function to reset the CPU.
The CPU minimum system in this embodiment may include a CPU in an embedded board of an operating system and a peripheral circuit of the CPU.
Specifically, the preset time period is determined according to the time required for the CPU to reset.
It should be noted that the power down reset apparatus of the present embodiment may execute the power down reset method described in any of the foregoing embodiments, and refer to the foregoing description, and the present embodiment is not described in detail herein.
The power failure reset device based on the VxWorks system can ensure that the minimum system of the CPU can be reset in a power failure mode when the CPU is abnormally reset, the time sequence of the minimum system of the CPU is consistent, and the normal starting of an operating system is ensured.
In a third aspect, an embodiment of the present invention further provides an operating system, where the operating system may include the apparatus in any of the above embodiments.
In the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The term "plurality" means two or more unless expressly limited otherwise.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (5)

1. A power failure reset method based on a VxWorks system is characterized by comprising the following steps:
when the program of an operating system is abnormal, all hardware circuits of a CPU minimum system in the operating system are powered down, wherein the CPU minimum system comprises: a CPU in an embedded board card of an operating system and a peripheral circuit of the CPU;
if the power-down time of the hardware circuit reaches a preset time period, all the hardware circuits with power-down are powered on, and the time sequences of the reset CPU in the CPU minimum system and all the reset hardware circuits are consistent;
before the step of powering down all hardware circuits of the CPU minimal system in the operating system, the method further comprises:
resetting the CPU;
wherein, resetting the CPU includes:
the operating system calls a reboot function to reset the CPU;
the powering down all hardware circuits of the minimum CPU system in the operating system includes:
calling the FUNCA function by the reboot function to power down all hardware circuits of the CPU minimum system in the operating system;
the FUNCA function is a hook function which is hung on a reboot function called when the CPU is abnormally reset through a system function reboot Hooded, and has the function of powering down all hardware circuits of a CPU minimum system in the operating system;
the step of powering on all hardware circuits with power failure comprises the following steps:
calling the FUNCA function by the reboot function to power on all hardware circuits with power failure;
the FUNCA function is a hook function which is hung on a reboot function called when the CPU is abnormally reset through a system function rebootHooded, and has the function of electrifying all hardware circuits of a CPU minimum system in the operating system.
2. The method of claim 1, wherein the peripheral circuitry of the CPU comprises one or more of:
the device comprises a network card, a switching chip, a clock chip, a DDR chip and a FLASH chip.
3. The method according to claim 1, wherein the preset time period is determined according to a time required for the CPU to reset.
4. The utility model provides a power down resetting means based on VxWorks system which characterized in that includes:
a power down module, configured to power down all hardware circuits of a CPU minimal system in an operating system when a program of the operating system is abnormal, where the CPU minimal system includes: a CPU in an embedded board card of an operating system and a peripheral circuit of the CPU;
the judging module is used for judging whether the power-down time of a hardware circuit in the power-down module reaches a preset time period;
the power-on module is used for powering on all the hardware circuits with power failure when the judging module determines that the power failure time of the hardware circuits reaches a preset time period, so that the time sequences of the reset CPU in the CPU minimum system and all the reset hardware circuits are consistent;
the power down module is further configured to:
resetting the CPU;
wherein, resetting the CPU includes:
the operating system calls a reboot function to reset the CPU;
the powering down all hardware circuits of the minimum CPU system in the operating system includes:
calling the FUNCA function by the reboot function to power down all hardware circuits of the CPU minimum system in the operating system;
the FUNCA function is a hook function which is hung on a reboot function called when the CPU is abnormally reset through a system function reboot Hooded, and has the function of powering down all hardware circuits of a CPU minimum system in the operating system;
the step of powering on all hardware circuits with power failure comprises the following steps:
calling the FUNCA function by the reboot function to power on all hardware circuits with power failure;
the FUNCA function is a hook function which is hung on a reboot function called when the CPU is abnormally reset through a system function rebootHooded, and has the function of electrifying all hardware circuits of a CPU minimum system in the operating system.
5. An operating system comprising the apparatus of claim 4.
CN201610892762.6A 2016-10-13 2016-10-13 Power failure reset method and device based on VxWorks system Expired - Fee Related CN107943259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610892762.6A CN107943259B (en) 2016-10-13 2016-10-13 Power failure reset method and device based on VxWorks system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610892762.6A CN107943259B (en) 2016-10-13 2016-10-13 Power failure reset method and device based on VxWorks system

Publications (2)

Publication Number Publication Date
CN107943259A CN107943259A (en) 2018-04-20
CN107943259B true CN107943259B (en) 2020-12-25

Family

ID=61928321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610892762.6A Expired - Fee Related CN107943259B (en) 2016-10-13 2016-10-13 Power failure reset method and device based on VxWorks system

Country Status (1)

Country Link
CN (1) CN107943259B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361368A (en) * 2018-12-14 2019-02-19 无锡思泰迪半导体有限公司 A kind of filter and its control method of the integrated comparator with reset function

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0017201D0 (en) * 2000-07-14 2000-08-30 Ibm Generalised program hooks
CN1549542B (en) * 2003-05-15 2011-08-10 中兴通讯股份有限公司 Digital communication system resetting apparatus and method
CN1949773A (en) * 2006-10-25 2007-04-18 华为技术有限公司 Method for starting network communication apparatus and device thereof
CN101615031B (en) * 2009-05-07 2011-05-04 浙江中控自动化仪表有限公司 Failure detection circuit of embedded dual processor system
US9183111B2 (en) * 2011-05-10 2015-11-10 Microsoft Technology Licensing, Llc Methods and computer program products for collecting storage resource performance data using file system hooks
CN102707782A (en) * 2012-05-15 2012-10-03 江苏中科梦兰电子科技有限公司 Multi-core central processing unit (CPU) based computer mainboard reset system and method
CN103984610B (en) * 2014-06-11 2017-02-15 武汉邮电科学研究院 FPGA (Field Programmable Gate Array) based power failure protection system and method
CN104503799A (en) * 2014-12-29 2015-04-08 长园深瑞继保自动化有限公司 Method for performing uninterrupted control over peripherals in system starting process

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
A local checkpoint mechanism for on-board computing;Chengye Zhang、Shenglan Deng、Hong Ning;《2012 IEEE International Conference on Information Science and Technology》;20120621;全文 *

Also Published As

Publication number Publication date
CN107943259A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
US9367446B2 (en) Computer system and data recovery method for a computer system having an embedded controller
CN102455950A (en) Firmware recovery system and method of base board management controller
US8909952B2 (en) Power supply apparatus of computer system and method for controlling power sequence thereof
CN110442386A (en) A kind of BMC starting method, system, electronic equipment and computer storage medium
CN110716633B (en) Device and method for coordinately managing SSD power consumption, computer device and storage medium
CN104572226A (en) Method and device for detecting mainboard starting abnormity
WO2020155591A1 (en) Method and device for real time synchronization of bios and bmc power-off policy, terminal and storage medium
US20140201577A1 (en) Management device, management method, and medium storing management program
US20130166896A1 (en) Management system for network card
CN111124508A (en) Method and device for adjusting PXE (PCI extensions for instrumentation) starting sequence of network card
CN109067416A (en) A kind of method and Intelligent hardware for realizing SIM card hot plug and starting
CN107943259B (en) Power failure reset method and device based on VxWorks system
JP6254303B2 (en) User identification module protocol switching
US20140181496A1 (en) Method, Apparatus and Processor for Reading Bios
JP6583942B1 (en) BMC, determination method and BMC firmware
CN115421859B (en) Dynamic loading method and device for configuration file, computer equipment and storage medium
CN107179911B (en) Method and equipment for restarting management engine
TWI483125B (en) Baseboard management controller recovery system and using method of the same
CN111580445B (en) Electrical equipment operation switching method and device, electronic equipment and storage medium
WO2019027612A1 (en) Managing surprise hot plug in low power state
CN109298892B (en) Device and method for controlling startup and shutdown of server
CN110389643B (en) Server and remote control method thereof
CN108595193B (en) Firmware updating method of baseboard management controller for fan rotating speed control
CN111104286B (en) Power consumption management method, server, and computer-readable storage medium
CN110740104A (en) switch system startup management method and 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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201225