Background technology
Usually, for example all need in the test process of computer computer (the Operating System of initiating task system whether normally in electronic communication equipment; OS) test, please cooperate and consult Fig. 1, existing method of testing be main by a debug card (Debug Card) 11 (as Port80Debug Card) to connect the PCI slot 101 that places a computer 10 motherboards, and a tester table 12 is connected with this debug card 11, with obtain that this debug card 11 exported as code command information datas such as (Code).When carrying out this method of testing, be at first when this computer of detecting 10 is carried out initiating tasks and enter in the operating environment of OS, promptly can operate a specific test procedure automatically according to default instruction, exporting an appointment codes (Code) data to this PCI slot 101, thereby make this debug card 11 obtain this appointment codes data; Simultaneously, the tester table that is connected with this debug card 11 12 can be in a Preset Time section (for example 24 hours) compartment of terrains read the code data that this debug card 11 obtained and judge whether it is appointment codes, if, then make a counter carry out a counting operation, to write down this computer 10 normal number of times of carrying out initiating task and entering OS in this Preset Time section of 24 hours, judge according to the count value that this added up whether computer 10 meets testing standard thus for the system engineer.Yet this kind need use extra debug card 11 by the mode of tester table 12 test computers 10, thereby can increase testing cost.
In addition, be equipped with pilot lamp on the existing computer motherboard corresponding to each the communication interface port on this motherboard, for example PORT80_LED is one group and shows that in order to correspondence communication interface port on this computer motherboard is the display lamp of 80 data transmission state, and the show state of this pilot lamp is to have universal input/output interface (General Purpose Input Output by one; GPIO) South Bridge chip is controlled, and this group PORT80_LED mainly is used to system boot and carries out oneself's detection operation (Power On SelfTest; POST) time, show the relevant detection code, right, when system after finishing POST and normally entering OS, this group PORT80_LED promptly is in idle state.
BIOS (Basic Input and Output System; Basic Input or Output System (BIOS)) interrupt service routine be that computer system is soft, a programmable interface between the hardware, in other words, to call for the management of peripheral equipments such as soft, the hard disc in the computer, CD-ROM device and keyboard, display be to build on the basis of system bios to computer operating system.The system engineer also can be by to the visit of various interrupt instructions and directly call this BIOS interrupt service routine.For example, INT15H is commonly referred to the system break service routine, this system break service routine includes many sub-function module (being the break in service operation), provide predefined subfunction can select corresponding break in service operation by CPU to specific working storage (Register) AX, simultaneously, also can utilize the subfunction that is not defined that this interrupt service routine is carried out the function expansion.
In sum, if a kind of technical scheme can be provided, with will this general input and output Port and the technical characterictic that had of break in service operation combine with existing test mode, thereby overcome existing various defectives in the prior art, be the problem of solution required for the present invention.
Summary of the invention
In view of the shortcoming of above-mentioned prior art, fundamental purpose of the present invention is to provide a kind of test macro and method, gets so that tester table directly is connected with the execution test procedure by communication interface with computer, and need not use the debug card, to reduce testing cost.
Another object of the present invention is to provide a kind of test macro and method, is to make full use of the communication interface that is in idle state in the existing computer apparatus, with the utilization rate of effective lifting computer hardware resource.
A further object of the present invention is to provide a kind of test macro and method, and it is the function expansion that utilizes the interrupt service routine of computer apparatus, thereby can make the test jobs modularization of computer apparatus.
For reaching above-mentioned and other purposes, the present invention promptly provides a kind of test macro, be to be applied to a computer apparatus, and this computer apparatus is connected with a tester table by the communication interface that is mounted on this computer apparatus, this test macro is to comprise in order to store the storage module of a test procedure; Be used for detecting this computer apparatus and be when normally carrying out initiating task and being in the operating environment of an operating system, trigger the test procedure carried out in this storage module to produce the trigger module of corresponding interrupt control instruction; And in order to operate this trigger module triggering execution interrupt control instruction that this test procedure produced to produce a specific code data, and the communication interface by this computer apparatus to be transferring to this tester table with this code data, thereby carries out the processing module of test jobs for this tester table.
Wherein, this computer apparatus also is mounted with in order to operating this interrupt control instruction producing the interrupt service routine of a specific code data, and this interrupt service routine is embedded at Basic Input or Output System (BIOS) (the Basic Input and Output System of this computer apparatus; BIOS) in.Moreover the communication interface of this computer apparatus also comprises a plurality of light emitting diodes (Light Emitting Diode; LED), and this computer apparatus also comprises the South Bridge chip (South Bridge) of (the General Purpose Input andOutput) Port that has GPIO, it is the communication interface that electrically connects this computer apparatus, in order to receive the code data produced and the current potential of this GPIO Port of corresponding change, control the show state of each light emitting diode in this communication interface according to this.In addition, this tester table is according to a preset standard, receives and analyzes whether fair this preset standard of symbol of code data that this communication interface exports, and add up the number of times of the code data of fair this preset standard of symbol that this communication interface is exported in a Preset Time section.
Corresponding above-mentioned disclosed test macro, the present invention also provides a kind of method of testing, it comprises the steps: to provide a computer apparatus and a tester table, and this computer apparatus is in order to storing a test procedure, and this tester table is by being mounted on communication interface on this computer apparatus to be connected with this computer apparatus; Open the power supply of this computer apparatus, so that this computer apparatus is carried out initiating task; Judge whether this computer apparatus is normally carried out initiating task and be in the operating environment of an operating system, if then trigger and carry out this and be stored in test procedure in the computer apparatus to generate corresponding interrupt control instruction; Operate this interrupt control instruction producing a specific code data, and the communication interface by this computer apparatus is to transfer to this tester table with this code data; And make this tester table statistics and analyze the code data that is received, to draw corresponding test result report.
Wherein, this running interrupt control instruction is reached by the interrupt service routine that is loaded in the computer apparatus with the operation steps that produces a specific code data, and this interrupt service routine is embedded at Basic Input or Output System (BIOS) (the Basic Input and Output System of this computer apparatus; BIOS) in.Moreover the communication interface of this computer apparatus also comprises a plurality of light emitting diodes (LightEmitting Diode; LED), and this computer apparatus comprises the South Bridge chip (South Bridge) of (the General PurposeInput and Output) Port that has GPIO again, it is the communication interface that electrically connects this computer apparatus, in order to receive the code data produced and the current potential of this GPIO Port of corresponding change, control the show state of each light emitting diode in this communication interface according to this.In addition, this tester table is according to a preset standard, receives and analyzes whether fair this preset standard of symbol of code data that this communication interface exports, and add up the number of times of the code data of fair this preset standard of symbol that this communication interface is exported in a Preset Time section.
Described before combining, test macro of the present invention and method are to utilize the software and hardware resource (being communication interface, South Bridge chip and interrupt service routine) that is had in the existing computer apparatus to detect the duty of each hardware members in this computer apparatus, and need not use extra hardware accessory (as the debug card), not only can reduce testing cost, also can improve the utilization rate of each idle hardware resource in the computer apparatus.Moreover, because the system break service routine of computer apparatus can carry out the function expansion, also promptly, the system break service routine can comprise many sub-function module (being the break in service operation), thereby this test jobs module can be turned to a break in service operation of this system break service routine.
Embodiment
Below be that those skilled in the art can understand other advantages of the present invention and effect easily by the disclosed content of this instructions by specific instantiation explanation embodiments of the present invention.The present invention also can be implemented or be used by other different instantiations, and the every details in this instructions also can be based on different viewpoints and application, carries out various modifications and change under the spirit of the present invention not deviating from.
Fig. 2 is a block schematic diagram, it is in order to show the basic framework of test macro of the present invention, test macro of the present invention is applied in the computer apparatus 20, duty for each hardware members in 22 pairs of these computer apparatus 20 of a tester table detects, particularly, whether it can normally carry out initiating task and be in operating system (OperatingSystem by detecting computer apparatus; OS) technological means of 200 operating environment is reached above-mentioned test purpose, and wherein, this computer apparatus 20 is for example to be PC or servomechanism etc.
Moreover, this tester table 22 is by being mounted on a communication interface 201 in this computer apparatus 20 to be connected with this computer apparatus 20, and on this communication interface 201, also have a plurality of light emitting diodes (LED) 2011, in present embodiment, this communication interface 201 is PORT80_LED, and by the show state (please be detailed later) of South Bridge chip (South Bridge) 205 to control each light emitting diode 2011 on this communication interface 201 with GPIO (General PurposeInput and Output) Port 2051 in this computer apparatus 20.
As shown in the figure, test macro of the present invention comprises: storage module 210, trigger module 230 and processing module 250.
This storage module 210 is in order to store a test procedure 211.
This trigger module 230 is to be used for detecting that this computer apparatus 20 is normal when carrying out initiating tasks and being in the operating environment of an operating system 200, promptly trigger the test procedure of carrying out in this storage module 210 211, exported with the interrupt control instruction that generates a correspondence.Particularly, this trigger module 230 is when this computer apparatus 20 of detecting is in the operating environment of an operating system 200, promptly calls to be stored in the test procedure 211 in this storage module 210 and to be carried out, to produce an interrupt control instruction.
This processing module 250 is to trigger the interrupt control instruction that this test procedure 211 of execution is produced in order to operate this trigger module 230, thereby produce a specific code data 251, and the communication interface 201 by this computer apparatus 20 to be transferring to this code data 251 in this tester table 22, thereby carries out test jobs for this tester table 22.Particularly, this processing module 250 is behind the interrupt control instruction that this trigger module 230 of reception is produced, promptly by calling the interrupt service routine 203 that is loaded in this computer apparatus 20 to carry out the interrupt control instruction that is received and to produce corresponding code data 251, in present embodiment, this interrupt service routine 203 is embedded at Basic Input or Output System (BIOS) (the Basic Input and OutputSystem of this computer apparatus 20; Hereinafter to be referred as BIOS) in (not giving graphic).In present embodiment, be to utilize this interrupt service routine 203 to carry out this interrupt control instruction, thereby a specific working storage (Register) in this computer apparatus 20 is carried out the operation of corresponding storage values, for example, is 0DAA0H by carrying out this interrupt control instruction with this working storage AX storage values.
Moreover, The present invention be directed to this communication interface 201 and be mounted on a plurality of light emitting diodes 2011 on this communication interface 201, and in existing bios code database (not giving graphic) addition one an OEM_INT15 functional module and an OEM_DiagLED functional module.Wherein, this OEM_INT15 functional module is an output code control module, export the code data 251 that shows in order to control this communication interface 201, particularly, it is by calling the OEM_Int15Hook function to judge whether the storage values among this working storage AX is a preset value (as 0DAA0H), if be judged as be, promptly by calling an explicit function, oem_show_port80_led_far for example, to produce corresponding reveal codes data 251 (also be, these tester table 22 discernible code datas 251), 43h for example, thereby and by this communication interface 201 this code data 251 is transferred in this tester table 22 for carrying out the statistical study operation.This OEM_DiagLED functional module then is a presentation control function module, this is mounted on the show state of each light emitting diode 2011 on the communication interface 201 to be mainly used in control, in present embodiment, be to have 8 light emitting diodes 2011 on this communication interface 201, and respectively the show state of this light emitting diode 2011 is 205 controls of South Bridge chip (SouthBridge) with GPIO (General Purpose Input and Output) Port 2051 in this computer apparatus 20, and this GPIO Port 2051 to be communication interfaces 201 with this computer apparatus 20 electrically connect, this OEM_DiagLED functional module is the current potential that each pin in this GPIO Port 2051 is set according to code data 251 correspondences that the OEM_INT15 functional module is generated, and is mounted on the light on and off show state of 8 light emitting diodes 2011 on this communication interface 201 with correspondence control.For example, this OEM_DiagLED functional module is can be with the corresponding 01000011b of being converted to of code data 251 (being 43h) that is generated by the OEM_INT15 functional module, and current potential (the 1 expression noble potential of each pin in this GPIO Port 2051 is set respectively according to this; 0 expression electronegative potential), (the pin current potential is that 1 lamp is bright with the effect of the show state that reaches 8 light emitting diodes 2011 of control on this communication interface 201 thus; The pin current potential is that 0 lamp goes out).The tester can judge whether this computer apparatus 20 is normally carried out initiating task and be in the operating environment of operating system 200 according to the show state of LED.
In addition, aforesaid tester table 22 is according to a preset standard, receive and analyze whether fair this preset standard of symbol of code data that this communication interface 201 exported 251, and add up the number of times of the code data 251 of fair this preset standard of symbol that this communication interface 201 is exported in a Preset Time section.In present embodiment, this Preset Time section is set at 24 hours, and this computer apparatus 20 will repeat starting and withdrawing from operating system 200 of task in 24 hours time period.Particularly, be at first by test macro of the present invention when carrying out initiating tasks and being in the operating environment of operating system 200 in this computer apparatus of detecting 20 is normal, promptly by this communication interface 201 (being PORT80_LED) to export the code data 251 (being 43h) of an appointment to this tester table 22; And make this test macro when this computer apparatus 20 of detecting withdraws from operating system 200, this communication interface 201 is carried out an initialization action.In addition, 22 of this tester tables can be discerned at the code data 251 that is received, to analyze this code data 251 standard whether fair symbol is preset, if, one counter is carried out once counted operation, thus counting this computer apparatus 20 normal number of times that starts in 24 hours time period, thereby for judging in the computer apparatus 20 the whether requirement up to specification of each hardware members.
Corresponding to aforesaid test macro, the present invention also provides a kind of method of testing.See also Fig. 3, it is the detailed process synoptic diagram of the dead embodiment of method of testing of the present invention.This method of testing is to be applied in the computer apparatus 20, detects for the operating state of each hardware members in 22 pairs of these computer apparatus 20 of a tester table.As shown in Figure 3, this method is execution in step S30 at first.
In step S30, one computer apparatus 20 and a tester table 22 are provided, and be to store a test procedure 211 in this computer apparatus 20, and this tester table 22 is by being mounted on communication interface 201 on this computer apparatus 20 to be connected with this computer apparatus 20.In present embodiment, this communication interface 201 is the PORT80_LED interface with a plurality of light emitting diodes (LED) 2011, and by the show state (please be detailed later) of South Bridge chip (South Bridge) 205 to control each light emitting diode 2011 on this communication interface 201 with GPIO (GeneralPurpose Input and Output) Port 2051 in this computer apparatus 20.Then proceed to step S31.
In step S31, open the power supply of this computer apparatus 20, so that this computer apparatus 20 is carried out starting up's operation, then proceed to step S32.
In step S32, judge whether this computer apparatus 20 normally carries out initiating task, and be in the operating environment of an operating system 200, if, then proceed to step S33, if not, then return step S31.
In step S33, trigger this test procedure 211 that is stored in the computer apparatus 20 of execution and exported with the interrupt control instruction that generates a correspondence, then proceed to step S34.
In step S34, operate this interrupt control instruction to produce a specific code data 251, in present embodiment, be to utilize interrupt service routine 203 in the Basic Input or Output System (BIOS) be embedded at this computer apparatus 20 carrying out this interrupt control instruction, thereby be 0DAA0H the working storage AX storage values in this computer apparatus 20.Thereafter, utilization sets in advance OEM_INT15 functional module in the bios code database to judge by calling the OEM_Int15Hook function whether the storage values among this working storage AX is a 0DAA0H, if yes, promptly call explicit function oem_show_port80_led_far producing corresponding reveal codes data 251 (as 43h), this code data 251 can be discerned for tester table 22; And utilize the OEM_DiagLED functional module that sets in advance in the bios code database to control the show state that this is mounted on each light emitting diode 2011 on the communication interface 201, particularly, this OEM_DiagLED functional module is can be with the corresponding 01000011b of being converted to of code data 251 (being 43h) that is generated by the OEM_INT15 functional module, and current potential (the 1 expression noble potential of each pin in this GPIO Port 2051 is set respectively according to this; 0 expression electronegative potential), (the pin current potential is that 1 lamp is bright with the show state of controlling 8 light emitting diodes 2011 on this communication interface 201 thus; The pin current potential is that 0 lamp goes out), thus can judge for the tester whether this computer apparatus 20 is normally carried out initiating task and be in the operating environment of operating system 200 according to the show state of LED.Then proceed to step S35.
In step S35, communication interface 201 by this computer apparatus 20 is to transfer to this tester table 22 with this code data 251, to make these tester table 22 statistics and to analyze the code data 251 that is received, thereby draw the report of corresponding test result, and make this computer apparatus 20 withdraw from current operating system 200 simultaneously and be back among the step S31 to re-execute initiating task.In present embodiment, this computer apparatus 20 will repeat starting and withdrawing from operating system 200 of task in 24 hours time period, and this tester table 22 is to be used in this time period of 24 hours, receive and analyze code data 251 standard whether fair symbol is preset that this communication interface 201 is exported, and add up in 24 hours time period the number of times of the code data 251 of fair this preset standard of symbol that this communication interface 201 is exported.Particularly, this method of testing is when carrying out initiating tasks and being in the operating environment of operating system 200 in this computer apparatus of detecting 20 is normal, promptly by this communication interface 201 (being PORT80_LED) with code data 251 (being 43h) to tester table 22 output one appointment, this tester table 22 then can be discerned at the code data 251 that is received, to analyze this code data 251 standard whether fair symbol is preset, if, one counter is carried out once counted operation, thus counting this computer apparatus 20 normal number of times that starts in 24 hours time period, thereby for judging in the computer apparatus 20 the whether requirement up to specification of each hardware members.Moreover this method of testing also is included in this computer apparatus 20 of detecting when withdrawing from operating system 200, promptly can carry out an initialization action to this communication interface 201.
Described before combining, whether test macro of the present invention and method are by the communication interface that is in idle state (for example PORT80_LED) in the computer apparatus (for example computer) and are loaded into interrupt service routine in this computer apparatus, normal with the running that detects each hardware members in this computer apparatus.Because this communication interface PORT80_LED promptly is in idle state after computer apparatus is finished POST, thereby utilize this communication interface PORT80_LED to transmit corresponding test code data, and the LED that is mounted on this communication interface of control gives corresponding demonstration to the code data that this communication interface transmitted, and can make full use of the existing resource of computer apparatus.Moreover, because the system break service routine of computer apparatus can carry out the function expansion, also promptly, the system break service routine can comprise many sub-function module (being the break in service operation), thereby this test jobs module can be turned to a break in service operation of this system break service routine.In addition, by test macro of the present invention and method, need not the additional configuration Debug Card and can be directly tester table and computer apparatus be electrically connected carrying out test jobs, thereby can save testing cost.
The foregoing description is illustrative principle of the present invention and effect thereof only, but not is used to limit the present invention.Any those skilled in the art all can be under spirit of the present invention and category, and the foregoing description is modified and changed.Therefore, the scope of the present invention, claim is listed as described later.