CN109614258A - The control method of the electronic operating system of built-in Linux and its external monitoring module - Google Patents
The control method of the electronic operating system of built-in Linux and its external monitoring module Download PDFInfo
- Publication number
- CN109614258A CN109614258A CN201811418756.2A CN201811418756A CN109614258A CN 109614258 A CN109614258 A CN 109614258A CN 201811418756 A CN201811418756 A CN 201811418756A CN 109614258 A CN109614258 A CN 109614258A
- Authority
- CN
- China
- Prior art keywords
- watchdog
- linux
- built
- module
- kernel
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0751—Error or fault detection not based on redundancy
- G06F11/0754—Error or fault detection not based on redundancy by exceeding limits
- G06F11/0757—Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses the control methods of a kind of electronic operating system of built-in Linux and its external monitoring module, hardware watchdog circuit is formed using WatchDog chip, WatchDog function program is inserted into (SuSE) Linux OS program and application program, these function program runing time intervals WatchDog are less than the time interval of external hardware WatchDog functional module.If embedded Linux system works normally, system can be spaced interior continuous progress external hardware WatchDog functional module trigger action at a reasonable time, and the counter of external hardware WatchDog is constantly reset, and does not generate reset signal;If embedded Linux system non-normal working, dog movement failure is fed, the counter of external hardware WatchDog overflows after a certain period of time, and generating reset signal to CPU restarts embedded Linux system.Circuit of the present invention is simplified, reliable and stable and can effectively solve the problem that monitoring of the embedded Linux system during startup to the abnormality of system.
Description
Technical field
The present invention relates to built-in fields, more particularly, to prison outside a kind of electronic operating system of built-in Linux
Control the control method of module.
Background technique
In built-in Linux operating system, it can restore automatically to make system in abnormal cases, generally can all be added
Independent external hardware WatchDog(house dog) functional module.When embedded Linux system operates normally, need
To WatchDog counter O reset namely hello dog in the time interval that WatchDog module allows, reset signal is not allowed to generate.When
It is preceding in the embedded system with (SuSE) Linux OS, since the (SuSE) Linux OS load time is longer (such as 10~20s), one
As above house dog time interval (representative value 1.6s), if not taking special measure, system can Linux operate be
It is resetted in system loading procedure, (SuSE) Linux OS can not load success forever.
To solve the above-mentioned problems, there are commonly the following two kinds solutions instantly: 1. to do a time interval longer
Complicated WatchDog hardware circuit module;2. modifying kernel, WatchDog is set as nothing in Linux Kernel start-up course
Effect.Although scheme 1 can solve embedded Linux system in the Problem of Failure of system start-up phase, design cumbersome hard
Part WatchDog functional circuit virtually increases the cost of product, if the product of scale of mass production using this scheme to enterprise come
Say it is a no small expenditure.Scheme 2 shields the function of WatchDog module in linux system startup stage, ignores embedding
Enter formula linux system in the Problem of Failure in os starting stage, reduces system reliability.
Summary of the invention
The present invention is increased costs caused by overcoming design described in the above-mentioned prior art cumbersome and is likely to occur
WatchDog module provides a kind of electricity of built-in Linux in the defect of the existing Problem of Failure in os starting stage
The control method of sub-operating system and its external monitoring module.
The present invention is directed to solve above-mentioned technical problem at least to a certain extent.
In order to solve the above technical problems, technical scheme is as follows: a kind of embedded-type electric sub-operating system, including electricity
Source module, peripheral module, operating system kernel control module and outer watchdog module;
The power module is used to power to each operational module of system;
The peripheral module is the channel of the information exchange for control core module and external equipment;
The system control core module is used to be responsible for the scheduling of total system;
The external WatchDog module is used for the integral monitoring to linux system.
Preferably, the system control core module runs built-in Linux operating system.
A kind of control method of the external monitoring module of the electronic operating system of built-in Linux, comprising the following steps:
S1: in Bootloader(bootstrap loader) stage, call GPIO(universal input/output) library function, directly take
The status register of the GPIO of anti-central processing unit;
S2: the linux kernel stage after the Bootloader stage takes before its Watchdog drive load and calls GPIO
Library function directly negates the status register of the GPIO of central processing unit, creates and registers WDI char device driver, creation follows
Inner core timer and starting of the ring to WatchDog counter O reset function;
S3: after the Watchdog drive load in linux kernel stage, inner core timer intermittent cyclic calls WDI driving pair
WatchDog counter O reset;
S4: the application program operation phase after the linux kernel stage, the dog program of feeding in application program are taken in finger daemon
The method for calling Watchdog driving carries out.
The present invention forms hardware watchdog circuit using WatchDog chip, in (SuSE) Linux OS program and applies journey
WatchDog function program is inserted into sequence, these function program runing time intervals WatchDog are less than external hardware WatchDog
The time interval of functional module.If embedded Linux system works normally, system can be spaced interior continuous at a reasonable time
External hardware WatchDog functional module trigger action is carried out, the counter of external hardware WatchDog constantly resets, do not generate
Reset signal;If embedded Linux system non-normal working, dog movement failure, the counter of external hardware WatchDog are fed
It overflows after a certain period of time, generating reset signal to CPU restarts embedded Linux system.
Preferably, the specific steps of step S1 are as follows:
S11: setting WDI(watchdog reset inputs) I O function of pin.
S12: built-in Linux external hardware WatchDog function generation is added in the second stage inlet of BootLoader
Code;
S13: built-in Linux external hardware WatchDog function code is added in the initialization of external equipment;
S14: kernel is integrally downloaded and is changed to fragment downloading;
S15: duplication kernel code arrive ram space when addition built-in Linux external hardware WatchDog function code;
S16: it prepares for starting kernel and built-in Linux external hardware is added at the namely inlet waiting in kernel stage
WatchDog function code;
Wherein BootLoader include two stages, the first stage include be to equipment initialization, load spatial cache and will
Bootstrap loader is loaded into caching, and second stage includes initialization system clock and serial ports, and detection memory maps, and setting is drawn
The command format of loading procedure is led, kernel start-up parameter is set.
Preferably, the linux kernel stage includes linux kernel vectoring phase, linux kernel load phase, Linux
The kernel loads stage be divided into Watchdog drive load again before, after Watchdog drive load.
Preferably, the specific steps of step S2 are as follows:
WatchDog operating function code outside built-in Linux is added before S21:Watchdog drive load;
S22: in DTS(device tree source file) in referring to LED char device driver insertion WDI device drives, and it is infused
Volume is into linux kernel.
Preferably, the specific steps of step S3 are as follows:
After S31:Watchdog drive load, inner core timer program unit is write, starts inner core timer, in the function of timer
Energy module timing calls WDI to drive port, control external I/O pins progress WatchDog control;
S32: calling GPIO driving in timer processing function, interrupt hello dog is terminated simultaneously with guaranteeing to feed dog to kernel starting several times
The good root file system of carry.
Preferably, step S4 specific steps are as follows: creation finger daemon carries out circulation in the process and feeds dog processing, that is, exists
WatchDog counter O reset is guarded if there is some process breaks down in the time interval that WatchDog module allows
Process restarts the process, if monitoring thread itself breaks down, WatchDog, which can also automatically reset, restarts.
Preferably, the method that the application program stage feeds dog is to utilize SHELL script manufacturing system self-starting finger daemon,
Feeding dog interval can be 1S or for the arbitrary value less than watchdog chip interval.
Compared with prior art, the beneficial effect of technical solution of the present invention is: the present invention can effectively solve the problem that embedded
The linux system monitoring to the abnormality of system during startup;Its circuit is simplified, and can be significantly reduced embedded
The cost of Linux external hardware WatchDog hardware module;By introducing external hardware WatchDog functional module certainly compared to SOC
It is enough reliable and stable for body WatchDog.
Detailed description of the invention
Fig. 1 is present system block diagram.
Fig. 2 is the whole control strategy of WatchDog module outside embedded Linux system of the present invention.
Fig. 3 is the control strategy of WatchDog module outside the embedded Linux system in application program stage of the present invention.
Specific embodiment
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;
The following further describes the technical solution of the present invention with reference to the accompanying drawings and examples.
Embodiment 1
In system architecture as shown in Figure 1, the present invention include power module, peripheral module, operating system kernel control module and
Outer watchdog module;Wherein power module is used to power to each operational module of system;Peripheral module be control core with
The channel of the information exchange of platform exterior;System control core module is operation built-in Linux operating system for being responsible for
The scheduling of total system;External WatchDog(house dog) module is used for the integral monitoring of linux system.
The whole control strategy of WatchDog module, had been embodied outside embedded Linux system as shown in Figure 3
Cheng Zhong, in the Bootloader stage, external hardware WatchDog control method is in the program start-up course of Bootloader
Different location is uniformly inserted into WatchDog and feeds dog program.In view of the Bootoader first stage runing time well below guarding the gate
Dog resetting time, therefore only need to be in the second stage of Bootoader, such as Flash read-write, CRC check, circulation waiting etc.
Dog code is fed in even insertion.
In the BootLoader stage, WatchDog feeds dog code using GPIO function is set by corresponding pin, adds
It calls the driving of GPIO library function to be operated: the drive code set for defining GPIO function being added in the C code of particular platform,
Flash read-write, CRC check, circulation waits, kernel starts entrance etc. insertion WatchDog and feeds dog code.
Step 1: the I O function of corresponding WDI pin is set.
Step 2: built-in Linux external hardware WatchDog function generation is added in the second stage inlet of BootLoader
Code;
Step 3: built-in Linux external hardware WatchDog function code is added when the initialization of external equipment;
Step 4: kernel is integrally downloaded and is changed to fragment downloading;
Step 5: duplication kernel code arrive ram space when addition built-in Linux external hardware WatchDog function code;
Step 6: it prepares for starting kernel and built-in Linux external hardware is added at the namely inlet waiting in kernel stage
WatchDog function code.
The linux kernel stage can be divided into two big stages: linux kernel vectoring phase, linux kernel load rank
Section, and linux kernel load phase is divided into two with the mark that is loaded as of Watchdog driving in linux kernel load phase
Step: before Watchdog drive load, after Watchdog drive load.
The entrance function kernel_entry of kernel, this function are specified in linux kernel vmlinux.lds threaded file
It is defined in head.S, since the linux kernel vectoring phase is expended, the time is of short duration, this stage is negligible to outer watchdog
Control, therefore this stage can be skipped.External WatchDog processing only is carried out to linux kernel load and operation phase.
Step 1: WatchDog operating function code outside built-in Linux is added before Watchdog drive load;
Method is to be uniformly added into feed dog journey in the relevant equipment tree code arch/arm/mach-XXX/mach-XXXX.c of platform
Sequence is registered with device drives into kernel, and specific method is to call GPIO library function to be operated and add header file statement.
Step 2: referring to the device drives of LED char device driver insertion WDI in the relevant DTS file of device tree, and
And it is registered into kernel;
Step 3: after Watchdog drive load, inner core timer program unit is write, starts inner core timer, in timer
Functional module timing calls WDI to drive port, and control external I/O pins carry out WatchDog control;
4th: calling GPIO driving in timer processing function, interrupt and feed dog 8 times (it is each to be less than 1.6s/), 8 times are real herein
Test examination obtains, it is ensured that feeding dog to kernel starting terminates the simultaneously good root file system of carry.
It is creation in multi-process application program operation phase built-in Linux external hardware Watchdog control dog-feeding method
One finger daemon, its priority are higher than other processes.Finger daemon is the case where other monitored processes work normally
Under, circulation carries out dog feeding operation to Watchdog module in certain time, and dog feeding operation is completed by calling WDI driving.Such as
Some process of fruit breaks down, and finger daemon restarts the process.If monitoring thread itself breaks down, it cannot execute and feed in time
Dog operation, house dog, which also automatically resets, restarts.
The driving that WDI has been made in kernel startup stage is to utilize SHELL in the method that the application program stage feeds dog
Script manufacturing system self-starting finger daemon, feed dog between be divided into 1S, control figure is as shown in Figure 3.
Obviously, the above embodiment of the present invention be only to clearly illustrate example of the present invention, and not be pair
The restriction of embodiments of the present invention.For those of ordinary skill in the art, may be used also on the basis of the above description
To make other variations or changes in different ways.There is no necessity and possibility to exhaust all the enbodiments.It is all this
Made any modifications, equivalent replacements, and improvements etc., should be included in the claims in the present invention within the spirit and principle of invention
Protection scope within.
Claims (9)
1. a kind of electronic operating system of built-in Linux, which is characterized in that including power module, peripheral module, operating system
Kernel control module and outer watchdog module;
The power module is used to power to each operational module of system;
The peripheral module is the channel of the information exchange for control core module and external equipment;
The system control core module is used to be responsible for the scheduling of total system;
The external WatchDog module is used for the integral monitoring to linux system.
2. a kind of electronic operating system external monitoring systems of built-in Linux according to claim 1, feature exist
In the system control core module runs built-in Linux operating system.
3. based on a kind of controlling party of the external monitoring module of the electronic operating system of built-in Linux described in claim 1
Method, comprising the following steps:
S1: in the Bootloader stage, the library function of GPIO is called, the Status register of the GPIO of central processing unit is directly negated
Device;
S2: the linux kernel stage after the Bootloader stage takes before its Watchdog drive load and calls GPIO
Library function directly negates the status register of the GPIO of central processing unit, creates and registers WDI char device driver, creation follows
Inner core timer and starting of the ring to WatchDog counter O reset function;
S3: after the Watchdog drive load in linux kernel stage, inner core timer intermittent cyclic calls WDI driving pair
WatchDog counter O reset;
S4: the application program operation phase after the linux kernel stage, the dog program of feeding in application program are taken in finger daemon
The method for calling Watchdog driving carries out.
4. the control method of monitoring module outside a kind of electronic operating system of built-in Linux according to claim 3,
It is characterized in that, the specific steps of step S1 are as follows:
S11: the I O function of setting WDI pin;
S12: built-in Linux external hardware WatchDog function code is added in the second stage inlet of BootLoader;
S13: built-in Linux external hardware WatchDog function code is added in the initialization of external equipment;
S14: kernel is integrally downloaded and is changed to fragment downloading;
S15: duplication kernel code arrive ram space when addition built-in Linux external hardware WatchDog function code;
S16: it prepares for starting kernel and built-in Linux external hardware is added at the namely inlet waiting in kernel stage
WatchDog function code;
Wherein BootLoader include two stages, the first stage include be to equipment initialization, load spatial cache and will
Bootstrap loader is loaded into caching, and second stage includes initialization system clock and serial ports, and detection memory maps, and setting is drawn
The command format of loading procedure is led, kernel start-up parameter is set.
5. the control method of monitoring module outside a kind of electronic operating system of built-in Linux according to claim 3,
It is characterized in that, the linux kernel stage includes linux kernel vectoring phase, linux kernel load phase, linux kernel
Load phase be divided into Watchdog drive load again before, after Watchdog drive load.
6. the control method of monitoring module outside a kind of electronic operating system of built-in Linux according to claim 3,
It is characterized in that, the specific steps of step S2 are as follows:
WatchDog operating function code outside built-in Linux is added before S21:Watchdog drive load;
S22: referring to the device drives of LED char device driver insertion WDI in DTS, and it is registered into linux kernel.
7. the control method of monitoring module outside a kind of electronic operating system of built-in Linux according to claim 3,
It is characterized in that, the specific steps of step S3 are as follows:
After S31:Watchdog drive load, inner core timer program unit is write, starts inner core timer, in the function of timer
Energy module timing calls WDI to drive port, control external I/O pins progress WatchDog control;
S32: calling GPIO driving in timer processing function, interrupt hello dog is terminated simultaneously with guaranteeing to feed dog to kernel starting several times
The good root file system of carry.
8. the control method of monitoring module outside a kind of electronic operating system of built-in Linux according to claim 3,
It is characterized in that, step S4 specific steps are as follows: creation finger daemon carries out circulation in the process and feeds dog processing, that is, exists
WatchDog counter O reset is guarded if there is some process breaks down in the time interval that WatchDog module allows
Process restarts the process, if monitoring thread itself breaks down, WatchDog, which can also automatically reset, restarts.
9. utilizing the control of monitoring module outside a kind of electronic operating system of built-in Linux according to claim 8
Method, which is characterized in that the method that the application program stage feeds dog is to utilize SHELL script manufacturing system self-starting finger daemon,
It can be 1S or for the arbitrary value less than watchdog chip interval that it, which feeds dog interval,.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811418756.2A CN109614258A (en) | 2018-11-26 | 2018-11-26 | The control method of the electronic operating system of built-in Linux and its external monitoring module |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811418756.2A CN109614258A (en) | 2018-11-26 | 2018-11-26 | The control method of the electronic operating system of built-in Linux and its external monitoring module |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109614258A true CN109614258A (en) | 2019-04-12 |
Family
ID=66005139
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811418756.2A Pending CN109614258A (en) | 2018-11-26 | 2018-11-26 | The control method of the electronic operating system of built-in Linux and its external monitoring module |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109614258A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111857846A (en) * | 2020-06-22 | 2020-10-30 | 珠海格力电器股份有限公司 | Embedded system control method and device, storage medium and embedded controller |
CN115098304A (en) * | 2022-06-20 | 2022-09-23 | 中国科学院空间应用工程与技术中心 | Embedded system, electronic equipment and software running method |
CN116521418A (en) * | 2023-05-16 | 2023-08-01 | 山东铂金动力科技有限公司 | Method for acquiring operation information of embedded system and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101271414A (en) * | 2008-05-06 | 2008-09-24 | 江苏东大金智建筑智能化系统工程有限公司 | Full-range dog-feeding method of embedded system |
US20110231639A1 (en) * | 2010-03-16 | 2011-09-22 | Acer Incorporated | Power lock-up setting method and electronic apparatus using the same |
CN103885847A (en) * | 2014-02-08 | 2014-06-25 | 京信通信系统(中国)有限公司 | Dog feeding method and device based on embedded system |
CN104035536A (en) * | 2014-06-18 | 2014-09-10 | 中国船舶重工集团公司第七二二研究所 | Monitoring and reset control method of embedded system |
-
2018
- 2018-11-26 CN CN201811418756.2A patent/CN109614258A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101271414A (en) * | 2008-05-06 | 2008-09-24 | 江苏东大金智建筑智能化系统工程有限公司 | Full-range dog-feeding method of embedded system |
US20110231639A1 (en) * | 2010-03-16 | 2011-09-22 | Acer Incorporated | Power lock-up setting method and electronic apparatus using the same |
CN103885847A (en) * | 2014-02-08 | 2014-06-25 | 京信通信系统(中国)有限公司 | Dog feeding method and device based on embedded system |
CN104035536A (en) * | 2014-06-18 | 2014-09-10 | 中国船舶重工集团公司第七二二研究所 | Monitoring and reset control method of embedded system |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111857846A (en) * | 2020-06-22 | 2020-10-30 | 珠海格力电器股份有限公司 | Embedded system control method and device, storage medium and embedded controller |
CN115098304A (en) * | 2022-06-20 | 2022-09-23 | 中国科学院空间应用工程与技术中心 | Embedded system, electronic equipment and software running method |
CN115098304B (en) * | 2022-06-20 | 2022-11-29 | 中国科学院空间应用工程与技术中心 | Embedded system, electronic equipment and software running method |
CN116521418A (en) * | 2023-05-16 | 2023-08-01 | 山东铂金动力科技有限公司 | Method for acquiring operation information of embedded system and computer readable storage medium |
CN116521418B (en) * | 2023-05-16 | 2024-04-26 | 山东铂金动力科技有限公司 | Method for acquiring operation information of embedded system and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103207797B (en) | Capsule type customized updating method based on universal extensible firmware interface firmware system | |
CN107122321B (en) | Hardware repair method, hardware repair system, and computer-readable storage device | |
CN109614258A (en) | The control method of the electronic operating system of built-in Linux and its external monitoring module | |
CN102236621B (en) | Computer interface information configuration system and method | |
CN103885847A (en) | Dog feeding method and device based on embedded system | |
CN102955737B (en) | The program debugging method of heterogeneous processor system and system | |
US7644322B2 (en) | Hardware flow control monitor | |
US8898645B2 (en) | Handling breakpoints in an asynchronous debug model | |
CN104125504B (en) | Deployment method, device and system based on continuous integration | |
WO2022161101A1 (en) | Uboot startup method and apparatus for multi-core system on chip, and device and storage medium | |
CN103257922B (en) | A kind of method of quick test BIOS and OS interface code reliability | |
CN104077220A (en) | Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel | |
US20220237144A1 (en) | Baseboard management controller and construction method thereof | |
CN105740139A (en) | Virtual environment based embedded software debugging method | |
CN104679626A (en) | System and method for debugging and detecting BIOS (Basic Input / Output System) | |
CN111949529A (en) | System debugging method and device, computer equipment and storage medium | |
CN107562597A (en) | A kind of multi-process monitoring method, device and service system | |
US20100185844A1 (en) | Evasion of power on self test during an operating system initiated reboot | |
JP2009129463A (en) | Processing method of temporary error in real time system of vehicle controller | |
CN107391174A (en) | Control method and control device for online upgrading of system | |
US7203819B2 (en) | Program processing device | |
US10824493B2 (en) | Disambiguation of error logging during system reset | |
CN114625639B (en) | Debugging method and system based on system on chip and chip | |
US20180018240A1 (en) | Obtaining state information of threads of a device | |
US20180052798A1 (en) | Techniques of accessing bmc terminals through serial port |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190412 |