CN101436134A - Method and system for setting state of hardware apparatus - Google Patents

Method and system for setting state of hardware apparatus Download PDF

Info

Publication number
CN101436134A
CN101436134A CNA2007101655689A CN200710165568A CN101436134A CN 101436134 A CN101436134 A CN 101436134A CN A2007101655689 A CNA2007101655689 A CN A2007101655689A CN 200710165568 A CN200710165568 A CN 200710165568A CN 101436134 A CN101436134 A CN 101436134A
Authority
CN
China
Prior art keywords
hardware unit
hardware
sign indicating
indicating number
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2007101655689A
Other languages
Chinese (zh)
Inventor
张峰嘉
周廉峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advantech Co Ltd
Original Assignee
Advantech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advantech Co Ltd filed Critical Advantech Co Ltd
Priority to CNA2007101655689A priority Critical patent/CN101436134A/en
Publication of CN101436134A publication Critical patent/CN101436134A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a method and a system for setting states of hardware devices. The system comprises a memory, an application program, a general driver and a basic input-output system, wherein the application program sends out a requirement setting instruction and presets a definition content in the memory; after obtaining the requirement setting instruction, the general driver obtains a header file from a certain block in the basic input-output system and sets a sequence index code, and then sends out a control right transferring code according to the correct header file; and the basic input-output system obtains the control right transferring code, sets a corresponding hardware device according to the control right transferring code and the definition content in the memory, and stores the state data of the hardware device back into the memory so as to be captured by the application program.

Description

The setting state method and system of hardware unit
Technical field
The present invention relates to a kind of setting state method of hardware unit, be meant that especially a kind of use one general driving program is used as the establishing method of linking up between application end and the hardware end.
Background technology
In general operating system, the user is not easy the state of direct access hardware in operating system, removes nonsystematic and has the driver that can support this hardware.For example, when the user want from an embedded system by the GPIO on the motherboard reach a special key state or to control a LED luminous, then embedded system needs one to have the status data that the driver that can support GPIO removes direct access GPIO, and then obtains special key state or the luminous purpose of control LED by GPIO.
Yet, in the utilization of reality, can support specific hardware to remove to reach the driver of specific function, all have its unicity with unique, and this characteristic allows other user understand and to use.Simultaneously, have unique driver and do not pass through suitable test process usually, so in utilization, if there is not careful use, the infringement of hardware usually can take place, thereby not have security.
Aforesaid situation can occur in usually system combination during, comprised the integration of universal input-output unit (GPIO), internal integrated circuit device (I2C), System Management Bus (SM-Bus), backlight arrangement (Black-Light), brightness adjusting device (Bright), house dog time set (Watchdog timer) and monitoring arrangement (Hard-Monitor) etc.
Summary of the invention
In view of this, the invention provides the setting state method of a hardware unit, by a general driving program as the application end of system by the communication interface between Basic Input or Output System (BIOS) (BIOS) and each hardware, this kind technical characterictic can be used for improving tradition needs the shortcoming of a plurality of special driver with each hardware of the corresponding control of difference, in addition, because the recycling of bios program code significantly reduces the system development time-histories.Can integrate all kinds of special hardware to reach every specific function via the general driving program that the present invention uses.
Method step of the present invention includes: at first, the user can carry out an application program and require setting command in order to send one, and a definition content is left in the internal memory.Then, a general driving program is accepted this and is required setting command, and promptly a certain block from basic input and output is obtained a header file and set a sequence index sign indicating number, and judges whether this header file is correct.In aforementioned judgement, if this header file is correct header file, then this driver is understood this sequence index sign indicating number of computing, and sends a control branch code and give a Basic Input or Output System (BIOS).Then, Basic Input or Output System (BIOS) can be according to definition content setting one hardware unit in this control branch code, sequence index sign indicating number and this internal memory, and the status data of this hardware unit is returned deposit this internal memory.At last, the user obtains the status data of hardware unit from this internal memory by this application program.
The setting state system of hardware unit provided by the invention includes an internal memory, an application program, a general driving program and a Basic Input or Output System (BIOS).Wherein, application program system sends one and requires setting command, and a default definition content is in this internal memory.The general driving program obtains this and requires setting command, and requires setting command according to this, and a certain block from Basic Input or Output System (BIOS) is obtained a header file and a sequence index sign indicating number, and according to this correct header file, sends a control branch code.Basic Input or Output System (BIOS) obtains this control branch code, and according to the corresponding hardware unit of definition content control in control branch code and this internal memory, and the status data of this hardware unit is returned deposit in this internal memory.Whereby, this application program can obtain the state of this hardware unit by this internal memory.
So, by aforesaid method step and system, the present invention can be easily and the application end that system is provided of safety and the communication between each hardware, comprised reading of the setting state of each hardware unit and each hardware state etc.Simultaneously, by the use by the general driving program, the present invention can reach the purpose that rapid system is integrated.
Above general introduction and ensuing detailed description are all exemplary in nature, are in order to further specify protection scope of the present invention.And about other purpose of the present invention and advantage, will be set forth in follow-up explanation and accompanying drawing.
Description of drawings
Fig. 1 is a system architecture block schematic diagram of the present invention; And
Fig. 2 is a schematic flow sheet of the present invention.
[main element description of reference numerals]
Application program 10
Internal memory 12
Buffer zone 122
Working area 124
General driving program 14
Basic Input or Output System (BIOS) 16
Hardware unit 18
Require setting command D1
Header file D2
Sequence index sign indicating number D3
Control branch code D4
Embodiment
See also Fig. 1, be system architecture block schematic diagram of the present invention.Disclose the system architecture that relevant establishing method of the present invention is suitable at Fig. 1.In this system architecture, include an application program 10, an internal memory 12, a general driving program 14 and a Basic Input or Output System (BIOS) 16.Wherein, internal memory 12 is provided with a buffer zone 122 and a working area 124.
Multiple with reference to figure 1, when application program 10 will be with a definition content setting in this hardware unit, and when obtaining the state of this hardware unit, application program 10 need be sent one and require setting command D1 to give this general driving program 14, and should define content and be placed in internal memory 12 buffer zones 122.This general driving program 14 can require setting command D1 according to this, scans this internal memory 12, and obtain a header file D2 and a sequence index sign indicating number D3 from the working area 124 of this internal memory 12.This general driving program 14 can judge whether this header file D2 is correct earlier, if header file D2 is correct, this sequence index sign indicating number of computing D3 more then is to send a control branch code D4 to Basic Input or Output System (BIOS) 16.
At this moment, Basic Input or Output System (BIOS) 16 obtains the control of system, and, and the status data of this hardware unit 18 returned in the buffer zone 122 of depositing this internal memory 12 according to the corresponding hardware unit 18 of the definition content control in control branch code D4 and this buffer zone 122.So, application program 10 just can will define content setting in this hardware unit 18, and the state of being obtained hardware unit 18 by Basic Input or Output System (BIOS) 16 fast.
Next, with a GPIO hardware as an illustration.In general, the I/O state of GPIO hardware is usually in promptly being stored in Basic Input or Output System (BIOS) 16 behind the system boot.The user is if will reset the I/O state of GPIO hardware, then need operate application program 10 of the present invention, to pass through general driving program 14, ask the service of Basic Input or Output System (BIOS) 16 dynamically, and set GPIO hardware predefined definition content.In addition, the application program 10 I/O state of the GPIO hardware that Basic Input or Output System (BIOS) 16 sends back to that from internal memory 12, reads back again.
So, method of the present invention system utilizes the resource of the Basic Input or Output System (BIOS) 14 that a general driving program 14 of being made up of C language (C language) and is made up of assembly language (assembly language), so that the safe interface of various application programs 10 and 18 communications of corresponding hardware unit to be provided, simultaneously, can integrate all kinds of special hardware units 18 to reach a certain specific function.
Cooperate Fig. 1,, be schematic flow sheet of the present invention with reference to figure 2.The setting state method of hardware unit of the present invention is applicable in the system architecture of earlier figures 1, the steps include: at first, and the user can be by carrying out specific application program 10 (Application ProgrammingInterface; API) require setting command D1 in order to send one, and provide a definition content to deposit the setting data of hardware unit 18.
Then, general driving program 14 is accepted this and is required setting command D1, and from the working area 124 of this internal memory 12, obtain a header file D2 and a sequence index sign indicating number D3 (102), wherein the original sections address of this header file D2 is F000H, and this sequence index sign indicating number D3 includes a hardware class index code, a feature index classification sign indicating number and a sign indicating number that reserves index.
In addition, in the method for the invention, this hardware class sign indicating number definition has following classification: a universal IO interface (GPIO), an internal integrated circuit interface (I2C), a System Management Bus (SM-Bus), a backlight Black-Light, a brightness interface (Bright), a house dog (Watchdog) and a monitoring interface (Hard-Monitor).Sign indicating number is a corresponding feature index classification sign indicating number respectively, and wherein, this feature index classification sign indicating number should define content corresponding to an incident address with corresponding in this buffer zone of index.Simultaneously, to a feature index classification sign indicating number should be arranged, this feature index classification sign indicating number should define content corresponding to an incident address in order to corresponding in this buffer zone 122 of index to aforementioned each hardware class sign indicating number respectively.
Then, general driving program 14 can judge whether the data of this header file D2 are correct earlier, is step S104.In aforementioned determining step S104, if the data of header file D2 are correct, then general driving program 14 is understood and then sequence of operations index code D3, and sends control branch code D4 and give Basic Input or Output System (BIOS) 16, is step S106.Otherwise if the data of header file D2 are incorrect, then this general driving program 14 stops action, and gets back to step S100.At this, this control branch code D4 includes a hardware identification code and a control code.
Next, Basic Input or Output System (BIOS) 16 obtains this hardware identification code and this control code, and select corresponding hardware device 18 according to hardware identification code, and should define content according to this control code and delivered to corresponding hardware device 18, and the status data of corresponding hardware device 18 returned in the buffer zone 122 of depositing internal memory 12, be step S108.At last, the user to obtain the status data of this hardware unit 18 from this buffer zone 122, is step S109 by this application program 10.
Cooperate Fig. 1, reference table one, wherein header file D2 definition has an identification code SuSi_Signature, a header length SuSi_HeaderSize... etc., shown in following table one.
SUSI_HEADER?STRUC
SuSi_Signature DB”$SuSi$”;signature
SuSi_HeaderSize DW? ;Size?of?the?SUSI?Header
SuSi_SupportFlag DW? ;Size?of?the?SUSI?Header
SuSi_HeaderCHKSum DB?
SuSi_SMI_Num DB?
SuSi_SMI_CMD DW?
SuSi_LaterVersion DW? ;Later?version?of?SUSI
SuSi_SupportDevice DD? ;Which?device?is?supported?on?the?platform?
SUSI_HEADER?ENDS
Table one
Simultaneously, general driving program 10 request Basic Input or Output System (BIOS)s service 16 can in the bank assembly routine, shown in following table two.
Example
mov ax,seg?SUSI_Node
mov ds,ax
mov si,offset?SUSI_Node
mov dx,seg?Buffer
mov es,di
mov di,offset?SuSi_Buff
mov ah,0; ah:device?number=0
mov al,byte?ptr?ds:[si].SuSi_SMI_Num
mov dx,word?ptr?ds:[si],SuSi_SMI_CMD
out dx,al
Table two
In addition, the classification of hardware class sign indicating number definition includes: check SUSI support, GPIO...Hard-Monitor etc., and as follows.
0-check?SUSI?support
1-GPIO
2-I2C
3-SMBus
4-BackLight
5-Bright
6-WatchDog
7-Hardware?Monitor
In addition, to a feature index classification sign indicating number should be arranged, it is as follows to enumerate the GPIO classification respectively for each hardware class sign indicating number.
0x0000-SusiIOQueryMask
0x0001-SusiIOGetDirection
0x0002-SusiIOSetDirection
0x0003-SusiIORead
0x0004-SusiIOWrite
Wherein, each feature index classification sign indicating number corresponding to corresponding in the buffer zone should definition content, shown in the definition of enumerating the GPIO classification thes contents are as follows.
■ SusiIOQueryMask
Input:
None
Output:
SuSi_Buff+0-8bytes,for?GPIO?pin?mask
■ SusiIOGetDirection
Input:
None
Output:
SuSi_Buff+0-8bytes,for?GPIO?pin?direction(0:Out,1:In)
SuSi_Buff+8-8bytes,for?pin?direction?property(0:can?not?change,1:can?be?change)
■ SusiIOSetDirection
Input:
SuSi_Buff+0-8bytes,for?pin?direction?would?be?write(0:Out,1:In)
Output:
None
■ SusiIORead
Input:
None
Output:
SuSi_Buff+0-8bytes,for?pin?status(0:Low,1:High)
■ SusiIOWrite
Input:
SuSi_Buff+0-8?bytes,for?pin?status?would?be?write(0:Low,1:High)
Output:
None
In sum, the setting state method of hardware unit provided by the invention, be as the application end of system and the communication interface between each hardware by a general driving program, this kind technical characterictic can be easily and the application end that system is provided of safety and the communication between each hardware, and this communication has comprised reading of the setting state of each hardware unit and each hardware state etc.
Simultaneously, by the use of general driving program, the present invention can reach the purpose of system combination, can be used for improving the shortcoming that tradition needs a plurality of respective hardware drivers, and saves function overlapping development time-histories between operating system and BIOS.
Appended accompanying drawing only provides reference and explanation usefulness, is not to be used for the present invention is limited.But the above only is a preferable possible embodiments of the present invention; non-so promptly limit to protection scope of the present invention; therefore the equivalent structure done of every utilization instructions of the present invention and accompanying drawing content changes, and all in like manner is contained within protection scope of the present invention explanation hereby.

Claims (10)

1. the setting state method of a hardware unit is characterized in that step includes:
A. carry out an application program, require setting command, and a definition content is left in the internal memory in order to send one;
B. require setting command according to this, obtain a header file and a sequence index sign indicating number in a certain block of a general driving program from a Basic Input or Output System (BIOS), and judge whether this header file is correct;
If c. correct, this sequence index sign indicating number of this general driving sequential operation then, and send a control branch code and give this Basic Input or Output System (BIOS); And
D. according to this control branch code, this Basic Input or Output System (BIOS) obtains this definition content in this internal memory, and according to this definition content one hardware unit is set, and the status data of this hardware unit is returned deposit this internal memory.
2. the setting state method of hardware unit as claimed in claim 1, it is characterized in that, in step a, this definition content leaves in the buffer zone of this internal memory, in step b, this header file and sequence index sign indicating number leave in the working area of this internal memory, wherein the original sections address of this header file is F000H, if this header file is incorrect, then this general driving program stops action, and, after steps d, carry out this application program, from this internal memory, to obtain this status data of this hardware unit.
3. the setting state method of hardware unit as claimed in claim 2, it is characterized in that, this sequence index sign indicating number includes a hardware class index code, one feature index classification sign indicating number and one sign indicating number that reserves index, this hardware class index code includes a universal IO interface, one internal integrated circuit interface, one System Management Bus, one backlight, one brightness interface, one house dog and a monitoring interface, this feature index classification sign indicating number is corresponding to an incident address, should define content with corresponding in this buffer zone of index, this control branch code comprises a hardware identification code and a control code.
4. the setting state method of hardware unit as claimed in claim 3, it is characterized in that, this Basic Input or Output System (BIOS) is selected this hardware unit according to this hardware identification code, and, define this hardware unit of content control according to this control branch code and this, and this status data of this hardware unit is returned in this buffer zone of depositing this internal memory.
5. the setting state method of hardware unit as claimed in claim 1 is characterized in that, this general driving program is a C programmer.
6. the setting state system of a hardware unit is characterized in that, in order to the state of access one hardware unit; Include:
One internal memory;
One application program is sent one and is required setting command, and a default definition content is in this internal memory;
One general driving program obtains this and requires setting command, and requires setting command according to this, and a certain block from this Basic Input or Output System (BIOS) is obtained a header file and a sequence index sign indicating number, and according to this correct header file, sends a control branch code; And
One Basic Input or Output System (BIOS) obtains this control branch code, and according to the corresponding hardware unit of control branch code and this definition content control, and the status data of this hardware unit is returned deposit in this internal memory;
Whereby, this application program can obtain the state of this hardware unit by this internal memory.
7. the setting state system of hardware unit as claimed in claim 6, it is characterized in that this internal memory includes a buffer zone and a working area, this definition content is stored in this buffer zone, this header file and this sequence index sign indicating number are stored in this working area, and the original sections address of this header file is F000H.
8. the setting state system of hardware unit as claimed in claim 7, it is characterized in that, this sequence index sign indicating number includes a hardware class index code, one feature index classification sign indicating number and one sign indicating number that reserves index, this hardware class index code includes a universal IO interface, one internal integrated circuit interface, one System Management Bus, one backlight, one brightness interface, one house dog and a monitoring interface, this feature index classification sign indicating number is corresponding to an incident address, should define content with corresponding in this buffer zone of index, this control branch code comprises a hardware identification code and a control code.
9. the setting state system of hardware unit as claimed in claim 8 is characterized in that, this Basic Input or Output System (BIOS) is controlled this hardware unit according to this hardware identification code.
10. the setting state system of hardware unit as claimed in claim 8 is characterized in that, this Basic Input or Output System (BIOS) should define content and deliver to this hardware unit according to this control code, and the status data of this hardware unit is returned deposit in this internal memory.
CNA2007101655689A 2007-11-12 2007-11-12 Method and system for setting state of hardware apparatus Pending CN101436134A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101655689A CN101436134A (en) 2007-11-12 2007-11-12 Method and system for setting state of hardware apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101655689A CN101436134A (en) 2007-11-12 2007-11-12 Method and system for setting state of hardware apparatus

Publications (1)

Publication Number Publication Date
CN101436134A true CN101436134A (en) 2009-05-20

Family

ID=40710583

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101655689A Pending CN101436134A (en) 2007-11-12 2007-11-12 Method and system for setting state of hardware apparatus

Country Status (1)

Country Link
CN (1) CN101436134A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347474A (en) * 2018-09-28 2019-02-15 深圳忆联信息系统有限公司 Signal sequence configuration method, device, computer equipment and storage medium
CN111443592A (en) * 2020-03-24 2020-07-24 上海卫星工程研究所 Method and system for transmitting control right state of equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347474A (en) * 2018-09-28 2019-02-15 深圳忆联信息系统有限公司 Signal sequence configuration method, device, computer equipment and storage medium
CN111443592A (en) * 2020-03-24 2020-07-24 上海卫星工程研究所 Method and system for transmitting control right state of equipment

Similar Documents

Publication Publication Date Title
CN1085864C (en) Add-in board with enable/disable expansion ROM for PCI bus computer
CN106598632B (en) Firmware upgrading method and device for optical module
CN1126044C (en) Add-in board with programmable configuration registers for PCI bus computer
US10261698B2 (en) Systems and methods for hardware-based raid acceleration for variable-length and out-of-order transactions
CN1723427A (en) Physical presence determination in a trusted platform
US9779047B2 (en) Universal intelligent platform management interface (IPMI) host to baseboard management controller (BMC) communication for non-x86 and legacy free systems
US7921230B2 (en) USB devices pre-configuration for KVM switch
CN1303545C (en) Aggregation of hardware events in multi-node systems
CN101872308A (en) Memory bar control system and control method thereof
CN101116065A (en) Dma chain
US6904484B1 (en) Low pin count (LPC) firmware hub recovery
US7942325B2 (en) Optimized smart card driver performance
CN101436134A (en) Method and system for setting state of hardware apparatus
CN107908578A (en) The general DMA transfer method driven based on PXIe buses and VISA
US20040236923A1 (en) Variable sized flash memory in PCI
KR20150072963A (en) Multisystem, and method of booting the same
CN111737178A (en) Computer memory forensics method and equipment and memory forensics analysis system
CN104615558A (en) Data transferring method and electronic device
CN101452417B (en) Monitor method and monitor device thereof
CN1767544B (en) Slave device in information processing system, operation control program for slave device, and operation control method for slave device
US11762976B2 (en) USB mass storage device access control method and access control apparatus
CN115981971A (en) Lighting method of server hard disk and server
US20110200059A1 (en) BIT Inversion For Communication Interface
KR100671046B1 (en) Application program install system and method using usb
CN113076273B (en) Component access method, device, electronic equipment, storage medium and program product

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20090520