The state monitoring method and device of computer system
Technical field
The present invention relates to Condition Monitoring Technologies, the state monitoring method more particularly to a kind of computer system and a kind of meter
The state monitoring apparatus of calculation machine system.
Background technology
It can often be run simultaneously there are many device in a system of industry control industry, such as acquisition system, storage system, video
The various devices such as output, keyboard input and network communication, and the reliability of system, transplantability, compatibility, maintainability become
The leading indicator of industry control industry, thus to the status monitoring of various system and devices and control become industrial personal computer improve reliability must
Want means.Monitoring the common message informing mode of these information at present has SMI(System Management Interrupt are
System management interrupt)、MSI(Message Signaled Interrupt, message signal interrupt)、IPI(Inter Processor
Interrupt is interrupted between processor)Operating system is notified to go to handle corresponding information, message informing mode with polling mode
It is multifarious, transplantability, compatible low, poor reliability.For example, SMI interrupt is to send out message from bottom to execute to bottom BIOS
Order, bottom BIOS are separated with system layer, and system layer then can constantly trigger always smi signal, and it is temporary that there are operating systems
" stuck " phenomenon will cause operating system reliability poor if SMI interrupt is frequent, there is very big hidden danger;For another example system mode is different
Chang Hou has very big difference, transplantability and compatibility if notifying operating system by MSI or IPI for different operating system
Property is poor.
Invention content
Based on this, it is necessary to provide one kind by uniform data transfer mode so that transplantability, compatibility, reliability compared with
The state monitoring method of good computer system.
In addition, also providing a kind of state monitoring apparatus of computer system.
A kind of state monitoring method of computer system, includes the following steps:
Virtual condition monitoring device is added for computer:The virtual condition monitoring device and it is connected to computer
Status monitoring chip on south bridge corresponds to, and is driven by ACPI device drivers;
Anomalous event is generated using ACPI method notice operating system:When the status monitoring being connected on the south bridge of computer
Chip because it is found that system mode is abnormal and when generating anomalous event, passed to the ACPI device drivers by ACPI method
The anomalous event is passed, operating system is then notified by the ACPI device drivers;
The status data obtained by status monitoring chip processing is obtained by the ACPI device drivers.
Further include in one of the embodiments,:The status monitoring core is handled by the ACPI device drivers
The status data of piece.
It is described in one of the embodiments, that the anomalous event is transmitted to ACPI device drivers by ACPI method
The step of be specifically:South bridge triggers System Control Interrupts by GPE register groups, and the System Control Interrupts are by advanced programmable
Interrupt control unit is converted to the interrupt requests to central processing unit application, and the central processing unit is then according to the interrupt requests
It is invoked at the System Control Interrupts processing function registered when the ACPI device drivers initialization, is controlled by the system
Interrupt processing function reads pre-defined notification function from BIOS program, and the anomalous event, which is passed to the ACPI, to be set
Standby driver informs this anomalous event of the operating system of computer by the ACPI device drivers.
The status monitoring chip obtains the data of environmental sensor acquisition in one of the embodiments, is passed to environment
The data of sensor acquisition are handled, and anomalous event is generated according to preset condition.
Described obtained by ACPI device drivers is obtained by status monitoring chip processing in one of the embodiments,
Status data the step of include:
The ACPI device drivers are operated by I/O instruction;
The status data that the ACPI device drivers pass through south bridge reading state monitoring chip.
A kind of state monitoring apparatus of computer system, including:
Environmental sensor is used for the status data of collecting computer system;
Status monitoring chip is connect with the environmental sensor, for obtaining the status data, and is analyzed, is located
Reason and preservation;Anomalous event is generated according to preset condition after handling status data;
BIOS in computer system, wherein being added with virtual unit code;The computer system start and it is initial
It, can be by the virtual condition monitoring device of computer system identification by the virtual unit code building when change;
South bridge in computer system is informed for generating interruption when the status monitoring chip generates anomalous event
The operating system of computer this time anomalous event about the virtual condition monitoring device;
Dealing of abnormal data module is obtained by operating the virtual condition monitoring device by status monitoring chip processing
Obtained status data.
The dealing of abnormal data module is additionally operable to handle the shape of the status monitoring chip in one of the embodiments,
State data.
The south bridge triggers System Control Interrupts by GPE register groups in one of the embodiments,.
The System Control Interrupts are converted to from Advanced Programmable Interrupt Controllers APICs to center in one of the embodiments,
The interrupt requests of processor application, the central processing unit are then invoked at the System Control Interrupts registered when system initialization
Function is managed, handle function by the System Control Interrupts reads pre-defined notification function from BIOS program, will be described
Anomalous event pass to the relevant driving of virtual condition monitoring device, by with the virtual condition monitoring device phase
This anomalous event of the operating system of computer is informed in the driving of pass.
The ACPI method of the above method and device due to all using standard in the equipment of bottom and the application software of system layer,
Improve portability, compatibility and the reliability of system state data transmission.
Description of the drawings
Fig. 1 is the state monitoring method flow chart of the computer system of an embodiment;
Fig. 2 is the state monitoring apparatus module map of the computer system of an embodiment.
Specific implementation mode
As shown in Figure 1, the state monitoring method flow chart of the computer system for an embodiment.This method makes setting for bottom
Standby and system layer application software all uses ACPI (the Advanced Configuration and Power of standard
Management Interface advanced configurations and power-management interface) method, improve the portability of design, compatibility and
Reliability.This method comprises the following steps:
S101:Virtual condition monitoring device is added for computer.The virtual condition monitoring device and it is connected to meter
Status monitoring chip on the south bridge of calculation machine corresponds to, and is driven by ACPI device drivers.In computer system starting
And when initializing, it can be identified by computer system by the virtual unit code building added in the BIOS of computer system
Virtual condition monitoring device.
BIOS in computer system is the program being solidificated in storage chip, is directly operated to computer hardware
And management.BIOS is mainly responsible for three tasks:Power-on self-test, hardware initialization and guiding operating system.Above-mentioned task is by very
The module more being included in BIOS program(Namely code segment)To complete.Before guiding operating system, BIOS can list hardware
Testing result.By adding virtual unit code in BIOS program, so that it may to generate virtual hardware.Therefore the virtual shape
State monitoring device refers to the condition monitoring device not necessary being, but due to be supplied to operating system it is a series of with it is hard
The same information of part, such as distribution interrupt number, occupy system resource etc., operating system just thinks to exist in computer system this firmly
Part, and loading corresponding driver can normal operation.
In the present embodiment, which is based on ACPI method, in an operating system by ACPI equipment
Driver drives.BIOS can include the related content of ACPI, such as first to support or realize the related specifications of ACPI
ACPI is also initialized during beginningization hardware.In addition, also being preset in BIOS related to the virtual condition monitoring device
Notice BIOS in function Method(_Lxx), which is mainly the function of a processing event, plays transmission event, leads to
Know the effect of operating system.
S102:Anomalous event is generated using ACPI method notice operating system.When the shape being connected on the south bridge of computer
State monitor chip because it is found that system mode is abnormal and when generating anomalous event, the south bridge triggering of computer is interrupted, and informs calculating
The operating system of machine this time anomalous event about the virtual condition monitoring device.South bridge is triggered by GPE register groups
System Control Interrupts(System Control Interrupt, SCI).The System Control Interrupts are by advanced programmable interrupt control
Device processed(Advanced Programmable Interrupt Controller, APIC)It is converted to central processing unit(CPU)
The interrupt requests of application(Interrupt Request, IRQ).Operating system is then invoked at ACPI according to the interrupt requests
Device driver initialize when register System Control Interrupts processing function, by the System Control Interrupts handle function from
Pre-defined notification function Method is read in BIOS program(_Lxx), the anomalous event is passed into the ACPI equipment
Driver informs this anomalous event of the operating system of computer by ACPI device drivers.
The above process is a process gradually transmitted from bottom hardware to upper-level system.In this way, passing through common ACPI
Method, the hardware of bottom(Status monitoring chip)The system that will inform upper layer extremely(Operating system or application software), make in this way
Bottom and system layer all use the ACPI method of standard, improve transplantability, compatibility and the reliability of design.
Wherein, status monitoring chip obtains the data of environmental sensor acquisition, is carried out to the data of environmental sensor acquisition
Processing, according to preset condition, such as temperature of processor is more than threshold value etc., generates anomalous event.
S103:The status data obtained by status monitoring chip processing is obtained by the ACPI device drivers.Or
Person is further processed the status data of the status monitoring chip.After the application software on upper layer knows anomalous event, it can pass through
The ACPI device drivers obtain the status data obtained by status monitoring chip processing, or are further processed the shape
State monitors the status data of chip.The step of wherein obtaining the status data obtained by status monitoring chip processing include:Pass through
I/O instruction operates the ACPI device drivers;The ACPI device drivers pass through south bridge reading state monitoring chip
Status data or operation bottom hardware.
As shown in Fig. 2, the state monitoring apparatus module map of the computer system for an embodiment.The state monitoring apparatus packet
Include computer system 10, environmental sensor 100 and status monitoring chip 200.Computer system 10 includes BIOS300, south bridge 400
And other complete the necessary parts of computer system functions, it is numerous to list herein.It is integrated wherein in south bridge 400 and interrupts control
Device 500, in the present embodiment, interrupt control unit has key effect in the realization of preceding method, individually lists in fig. 2.
Environmental sensor 100 is used for the status data of collecting computer system.Status monitoring chip 200 is passed with the environment
Sensor 100 connects, and for obtaining the status data, and is analyzed, handled and is preserved.The basis after handling status data
Preset condition generates anomalous event.
Virtual unit code is added in BIOS300 in computer system.The computer system start and it is initial
It, can be by the virtual condition monitoring device of computer system identification by the virtual unit code building when change.It is described virtual
Condition monitoring device it is corresponding with the status monitoring chip on the south bridge for being connected to computer(BIOS is in init state, meter
Calculation machine system can detect all devices, including virtual condition monitoring device, and can generate an equipment list, each equipment
It is corresponded there are one fixed ID codes, when status monitoring chip monitors warping apparatus, just will produce a corresponding ID
ID codes correspond in code and system device table), and driven by ACPI device drivers.It is opened in computer system
When moving and initializing, it can be identified by computer system by adding the virtual unit code building in the BIOS of computer system
Virtual condition monitoring device.In the present embodiment, which is based on ACPI method, in operating system
In driven by ACPI device drivers.BIOS can include the correlation of ACPI to support or realize the related specifications of ACPI
Content, such as also initialize ACPI during initializing hardware.In addition, also presetting the state virtual with this in BIOS
The relevant notification function Method of monitoring device(_Lxx), transmission event is played to the ACPI device drives, and ACPI equipment is driven
Dynamic notice operating system.
South bridge 400 in computer system is used to generate interruption when the status monitoring chip 200 generates anomalous event,
Inform the operating system of computer this time anomalous event about the virtual condition monitoring device.South bridge is deposited by GPE
Device group triggers System Control Interrupts(System Control Interrupt, SCI).The System Control Interrupts are compiled by advanced
Journey interrupt control unit(Advanced Programmable Interrupt Controller, APIC)It is converted to central processing
Device(CPU)The interrupt requests of application(Interrupt Request, IRQ).The central processing unit is then asked according to the interruption
The System Control Interrupts registered when the operating system initialization for being invoked at computer are asked to handle function, in being controlled by the system
Disconnected processing function reads pre-defined notification function from BIOS program, by the anomalous event pass to it is described virtual
The relevant driving of condition monitoring device(Namely above-mentioned ACPI drivings), the relevant drive of virtual condition monitoring device as a result,
Dynamic this anomalous event of the operating system for informing computer.
Dealing of abnormal data module(Figure does not indicate)The application program being operate on operating system, by operating institute
It states virtual condition monitoring device and obtains the status data obtained by status monitoring chip processing.Dealing of abnormal data module is also used
In the status data for handling the status monitoring chip.
Above-mentioned apparatus is the state monitoring apparatus of a computer system, operational process be one kind from bottom hardware gradually
The process transmitted to upper-level system.In this way, by common ACPI method, the hardware of bottom(Status monitoring chip)By abnormal announcement
Know the system on upper layer(Operating system or application software), so that bottom and system layer is all used the ACPI method of standard in this way, improve
Transplantability, compatibility and the reliability of device design.
Several embodiments of the invention above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
Cannot the limitation to the scope of the claims of the present invention therefore be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention
Protect range.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.