Computer peripheral equipment operation event response processing method and systemTechnical field
The invention relates to a kind of computer information technology, particularly about a kind of computer peripheral equipment operation event response processing method and system, can be applicable to computer platform, desktop PC for example, notebook computer, Tablet PC etc., allow the software layer (being operating system) of this computer platform can respond a series of a plurality of peripheral operation incidents that take place on the firmware layer (being peripheral interface) of this computer platform, for example comprise that hot key (hot key) pushes incident, media play is controlled key and is pushed incident, extended base (docking station) coupling event, extended base is separated incident, multiple groove CD-ROM drive (multibay CD-ROM) hot plug incident, fan rotation incidents etc. respond processing to these peripheral operation incidents in regular turn by the program of software layer.
Background technology
Present various personal computer platform on the market, comprise the desktop PC, notebook computer, Tablet PC etc., mostly keyboard is provided with many various different peripheral operational and controlled key buttons fast, the hot key that promptly is commonly called as (hot key), for example comprise that power management controls key, the diagnostic routine activate key, the Internet activate key, the Email activate key, media play is controlled key etc., allow the user seek and to click application program graph of a correspondence or option in the Windows that needn't utilize mouse on screen, to show comparatively troublesomely apace as long as can activate required application program immediately by next button or a key groups.
The practice a kind of commonly used that realizes at present the quick operational and controlled key button response of peripheral type processing capacity is to adopt scanning sign indicating number (scan code) and monitor whether have hot key to be pressed in the keyboard, and when having hot key to be pressed, adopt IRQ (Interrupt ReQuest) or PCI (Peripheral ComponentInterconnect) look-at-me, the hot key that causes in the software layer (being operating system) is pushed the event response handling procedure, can make computer platform that the hot key that the user pushes is responded, and activate required application program immediately.
Yet a shortcoming of the above-mentioned practice is to adopt keyboard to scan sign indicating number and IRQ/PCI look-at-me, make the interface structure between keyboard and the computer platform become comparatively complicated, and can have influence on the operation of other standard key on the keyboard, and then have influence on the usefulness of normal keyboard data input work.
In addition, usually be provided with the peripheral function extended interface on the most notebook computer, the user its notebook computer can be overlapped to various peripheral function expanding device, for example pack extended base (docking station), multi-groove type CD-ROM module (multibay CD-ROMmodule) etc., the function that expands notebook computer whereby.When the user is coupled to notebook computer with the peripheral function expanding device, BIOS system program in the notebook computer promptly must responsively carry out relevant setting work with operating system, makes notebook computer can normally use this peripheral function expanding device.
Being used for realizing the practice a kind of commonly used of peripheral function expanding device overlap joint event response processing capacity at present, is to adopt to push the mechanism that the event response processing capacity is separated with hot key, therefore need design two event response handling procedures respectively on concrete enforcement.It is comparatively complicated that yet this practice obviously can make in the program design.
Summary of the invention
For overcoming the shortcoming of above-mentioned prior art, fundamental purpose of the present invention is to be to provide a kind of computer peripheral equipment operation event response processing method and system, needn't adopt keyboard scan the sign indicating number and the IRQ/PCI look-at-me one peripheral operation event response processing capacity is provided.
Another object of the present invention is to provide a kind of computer peripheral equipment operation event response processing method and system, can push incident and exsert functional extender apparatus overlap joint incident provides an integrated response handler system to hot key, on concrete enforcement, only need design single program, needn't design two event response handling procedures respectively, make program design work comparatively simplify.
Computer firmware layer of the present invention controls the event queue disposal route and system is applied in computer platform, desktop PC for example, notebook computer, Tablet PC etc., the firmware layer (being peripheral interface) that allows the software layer (being operating system) of this computer platform can respond this computer platform goes up a series of a plurality of peripheral operation incidents that take place, for example comprise that hot key (hotkey) pushes incident, media play is controlled key and is pushed incident, extended base (docking station) coupling event, extended base unloads incident, multiple groove CD-ROM drive (multibay CD-ROM) hot plug incident, fan rotation incidents etc. respond processing to these peripheral operation incidents in regular turn by the program of software layer.
Computer peripheral equipment Action Events response processing system of the present invention comprises at least: a firmware layer unit and a software layer unit.
Wherein this firmware layer unit comprises at least: a peripheral operation incident monitor module can monitor on the peripheral interface of this computer platform whether a peripheral operation incident takes place; If then responsively produce the event information of a correspondence; One event code generation module can respond the event information that this peripheral operation incident monitor module produces, and produces the event code of one group of correspondence; One event code is kept in module, has a firmware layer formation working area, is used for each event code that temporary this event code generation module produces; And a quene state display module, can show that this firmware layer formation working area is in vacant state or quene state at present; If this firmware layer formation working area is temporary at present any event code is not arranged, then be shown as vacant state; Otherwise, if this firmware layer formation working area is temporary at present at least one group of event code arranged, then be shown as quene state.
Wherein this software layer unit comprises at least: one-period property time block, can send a quene state and check active information periodically every a predetermined period of time; One quene state is checked module, can respond the quene state inspection active information that this periodicity time block produces, and checks whether the state that this quene state display module shows at present is quene state; If then send a formation and shift active information; One formation shift module has a software layer formation working area, and it can respond the formation that this quene state checks that module is sent and shift active information, and all event codes in this firmware layer formation working area are transferred to this software layer formation working area; And an event code processing module, can from this software layer formation working area, take out each event code one by one, and each event code is deciphered, make this computer platform carry out the event response handling procedure of a correspondence.
Computer peripheral equipment operation event response processing method step of the present invention is: at first on the firmware layer of this computer platform, monitor on the peripheral interface of this computer platform whether a peripheral operation incident takes place; If then responsively produce the event information of a correspondence; Secondly on the firmware layer of this computer platform, respond this event information, produce the event code of one group of correspondence; Then on the firmware layer of this computer platform, this event code is temporarily stored into a default firmware layer formation working area; On the firmware layer of this computer platform, set a quene state display module and show that this firmware layer formation working area is in vacant state or quene state at present subsequently; If the not temporary at present any event code in this firmware layer formation working area then is shown as vacant state; Otherwise, if this firmware layer formation working area is temporary at present at least one group of event code arranged, then be shown as quene state; On the software layer of this computer platform,, send a quene state and check active information periodically every a predetermined period of time; And on the software layer of this computer platform, respond this quene state and check active information, check whether the state that this quene state display module shows at present is quene state; If then send a formation and shift active information; On the software layer of this computer platform, respond this formation and shift active information, all event codes in this firmware layer formation working area are transferred to a default software layer formation working area; On the software layer of this computer platform, from this software layer formation working area, take out each event code one by one, and each event code is deciphered at last, make this computer platform carry out the event response handling procedure of a correspondence.
The characteristics of computer peripheral equipment operation event response processing method of the present invention and system are that a firmware layer formation working area is set in the firmware layer of computer platform, store the code of all peripheral operation incidents that take place on this computer platform; And make software layer periodically check in this firmware layer formation working area the whether temporary event code that has; If, then the event code in the firmware layer formation working area all is transferred to a software layer formation working area, allow the operating system of software layer can carry out the pairing event response handling procedure of these peripheral operation incidents in regular turn.
The advantage of computer peripheral equipment operation event response processing method of the present invention and system is to allow this computer platform needn't adopt keyboard to scan sign indicating number and the IRQ/PCI look-at-me provides peripheral operation event response function, and peripheral operation incident (for example pushing incident for hot key) and the outer peripheral operation incident of keyboard that can integrate simultaneously on the keyboard (for example are the extended base coupling event, extended base unloads incident, CD-ROM drive hot plug incident, fan rotation incident etc.), needn't design two event response handling procedures respectively, only need design single program, make program design work comparatively simplify.Therefore can provide one to have the height conformability and promote the peripheral operation event response processing capacity of total system usefulness.
Description of drawings
Fig. 1 is a system architecture synoptic diagram, shows the application structure of computer peripheral equipment Action Events response processing system of the present invention and the Object Oriented OO component model of internal firmware/software configuration thereof;
Fig. 2 is a data structure synoptic diagram, shows an example of the event code corresponding tables that computer peripheral equipment Action Events response processing system of the present invention adopts.
Embodiment
Embodiment
Below be conjunction with figs., describe the embodiment of computer peripheral equipment operation event response processing method of the present invention and system in detail.
Fig. 1 promptly shows the basic structure of the Object Oriented OO component model (object-oriented component model) of the application structure of computer peripheral equipment Action Events response processing system of the present invention (part that comprises as the frame of broken lines of label 20 indications) and internal firmware/software configuration thereof.As shown in the figure, computer peripheral equipment Action Events response processing system 20 of the present invention is that collocation is to acomputer platform 10 in practical application, desktop PC for example, notebook computer, Tablet PC etc., the firmware layer (being peripheral interface) that allows the software layer (being operating system) of thiscomputer platform 10 can respond this computer platform 20 goes up a series of a plurality ofperipheral operation incidents 30 that take place, for example comprise that hot key (hot key) pushes incident, media play is controlled key and is pushed incident, extended base (docking station) coupling event, extended base is separated incident, multiple groove CD-ROM drive (multibayCD-ROM) hot plug incident, fan rotation incidents etc. respond processing to theseperipheral operation incidents 30 respectively by a combination event of software layerresponse handling procedure 40.
As shown in Figure 1, the basic structure of the Object Oriented OO component model of computer peripheral equipment Action Events response processing system 20 of the present invention (object-oriented component model) comprises at least: (A)firmware layer unit 100; And (B)software layer unit 200; Wherein thisfirmware layer unit 100 comprises (a1) peripheral operationincident monitor module 110 at least; (a2) an eventcode generation module 120; (a3)temporary module 130 of an event code and affiliated firmware layerformation working area 131 thereof and (a4) a quenestate display module 140; 200 of this software layer unit comprise at least: (b1) one-periodproperty time block 210; (b2) quene state is checkedmodule 220; (b3) aformation shift module 230 and affiliated software layerformation working area 231 thereof and (b4) an eventcode processing module 240.
On concrete enforcement, thisfirmware layer unit 100 for example is that the mode with an additional firmware module (add-onfirmware module) is incorporated into BIOS (BasicInput/Output System) system program in thiscomputer platform 10, for example be the BIOS system program in the keyboard controller (keyboardcontroller), 200 of this software layer unit are for example to be integrated into operating system on thiscomputer platform 10 in the mode of an additional software module (add-on software module).
On the peripheral interface of peripheral operationincident monitor module 110 thesecomputer platforms 10 of supervision whether theperipheral operation incident 30 of generation is arranged; If then responsively produce the event information of a correspondence.
Eventcode generation module 120 can respond the event information that above-mentioned peripheral operationincident monitor module 110 produces, and produces the event code of one group of correspondence according to event code corresponding tables for example shown in Figure 2.Event code corresponding tables shown in Figure 2 only is an application example of the present invention, and it is a kind of design alternative of randomness on concrete enforcement, and many other different embodiments can be arranged.
Firmware layerformation working area 131 under thetemporary module 130 of event code for example is a first in first out formula (First In First Out, FIFO) formation working area is used for each event code that above-mentioned eventcode generation module 120 produces is temporarily stored into this firmware layerformation working area 131.
Quenestate display module 140 is to be coupled to above-mentioned firmware layerformation working area 131, be used to show that this firmware layerformation working area 131 is that to be in vacant state or quene state (if this firmware layerformation working area 131 does not have any event code at present, then be vacant state just at present; Otherwise, if this firmware layerformation working area 131 is temporary at present at least one group of event code arranged, then be quene state).On concrete enforcement, this quenestate display module 140 for example is to adopt a buffer that is called " Mailbox Register " in a SMSC (the Standard Microsystems Corporation) keyboard controller (keyboardcontroller) to realize, just if this firmware layerformation working area 131 is vacant states, the value that will be somebody's turn to do " Mailbox Register " buffer is made as 0; Otherwise if quene state, the value that then will be somebody's turn to do " Mailbox Register " buffer is made as 1.
Insoftware layer unit 200, periodicallytime block 210 can for example be 250 milliseconds (ms) periodically every a preset time cycle, sends a quene state and checks that active information checksmodule 220 to quene state.
Quene state checks thatmodule 220 can respond the quene state inspection active information that above-mentionedperiodicity time block 210 produces, and checks whether this quenestate display module 140 is to demonstrate quene state at present; If (representative has just been deposited event code in this firmware layerformation working area 131 at present) then sent a formation and shifted active information toformation shift module 230.
Software layerformation working area 231 under theformation shift module 230 for example is a first in first out formula (First In First Out with the software program definition, FIFO) formation working area, it can respond the formation transfer active information that above-mentioned quene state checks thatmodule 220 is sent, and all temporary in the firmware layerformation working area 131 in thefirmware layer unit 100 event codes are transferred to this software layer formation working area 231.On concrete enforcement, above-mentioned quene state checks thatmodule 220 is for example to adopt the SMI of standard (System Management Interrupt) look-at-me, makes theformation shift module 230 in thesoftware layer unit 200 under the operating system obtain the content that keep in the firmware layerformation working area 131 in thefirmware layer unit 100.
Eventcode processing module 240 can be according to a predefined procedure from above-mentioned software layerformation working area 231, for example for the mode of first in first out, take out wherein each event code one by one, and each event code deciphered, obtain the eventresponse handling procedure 40 of each event code correspondence, and then make this computer platform carry out its corresponding eventresponse handling procedure 40, eachperipheral operation incident 30 is responded.
Please consult Fig. 1 and Fig. 2 simultaneously, in practical application, the implementation procedure of computer peripheral equipment operation event response processing method of the present invention is: whencomputer platform 10 one of generation or a series ofperipheral operation incident 30, for example hot key is pushed incident, media play is controlled key and is pushed incident, the extended base coupling event, extended base unloads incident, multiple groove CD-ROM drive hot plug incident, fan rotation incident etc., promptly can make peripheral operationincident monitor module 110 responsively produce the event information of a correspondence to eventcode generation module 120, make eventcode generation module 120 responsively according to event code corresponding tables shown in Figure 2, produce the event code of one group of correspondence, and then make thetemporary module 130 of event code that this event code is deposited into firmware layer formation working area 131.When having deposited event code in the firmware layerformation working area 131, can make quenestate display module 140 be configured to demonstrate quene state (for example being to show 1).
Then if on thecomputer platform 10 another oneperipheral operation incident 30 takes place again, then similarly can make peripheral operationincident monitor module 110 responsively produce the event information of a correspondence to eventcode generation module 120, make eventcode generation module 120 responsively produce the event code of one group of correspondence, and then make thetemporary module 130 of event code that this event code is deposited into firmware layerformation working area 131.
On the other hand, insoftware layer unit 200, quenestate inspection module 220 can be controlled by the time interval (for example being every 250 milliseconds) thatperiodicity time block 210 sets, produce periodic quene state and check active information, check whether the state that this quenestate display module 140 shows at present is not vacant state (just whether the value of its buffer is not 0); (if representative has just been deposited event code in this firmware layerformation working area 131 at present), then send a formation and shift active information toformation shift module 230, makeformation shift module 230 responsively with all event codes in the firmware layerformation working area 131 in thefirmware layer unit 100, be transferred to the software layerformation working area 231 in the software layer unit 200.Then eventcode processing module 240 can be according to a predefined procedure from software layerformation working area 231, the order of first in first out for example, take out wherein each event code one by one, and each event code deciphered, obtain the pairing eventresponse handling procedure 40 of each event code, then make computer platform carry out its corresponding eventresponse handling procedure 40, eachperipheral operation incident 30 is responded.
Generally speaking, the invention provides a kind of computer peripheral equipment operation event response processing method and system of novelty, can be applicable to computer platform, a peripheral operation event response processing capacity is provided; And its characteristics are to be provided with a firmware layer formation working area in the firmware layer of computer platform, store the code of all peripheral operation incidents that taken place on this computer platform; And make software layer periodically check in this firmware layer formation working area the whether temporary event code that has; If, then the event code in the firmware layer formation working area is all transferred to a software layer formation working area, allow the operating system of software layer can carry out the pairing event response handling procedure of these peripheral operation incidents in regular turn.These characteristics can allow computer platform needn't adopt keyboard to scan sign indicating number and the IRQ/PCI look-at-me provides peripheral operation event response function, and can integrate the outer peripheral operation incident (for example extended base coupling event, extended base are separated incident, CD-ROM drive hot plug incident, fan rotation incident etc.) of peripheral operation incident (for example hot key is pushed incident) on the keyboard and keyboard simultaneously, therefore can provide one to have high conformability and promote the peripheral operation event response processing capacity of total system usefulness.Therefore the present invention has better progressive and practicality than prior art.