CN104503859A - Method for monitoring computer operating system in starting process - Google Patents
Method for monitoring computer operating system in starting process Download PDFInfo
- Publication number
- CN104503859A CN104503859A CN201410834749.6A CN201410834749A CN104503859A CN 104503859 A CN104503859 A CN 104503859A CN 201410834749 A CN201410834749 A CN 201410834749A CN 104503859 A CN104503859 A CN 104503859A
- Authority
- CN
- China
- Prior art keywords
- dog
- code
- interrupt
- timer
- hardware
- 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.)
- Pending
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method for monitoring a computer operating system in the system starting process without increasing hardware cost or influencing system starting time. The method comprises the following steps of (1) after the system is powered on and started, opening real-tine interruption, and pre-loading an interruption module code of the system and a dog feeding scheme code in the system starting process as an emergency loading part into the system; (2) executing the dog feeding scheme code in the emergency loading part, and completing dog feeding by periodically triggering the real-tine interruption with an appointed timer by means of the opened real-time interruption; (3) appointing a counter in a dog feeding function to judge whether system start is overtime or not, and if the system start is overtime, not feeding dog and reloading by using a hardware watchdog rest system; (4) after the start is completed, relieving the appointed timer in a system task, and submitting a hardware watchdog to software of the system for arrangement. The method can solve the problem that the system start fails because the dog cannot be fed in the system starting process.
Description
Technical field
The present invention relates to a kind of method for supervising of computer operating system, particularly the method for supervising of a kind of embedded computer operating system in start-up course.
Background technology
Usually; by in the microcomputer system that single-chip microcomputer is formed; work due to single-chip microcomputer usually can be subject to the interference from external electromagnetic field; the race of program is caused to fly; and be absorbed in endless loop; the normal operation of program is interrupted; cannot be worked on by monolithic processor controlled system; whole system can be caused to be absorbed in dead state; there is unpredictable consequence; so for consideration single-chip microcomputer running status being carried out to Real-Time Monitoring, just create a kind of chip being specifically designed to monitoring Single Chip Microcomputer (SCM) program running status, be commonly called as " house dog " (English title watchdog).
House dog divides hardware watchdog and software watchdog.Hardware watchdog utilizes a timer circuit, its timing output is connected to the reset terminal of circuit, program resets (being commonly called as " feeding dog ") timer within the scope of certain hour, therefore when program normally works, timer always can not overflow (overflowing for " barking " hereinafter referred to as timer), also just can not produce reset signal.If program malfunctions, the house dog that do not reset in timing cycle (namely to timer reset), just makes WatchDog Timer overflow to produce reset signal to lay equal stress on starting system.The same in software watchdog principle, just the timer internal of the timer purpose processor on hardware circuit is replaced, can hardware circuit design be simplified like this.
In the embedded computer operating system of prior art, usually when system electrification starts, house dog is also just activated, and how " to feed dog " in system start-up loading process, has following several method:
1) in start-up course, " dog is fed ": in the loading code of system starting process, namely add " feeding dog " code, although the method can be avoided in system starting process because house dog " barks " and causes system reset to cause system loads unsuccessful, but inserting more " feeding dog " code in loading code can make system loads code in a jumble various, thus, toggle speed can be caused slow.When operating system is that when not increasing income the operating system of loading code, the method can not use.
2) postpone startup house dog: namely in the start-up course of system, close house dog, after system has started, restart house dog, then manage house dog by software.The method really has certain effect for start-up loading time shorter system, but when operating system makes mistakes (namely operating system loads unsuccessfully) in the process loaded, monitoring and reset cannot be carried out to this operating system because house dog is in closed condition, cause system in case of system halt.In addition, set house dog resource is had no usage, cause waste.
3) in start-up course, hardware " feeds dog ": in the process that system starts, use the hardware watchdog arranged in addition, and task transfers to this hardware watchdog to complete " will to feed dog ".If system has started, then notify that this hardware watchdog " does not feed dog ", the monitoring of operating system has been transferred to the software watchdog management arranged in system, now, hardware " is fed dog " and is kept a specified time, arrives and definites time-lag in advance.If system does not also start successfully just think that system starts unsuccessfully, by this hardware watchdog resetting system.The method both can resolution system problem of " feed dog " in start-up course, this house dog can be made again to play the function for monitoring started system, but it must increase a peripheral hardware (namely described hardware watchdog), and this can increase the cost of system undoubtedly; Meanwhile, for the warm reset of system, reset only may be CPU but not peripheral hardware, cause the soft reboot of system can enter into again in original problem: start-up course cannot " feed dog " cause starting unsuccessfully.
Summary of the invention
The technical problem to be solved in the present invention be to provide a kind of do not increase hardware cost, not influential system start-up time can in system starting process the method for supervisory control comuter operating system.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
The method of supervisory control comuter operating system in start-up course of the present invention, comprises the steps:
1) after system electrification starts, open real-time interrupt, using " feeding dog " in the interrupt module code of system and system starting process, scheme code is loaded previously in system as urgent loading section;
2) in system starting process, perform " feeding dog " the scheme code in described urgent loading section, rely on the real-time interrupt opened, utilize the triggering real-time interrupt of the timer period of specifying to come " feeding dog ";
3) whether this system starts overtime, if time-out, " do not feed dog ", reloaded by this hardware watchdog resetting system in " feeding dog " function, to specify a technology device to judge;
4), after system has normally started, the timer of specifying described in removing in system task, meets at the software administration of system by this hardware watchdog.
Described interrupt module code is loaded into by the compiling of compiler and the link of linker and through booting operating system program and links the operation address of specifying, and this operation address is stored in the storage medium of Memorability.
In the bootup process of booting operating system program, preferential loading interrupt management and the code needing to perform in advance, then carry out initialization and the hardware timer initialization of interrupt management module, and be reset hardware watchdog by the break in service function setup of hardware timer.
Compared with prior art, in resolution system start-up course because cannot feed that house dog causes because barking of house dog causes system to start unsuccessfully, avoid the loading code of change system, realization is simply simultaneously.The method realizes simple, and the block code of house dog separately as a module compiles, can simplify the difficulty of code layout, little to source code dependence, can compile separately; The program, under the prerequisite not increasing hardware, achieves the supervision of house dog to the whole process that system starts, has saved cost to a certain extent.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the inventive method.
Fig. 2 is regular interrupt and real-time interrupt relation schematic diagram in the inventive method.
Embodiment
As shown in Figure 1, the method of supervisory control comuter operating system in start-up course of the present invention adopts to start hardware timer in start-up course, in the break in service function of hardware timer, realize the reset (reading and writing certain hardware register or IO port) of our hardware watchdog, and be all generally that disabled interrupt occurs in traditional OS start-up course.Therefore the difficult point realized and key are just: the start-up course how realizing the whole OS of hardware timer startup and don't the system of destruction in system starting process.First we re-construct our interrupt management module, interruption is divided into real-time interrupt and regular interrupt (as shown in Figure 2), regular interrupt is the interrupt module of traditional OS, and real-time interrupt is then emergency process abort, can interrupt regular interrupt.Whole interrupt management module as shown in Figure 2.Therefore configure hardware timer is real-time interrupt, in start-up course, close regular interrupt master switch and open interruption master switch, hardware timer can be allowed to interrupt producing Interruption, thus realize resetting house dog in timer interruption function, avoid watchdog reset system in start-up course to cause continuous system reboot.Secondly, in the break in service function of hardware watchdog, the number of times of recording reset hardware watchdog, exceed predetermined number of times with regard to the hardware watchdog that no longer resets, this predetermined number of times decides according to system normal load and start-up time, when system is when loading and occur in start-up course surprisingly causing normally starting, causes no longer resetting house dog owing to exceeding the reset house dog number of times of specifying, thus carry out resetting system by hardware watchdog and restart.Again, the run time address that we use real-time interrupt this section of code to be loaded in advance to specify about interrupt management also performs.Code is just becoming real executable code after the compiling of compiler and the link of linker, but what this part executable code was general is stored in the storage medium of Memorability, must be loaded into that link on the run time address of specifying just can true(-)running, and this part work is completed by boot usually.In order to ensure interrupt management module and use the hardware timer code of real-time interrupt to load in advance and to run, this partial code must be configured to the position of specifying when link by script file.Finally, in boot, preferential loading interrupt management and the code (initialization of hardware timer and break in service function) needing to perform in advance, then initialization and the hardware timer initialization of interrupt management module is carried out, and be reset hardware watchdog by the break in service function setup of hardware timer, proceed the loading of system and the startup of system after completing again.After system normally starts, then by the reset work needing monitoring of task to take over house dog.Said method can, in system starting process, not need special hardware to the house dog that resets, and does not need the code of the insertion reset house dog of system code medium time interval more yet, just can realize the supervision of hardware watchdog to system starting process.
Method of the present invention adopts in system starting process, open real-time interrupt (a kind of high-priority interrupt), by the partial codes such as interruption [(are comprised " hello dog " code in system starting process, " feeding dog " code at this place refers to hello the dog in real-time interrupt (timer triggering), should feed dog scheme is exactly a kind of a kind of scheme for lacking monitoring proposition in OS start-up course that we will propose, prior art directly closes house dog, this place we adopt open house dog, a real-time interrupt is adopted to control to feed dog)] load in advance, complete basic urgent loading (initialization of the basic hardware environment that completion system runs and the front operation that must carry out of system cloud gray model like this, this part program controls the state of hardware before system starts) after, just the real-time interrupt of system can be used.Namely the code of " feeding dog " in start-up course relies on the real-time interrupt opened, the real-time interrupt utilizing the fixed intervals of specific timer to trigger has been come " feeding dog ", so just can be implemented in " the feeding dog " in start-up course, because the code promptly loaded also belongs to a system part, therefore this part will inevitably be performed during system reboot, no matter therefore the startup of system is that soft reboot or firmly restart can realize feeding house dog completely; A house dog " hello dog " counter can be set in the break in service function of timer simultaneously, judge system starts whether time-out determines whether continuing " feeding dog " by counting, so just can the startup of surveillance whether normal, play effect of house dog.After system successfully starts, remove timer " hello the dog " action of specifying.
After system electrification starts, using " feeding dog " in the interrupt module code of system and system starting process, scheme code takes the lead in being loaded in system as prestrain part, then " hello dog " scheme code in start-up course is performed, the triggered interrupts of the timer period of specifying is used to come " feeding dog ", in this " hello dog " function, judge whether this system starts overtime by a technology device, if time-out, " do not feed dog ", then cause hardware watchdog resetting system to reload, whether normally start with surveillance.Meanwhile, the normal system started can in start-up course " the feeding dog " in cycle, the system avoiding hardware dog reset to cause starts unsuccessfully.After system normally starts, in system task, remove the timer " feed dog " of specifying, software hardware watchdog being transferred to system manages, so that ensure can not any operation of influential system.As the system reboots, be equivalent to execution again from the beginning to the end, therefore can guarantee normally to start under the supervision of house dog.
Claims (3)
1. the method for supervisory control comuter operating system in start-up course, is characterized in that: comprise the steps:
1) after system electrification starts, open real-time interrupt, using " feeding dog " in the interrupt module code of system and system starting process, scheme code is loaded previously in system as urgent loading section;
2) in system starting process, perform " feeding dog " the scheme code in described urgent loading section, rely on the real-time interrupt opened, utilize the triggering real-time interrupt of the timer period of specifying to come " feeding dog ";
3) whether this system starts overtime, if time-out, " do not feed dog ", reloaded by this hardware watchdog resetting system in " feeding dog " function, to specify a technology device to judge;
4), after system has normally started, the timer of specifying described in removing in system task, meets at the software administration of system by this hardware watchdog.
2. method according to claim 1, it is characterized in that: described interrupt module code is loaded into by the compiling of compiler and the link of linker and through booting operating system program and links the operation address of specifying, and this operation address is stored in the storage medium of Memorability.
3. method according to claim 2, it is characterized in that: in the bootup process of booting operating system program, preferential loading interrupt management and the code needing to perform in advance, then carry out initialization and the hardware timer initialization of interrupt management module, and be reset hardware watchdog by the break in service function setup of hardware timer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410834749.6A CN104503859A (en) | 2014-12-29 | 2014-12-29 | Method for monitoring computer operating system in starting process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410834749.6A CN104503859A (en) | 2014-12-29 | 2014-12-29 | Method for monitoring computer operating system in starting process |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104503859A true CN104503859A (en) | 2015-04-08 |
Family
ID=52945259
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410834749.6A Pending CN104503859A (en) | 2014-12-29 | 2014-12-29 | Method for monitoring computer operating system in starting process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104503859A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105279046A (en) * | 2015-11-04 | 2016-01-27 | 研华科技(中国)有限公司 | Method for improving reliability of embedded system |
CN107463460A (en) * | 2017-08-15 | 2017-12-12 | 深圳科士达科技股份有限公司 | A kind of electric supply system and method for supplying power to based on hardware watchdog |
CN108766346A (en) * | 2018-05-29 | 2018-11-06 | 北京小米移动软件有限公司 | The method and apparatus for protecting screen |
CN111143105A (en) * | 2019-12-31 | 2020-05-12 | 深圳市源拓光电技术有限公司 | Watchdog protection method and system for network pipe type switch |
CN111367702A (en) * | 2020-03-06 | 2020-07-03 | 北京龙鼎源科技股份有限公司 | Multitask software watchdog processing method and device |
CN111443951A (en) * | 2019-01-16 | 2020-07-24 | 大唐移动通信设备有限公司 | System starting method and system starting device |
CN113641524A (en) * | 2021-08-09 | 2021-11-12 | 国家计算机网络与信息安全管理中心 | Reset method, device and equipment for single board starting overtime and readable storage medium |
CN113886123A (en) * | 2021-09-30 | 2022-01-04 | 蜂巢能源科技有限公司 | Watchdog feeding method and device, electronic equipment and storage medium |
CN114924859A (en) * | 2022-05-30 | 2022-08-19 | 苏州浪潮智能科技有限公司 | Program data retention method and device without watchdog interruption and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101196836A (en) * | 2007-12-29 | 2008-06-11 | 上海华为技术有限公司 | Method and device for resetting circuit of watchdog |
CN102169451A (en) * | 2011-04-26 | 2011-08-31 | 中兴通讯股份有限公司 | Method and device for monitoring central processing unit (CPU) operation |
US20110225410A1 (en) * | 2010-03-12 | 2011-09-15 | Hon Hai Precision Industry Co., Ltd. | Electronic device and booting up method |
CN103885847A (en) * | 2014-02-08 | 2014-06-25 | 京信通信系统(中国)有限公司 | Dog feeding method and device based on embedded system |
-
2014
- 2014-12-29 CN CN201410834749.6A patent/CN104503859A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101196836A (en) * | 2007-12-29 | 2008-06-11 | 上海华为技术有限公司 | Method and device for resetting circuit of watchdog |
US20110225410A1 (en) * | 2010-03-12 | 2011-09-15 | Hon Hai Precision Industry Co., Ltd. | Electronic device and booting up method |
CN102169451A (en) * | 2011-04-26 | 2011-08-31 | 中兴通讯股份有限公司 | Method and device for monitoring central processing unit (CPU) operation |
CN103885847A (en) * | 2014-02-08 | 2014-06-25 | 京信通信系统(中国)有限公司 | Dog feeding method and device based on embedded system |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105279046A (en) * | 2015-11-04 | 2016-01-27 | 研华科技(中国)有限公司 | Method for improving reliability of embedded system |
CN107463460A (en) * | 2017-08-15 | 2017-12-12 | 深圳科士达科技股份有限公司 | A kind of electric supply system and method for supplying power to based on hardware watchdog |
CN107463460B (en) * | 2017-08-15 | 2024-01-30 | 深圳科士达科技股份有限公司 | Power supply system and power supply method based on hardware watchdog |
CN108766346A (en) * | 2018-05-29 | 2018-11-06 | 北京小米移动软件有限公司 | The method and apparatus for protecting screen |
CN111443951A (en) * | 2019-01-16 | 2020-07-24 | 大唐移动通信设备有限公司 | System starting method and system starting device |
CN111143105B (en) * | 2019-12-31 | 2023-07-18 | 深圳市源拓光电技术有限公司 | Watchdog protection method and system for network management type switch |
CN111143105A (en) * | 2019-12-31 | 2020-05-12 | 深圳市源拓光电技术有限公司 | Watchdog protection method and system for network pipe type switch |
CN111367702A (en) * | 2020-03-06 | 2020-07-03 | 北京龙鼎源科技股份有限公司 | Multitask software watchdog processing method and device |
CN111367702B (en) * | 2020-03-06 | 2024-03-08 | 北京龙鼎源科技股份有限公司 | Multitasking software watchdog processing method and device |
CN113641524A (en) * | 2021-08-09 | 2021-11-12 | 国家计算机网络与信息安全管理中心 | Reset method, device and equipment for single board starting overtime and readable storage medium |
CN113641524B (en) * | 2021-08-09 | 2024-02-02 | 国家计算机网络与信息安全管理中心 | Reset method, device and equipment for single board starting overtime and readable storage medium |
CN113886123A (en) * | 2021-09-30 | 2022-01-04 | 蜂巢能源科技有限公司 | Watchdog feeding method and device, electronic equipment and storage medium |
CN114924859A (en) * | 2022-05-30 | 2022-08-19 | 苏州浪潮智能科技有限公司 | Program data retention method and device without watchdog interruption and storage medium |
CN114924859B (en) * | 2022-05-30 | 2024-05-17 | 苏州浪潮智能科技有限公司 | Program data retention method, device and storage medium without watchdog interrupt |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104503859A (en) | Method for monitoring computer operating system in starting process | |
CN100568191C (en) | The full-range dog-feeding method of embedded system | |
CN101887393B (en) | Equipment fault reproduction method and system based on para-virtualization technique | |
CN101354677B (en) | Method for detecting and restoring application program running state and restoring device thereof | |
CN103885847A (en) | Dog feeding method and device based on embedded system | |
CN100470479C (en) | Method and apparatus for updating firmware | |
CN101271415B (en) | Monitoring watchdog implementing method of built-in equipment | |
TWI593285B (en) | Smart tv system and turn-off and turn-on method thereof | |
US9612893B2 (en) | Peripheral watchdog timer | |
CN105159719A (en) | Starting method and device of master basic input/output system and slave basic input/output system | |
CN101196836A (en) | Method and device for resetting circuit of watchdog | |
CN101739305A (en) | Operating system kernel level real-time dongle monitoring device and monitoring method thereof | |
CN111796954A (en) | Watchdog control method, device, equipment and storage medium based on JVM | |
WO2022161101A1 (en) | Uboot startup method and apparatus for multi-core system on chip, and device and storage medium | |
CN105468390B (en) | BOOT online upgrading device and method | |
CN104317685A (en) | Starting method of calculator system | |
CN210348469U (en) | Nested watchdog device | |
CN101183317A (en) | Method for real-time interrupting synchronization with multiple progress states | |
CN104679601A (en) | Watchdog starting method of interference preventing system | |
CN109614258A (en) | The control method of the electronic operating system of built-in Linux and its external monitoring module | |
CN107391174B (en) | Control method and control device for online upgrading of system | |
US10198275B2 (en) | Protecting firmware flashing from power operations | |
CN210924552U (en) | Anti-endless loop circuit for chip hardware watchdog function test | |
CN201638201U (en) | Watchdog equipment for embedded system | |
CN101872233B (en) | Automatic on-off schedule control method and system thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150408 |
|
RJ01 | Rejection of invention patent application after publication |