The state monitoring method of computer system and device
Technical field
The present invention relates to Condition Monitoring Technology, particularly relate to a kind of state monitoring method of computer system and a kind of state monitoring apparatus of computer system.
Background technology
A system of industry control industry often have many devices together with time move, as various devices such as acquisition system, storage system, video output, keyboard input and network services, and the reliability of system, transplantability, compatibility, maintainability become the leading indicator of industry control industry, therefore to the status monitoring of various system and devices with control the necessary means that becomes industrial computer and improve reliability.The conventional message informing mode of these information of monitoring has SMI(System Management Interrupt at present, system management interrupt), MSI(Message Signaled Interrupt, message signale interrupt), IPI(Inter Processor Interrupt, between processor, interrupt) and polling mode notify operating system to go to process corresponding information, message informing mode is multifarious, transplantability, compatible low, poor reliability.For example, it is to initiate a message to bottom BIOS fill order from bottom that SMI interrupts, bottom BIOS and system layer are separated, system layer can constantly trigger smi signal always, there is temporary transient " stuck " phenomenon of operating system, if SMI interrupts frequent, will cause operating system reliability poor, there is very large hidden danger; And for example system state abnormal after, if by MSI or IPI notice operating system, have very big difference for different operating system, transplantability and compatible poor.
Summary of the invention
Based on this, be necessary to provide a kind of state monitoring method that makes transplantability, compatibility, the good computer system of reliability by uniform data transfer mode.
A kind of state monitoring apparatus of computer system is also provided in addition.
A state monitoring method for computer system, comprises the steps:
For computing machine adds virtual condition monitoring device: described virtual condition monitoring device is with to be connected to status monitoring chip on the south bridge of computing machine corresponding, and driven by ACPI device driver;
Utilize ACPI method notice operating system to produce anomalous event: in the time that the status monitoring chip on the south bridge that is connected to computing machine produces anomalous event extremely due to discovery system state, transmit described anomalous event by ACPI method to described ACPI device driver, then by described ACPI device driver notice operating system;
Obtain the status data being obtained by the processing of status monitoring chip by described ACPI device driver.
In an embodiment, also comprise therein: the status data of processing described status monitoring chip by described ACPI device driver.
Therein in an embodiment, the described step of transmitting described anomalous event to ACPI device driver by ACPI method is specifically: south bridge interrupts by the control of GPE register group triggering system, described system control is interrupted being converted to the interrupt request of central processing unit application by Advanced Programmable Interrupt Controllers APICs, the system control of registering when described central processing unit is invoked at described ACPI device driver initialization according to described interrupt request then interrupts processing function, interrupt processing function by described system control and from bios program, read predefined notification function, described anomalous event is passed to described ACPI device driver, informed this time anomalous event of operating system of computing machine by described ACPI device driver.
In an embodiment, described status monitoring chip obtains the data that environmental sensor gathers therein, and the data of environmental sensor collection are processed, and produces anomalous event according to default condition.
Therein in an embodiment, the described step of obtaining the status data being obtained by the processing of status monitoring chip by ACPI device driver comprises:
By ACPI device driver described in IO command operating;
Described ACPI device driver is by the status data of south bridge reading state monitoring chip.
A state monitoring apparatus for computer system, comprising:
Environmental sensor, for the status data of collecting computer system;
Status monitoring chip, is connected with described environmental sensor, for obtaining described status data, and analyzes, processes and preserve; After treatment state data, produce anomalous event according to default condition;
BIOS in computer system, is wherein added with virtual unit code; Described computer system, in the time starting also initialization, generates the virtual condition monitoring device that can be identified by computer system by described virtual unit code;
South bridge in computer system, for producing and interrupt in the time that described status monitoring chip producing anomalous event, informs this anomalous event about described virtual condition monitoring device of operating system of computing machine;
Dealing of abnormal data module, obtains by operating described virtual condition monitoring device the status data being obtained by the processing of status monitoring chip.
Therein in an embodiment, described dealing of abnormal data module is also for the treatment of the status data of described status monitoring chip.
In an embodiment, described south bridge interrupts by the control of GPE register group triggering system therein.
Therein in an embodiment, described system control is interrupted being converted to the interrupt request of central processing unit application by Advanced Programmable Interrupt Controllers APICs, the system control of registering when described central processing unit is invoked at system initialization then interrupts processing function, interrupt processing function by described system control and from bios program, read predefined notification function, described anomalous event is passed to the driving relevant to described virtual condition monitoring device, informed this time anomalous event of operating system of computing machine by the driving relevant to described virtual condition monitoring device.
Said method and device, because the application software of the equipment at bottom and system layer is all used the ACPI method of standard, have improved portability, compatibility and reliability that system state data is transmitted.
Brief description of the drawings
Fig. 1 is the state monitoring method process flow diagram of the computer system of an embodiment;
Fig. 2 is the state monitoring apparatus module map of the computer system of an embodiment.
Embodiment
As shown in Figure 1, be the state monitoring method process flow diagram of the computer system of an embodiment.The method makes the equipment of bottom and the application software of system layer all use ACPI (Advanced Configuration and Power Management Interface advanced configuration and the power-management interface) method of standard, has improved portability, compatibility and the reliability of design.The method comprises the steps:
S101: for computing machine adds virtual condition monitoring device.Described virtual condition monitoring device is with to be connected to status monitoring chip on the south bridge of computing machine corresponding, and driven by ACPI device driver.In the time of computer system starting initialization, generate by the virtual unit code being added in the BIOS of computer system the virtual condition monitoring device that can be identified by computer system.
BIOS in computer system is the program being solidificated in storage chip, and it directly operates and manage computer hardware.BIOS is mainly responsible for three tasks: power-on self-test, hardware initialization and guiding operating system.Above-mentioned task is completed by the module (being also code segment) being much included in bios program.Before guiding operating system, BIOS can list hardware detection result.By add virtual unit code in bios program, hardware that just can generating virtual.Therefore this virtual condition monitoring device, refer to not necessary being of this condition monitoring device, but owing to having offered a series of information the same with hardware of operating system, such as assigned interrupt number, occupy system resource etc., operating system just thinks in computer system and has this hardware, and loads corresponding driver and can normally move.
In the present embodiment, this virtual condition monitoring device is based on ACPI method, and it is driven by ACPI device driver in operating system.BIOS, in order to support or realize the related specifications of ACPI, can comprise the related content of ACPI, for example also initialization ACPI in the process of initiating hardware.In addition, in BIOS, also preset the function Method(_Lxx in the notice BIOS that the condition monitoring device virtual to this is relevant), this function is mainly a function of processing event, plays transmission event, the effect of notice operating system.
S102: utilize ACPI method notice operating system to produce anomalous event.In the time that the status monitoring chip on the south bridge that is connected to computing machine produces anomalous event extremely due to discovery system state, the south bridge of computing machine triggers and interrupts, and informs this anomalous event about described virtual condition monitoring device of operating system of computing machine.South bridge interrupts (System Control Interrupt, SCI) by the control of GPE register group triggering system.Described system control is interrupted being converted to the interrupt request (Interrupt Request, IRQ) of central processing unit (CPU) application by Advanced Programmable Interrupt Controllers APICs (Advanced Programmable Interrupt Controller, APIC).The system control of registering when operating system is invoked at the initialization of ACPI device driver according to described interrupt request then interrupts processing function, interrupt processing function by described system control and from bios program, read predefined notification function Method(_Lxx), described anomalous event is passed to described ACPI device driver, informed this time anomalous event of operating system of computing machine by ACPI device driver.
Said process is a process of progressively transmitting to upper system from bottom hardware.Like this, by common ACPI method, the hardware (status monitoring chip) of bottom will be informed the system (operating system or application software) on upper strata extremely, makes like this bottom and system layer all use the ACPI method of standard, improves transplantability, compatibility and the reliability of design.
Wherein, status monitoring chip obtains the data that environmental sensor gathers, and the data of environmental sensor collection are processed, and according to default condition, such as temperature of processor exceedes threshold value etc., produces anomalous event.
S103: obtain the status data being obtained by the processing of status monitoring chip by described ACPI device driver.Or further process the status data of described status monitoring chip.The application software on upper strata is known after anomalous event, can obtain the status data being obtained by the processing of status monitoring chip by described ACPI device driver, or further processes the status data of described status monitoring chip.The step of wherein obtaining the status data being obtained by the processing of status monitoring chip comprises: by ACPI device driver described in IO command operating; Described ACPI device driver is by status data or the operation bottom hardware of south bridge reading state monitoring chip.
As shown in Figure 2, be the state monitoring apparatus module map of the computer system of an embodiment.This state monitoring apparatus comprises computer system 10, environmental sensor 100 and status monitoring chip 200.Computer system 10 comprises that BIOS300, south bridge 400 and other complete the necessary parts of computer system functions, do not enumerate at this.The wherein interior integrated interruptable controller 500 of south bridge 400, in the present embodiment, interruptable controller has key effect in the realization of preceding method, in Fig. 2, lists separately.
Environmental sensor 100 is for the status data of collecting computer system.Status monitoring chip 200 is connected with described environmental sensor 100, for obtaining described status data, and analyzes, processes and preserve.After treatment state data, produce anomalous event according to default condition.
In BIOS300 in computer system, be added with virtual unit code.Described computer system, in the time starting also initialization, generates the virtual condition monitoring device that can be identified by computer system by described virtual unit code.Corresponding (BIOS is when the init state with being connected to status monitoring chip on the south bridge of computing machine for described virtual condition monitoring device, computer system can detect all devices, comprise virtual condition monitoring device, and can generate an equipment list, each equipment has a fixing ID code mutually corresponding, in the time that status monitoring chip monitors abnormal equipment, will produce ID code in a corresponding ID code and system device table is mapped one by one), and driven by ACPI device driver.In the time of computer system starting initialization, generate by the virtual unit code being added in the BIOS of computer system the virtual condition monitoring device that can be identified by computer system.In the present embodiment, this virtual condition monitoring device is based on ACPI method, and it is driven by ACPI device driver in operating system.BIOS, in order to support or realize the related specifications of ACPI, can comprise the related content of ACPI, for example also initialization ACPI in the process of initiating hardware.In addition, in BIOS, also preset the notification function Method(_Lxx that the condition monitoring device virtual to this is relevant), play transmission event to described ACPI device drives, ACPI device drives notice operating system.
South bridge 400 in computer system, for producing and interrupt in the time that described status monitoring chip 200 producing anomalous event, is informed this anomalous event about described virtual condition monitoring device of operating system of computing machine.South bridge interrupts (System Control Interrupt, SCI) by the control of GPE register group triggering system.Described system control is interrupted being converted to the interrupt request (Interrupt Request, IRQ) of central processing unit (CPU) application by Advanced Programmable Interrupt Controllers APICs (Advanced Programmable Interrupt Controller, APIC).The system control of registering when described central processing unit is invoked at the operating system initialization of computing machine according to described interrupt request then interrupts processing function, interrupt processing function by described system control and from bios program, read predefined notification function, described anomalous event is passed to the driving relevant to described virtual condition monitoring device (being also that above-mentioned ACPI drives), thus, this time anomalous event of operating system of computing machine is informed in the relevant driving of described virtual condition monitoring device.
Dealing of abnormal data module (figure does not indicate) is the application program running on operating system, and it obtains by operating described virtual condition monitoring device the status data being obtained by the processing of status monitoring chip.Dealing of abnormal data module is also for the treatment of the status data of described status monitoring chip.
Said apparatus is the state monitoring apparatus of a computer system, and its operational process is a kind of process of progressively transmitting to upper system from bottom hardware.Like this, by common ACPI method, the hardware (status monitoring chip) of bottom will be informed the system (operating system or application software) on upper strata extremely, makes like this bottom and system layer all use the ACPI method of standard, improves transplantability, compatibility and the reliability of this device design.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.