Module support layer fault handling method based on partition operating system health monitoringTechnical field
The invention belongs to computer software application fields, and in particular to a kind of mould based on partition operating system health monitoringBlock support layer fault handling method.
Background technology
In the process of running, there may be various types of mistakes and events for application program and operating system for computer systemBarrier, legacy operating system can only simple judgement according to input and return value etc. carried out when finding mistake method it is simple,Act fixed processing behavior, often can not according at that time system mode and specific details on faults carry out it is configurable, haveIt targetedly handles and restores.Accordingly, the realization requirement to health monitoring system is proposed in ARINC653:With sectoring functionEmbedded real-time operating system need health monitoring mechanism to provide failure response, processing, the security functions such as recovery.Operation systemSystem will not only be supplied to the ability that user is directed to certain failure unrestricted choice processing action, but also need to support User Defined eventHinder processing action.
Embedded real-time operating system with sectoring function is layered structure, by module support layer, kernel operating systemLayer, partition operating system layer and application layer composition.Basis of the module support layer as operating system, establish hardware itOn, including each device board grade drives, running environment is provided for kernel operating system, shields hardware differences.
Modern embedded OS with sectoring function is made of many levels, under different system modes, respectivelyDifferent types of failure may all occur for the function of a different levels, and the health monitoring function of this type operating system allows for sending outThe failure occurred in existing different conditions, level, and different processing methods can be called to carry out failure according to the setting of userProcessing and recovery.
Module support layer is established on hardware layer, is mainly made of various types of hardware driver and basic running environment,Unified interface and running environment are provided for operating system, shields the difference of hardware.
Traditional operating system health monitoring covers all kinds of of kernel operating system, partition operating system and application programThe discovery and processing of failure, but it is not directed to the issuable failure of module support layer, this programme devises a kind of module supportLayer fault handling method solves the processing of module support layer failure as the supplement of legacy operating system health monitoring systemProblem.
Invention content
In order to solve the problems in background technology, the present invention proposes one kind and can realize in block supports layer at failureThe module support layer troubleshooting side based on partition operating system health monitoring of reason, fault log and User Defined processingMethod.
The specific technical solution of the present invention is:
The present invention proposes a kind of module support layer fault handling method based on partition operating system health monitoring, specialSign is, includes the following steps:
1) module support layer is built;The module support layer is between hardware and operating system;The module support layerThe independence of operating system and hardware is provided;The module support layer has the function of that itself carries out health monitoring;
2) module support layer initializes, calling module support layer health monitoring, while generating fault log;
3) direct fault location;
Module support layer provides the interface of injection failure, and when driver breaks down, grouting socket injection is specifiedFault message makes the dependencies of the intervention of module support layer health monitoring and taking over fault processing;Failure judgement information it is effectiveProperty, if effectively carrying out step 4), if in vain, returning to mistake;
4) judge whether the health monitoring of operating system initializes to finish, if completing, by the fault message in step 3)It transfers to operating system health monitoring to handle, if not completing, carries out step 5)
5) institutional framework of fault message is built;The institutional framework of the fault message includes that the type of failure, text are saidIt is bright;
6) failure logging;
The institutional framework of fault message is recorded in fault log using cycle index mode;
7) troubleshooting;
7.1) judge whether user has mounted self-defined processing action, if so, user's voluntarily handling failure information;If noIt is then to carry out step 7.2)
7.2) give tacit consent to troubleshooting;The acquiescence troubleshooting includes restarting or stopping or ignore failure.
Above-mentioned steps 6) in cycle index mode specifically include failure message record and failure message reading;
The specific method of the record of the failure message is:
A) creation module support layer failure message record space, the next blank position of direction or position indicator pointer, covering markKnow and event count, position indicator pointer are directed toward the space beginning of failure message record;The position indicator pointer be can covering position pointer;
B) it checks fault message before recording fault message and records the validity in space;
C) failure message is stored in the space of position indicator pointer direction, increase event count;
D) judge whether position indicator pointer has arrived the end in failure message record space, if so, position indicator pointer is directed toward failureCovering marking is arranged in the beginning in Message Record space;If it is not, position indicator pointer is directed toward next blank position.
The reading specific method of the failure message is:
E) judge m odel validity;
F) covering marking is checked, if not covering:
If necessary to reading message offset in the range of having recorded, read and returned in message according to deviation postHold;If being shifted out recording interval, any content is not returned;
If having covered:
Offset if necessary to the message of reading is more than position indicator pointer at a distance from the space beginning of failure message record, readsAnd the failure message of return position pointer n position backward, n are failure message space maximum number of messages and read the difference deviated;
Offset if necessary to the message of reading is recorded no more than position indicator pointer and failure message at a distance from the beginning of space, is readIt takes and the failure message of return position pointer n position forward, n is the offset for the message that needs are read.
The advantage of the invention is that:
1, method of the invention is established in the module support layer of the embedded real-time operating system with sectoring functionThe health monitoring mechanism for having the functions such as troubleshooting, log recording and self-defined troubleshooting action, realizes to operation systemThe flexible processing for the various failures of module support layer of uniting.
Description of the drawings
Fig. 1 is module support layer troubleshooting process figure;
Fig. 2 is failure message recording process flow chart;
Fig. 3 is failure message reading process.
Specific implementation mode
As shown in Figure 1, the present invention proposes at a kind of module support layer failure based on partition operating system health monitoringReason method, includes the following steps:
1) module support layer is built;Module support layer is between hardware and operating system;The module support layer providesThe independence of operating system and hardware;Module support layer has the function of that itself carries out health monitoring;
2) module support layer initializes, calling module support layer health monitoring, while generating fault log;
3) direct fault location;
Module support layer provides the interface of injection failure, and when driver breaks down, grouting socket injection is specifiedFault message makes the dependencies of the intervention of module support layer health monitoring and taking over fault processing;Failure judgement information it is effectiveProperty, if effectively carrying out step 4), if in vain, returning to mistake;
Operating system module support layer identification code operational process in generate failure when can calling module support layer direct fault location connectMouth injects corresponding failure, including failure code, self-defined failure message and message-length.
4) judge whether the health monitoring of operating system initializes to finish, if completing, by the fault message in step 3)It transfers to operating system health monitoring to handle, if not completing, carries out step 5)
5) institutional framework of fault message is built;The institutional framework of the fault message includes that the type of failure, text are saidIt is bright;
6) failure logging;The institutional framework of fault message is recorded in fault log using cycle index mode;
Cycle index mode specifically includes the reading of the record and failure message of failure message;
As shown in Fig. 2, the specific method of the record of failure message is:
A) creation module support layer failure message record space, the next blank position of direction or position indicator pointer, covering markKnow and event count, position indicator pointer are directed toward the space beginning of failure message record;The position indicator pointer be can covering position pointer;
B) it checks fault message before recording fault message and records the validity in space;
C) failure message is stored in the space of position indicator pointer direction, increase event count;
D) judge whether position indicator pointer has arrived the end in failure message record space, if so, position indicator pointer is directed toward failureCovering marking is arranged in the beginning in Message Record space;If it is not, position indicator pointer is directed toward next blank position.
As shown in figure 3, the reading specific method of failure message is:
E) judge m odel validity;
F) covering marking is checked, if not covering:
If necessary to reading message offset in the range of having recorded, read and returned in message according to deviation postHold;If being shifted out recording interval, any content is not returned;
If having covered:
Offset if necessary to the message of reading is more than position indicator pointer at a distance from the space beginning of failure message record, readsAnd the failure message of return position pointer n position backward, n are failure message space maximum number of messages and read the difference deviated;
Offset if necessary to the message of reading is recorded no more than position indicator pointer and failure message at a distance from the beginning of space, is readIt takes and the failure message of return position pointer n position forward, n is the offset for the message that needs are read.
7) troubleshooting;
7.1) judge whether user has mounted self-defined processing action, if so, user's voluntarily handling failure information;If noIt is then to carry out step 7.2)
7.2) give tacit consent to troubleshooting;The acquiescence troubleshooting includes restarting or stopping or ignore failure.
Specifically:
A, failure code, the legitimacy of self-defined failure message and message-length parameter are checked;
If B, operating system health monitoring has initialized, the monitoring of implant operation system health,
Processing is taken over by operating system health monitoring;
If C, operating system health monitoring no initializtion, fault message, filling is organized to use
In the information recording unit of record fault log;
D, calling module support layer acquiescence troubleshooting action.
Module support layer gives tacit consent to the flow that troubleshooting acts:
D1, event of failure validity is checked;
If D2, user have mounted the display hook of fault message, call;
D3, fault message is recorded to module support layer fault log record;
If D4, user have mounted self-defined troubleshooting action, call.The parameter of transmission is the event of standard health monitoringHinder event information structure;
If D5, user do not provide self-defined troubleshooting action, executed according to the prior configuration of user three kinds followingOne of processing:
A. operating system is restarted;
B. stopping is handled, into wait state;
C. without processing, ignore failure.