CN101819526B - Method and device for calling bottom software and embedded system - Google Patents
Method and device for calling bottom software and embedded system Download PDFInfo
- Publication number
- CN101819526B CN101819526B CN 200910190239 CN200910190239A CN101819526B CN 101819526 B CN101819526 B CN 101819526B CN 200910190239 CN200910190239 CN 200910190239 CN 200910190239 A CN200910190239 A CN 200910190239A CN 101819526 B CN101819526 B CN 101819526B
- Authority
- CN
- China
- Prior art keywords
- function
- middle layer
- software
- module
- information
- 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.)
- Active
Links
Images
Landscapes
- Telephonic Communication Services (AREA)
Abstract
The invention provides method and device for calling bottom software and an embedded system. The method comprises the following steps of: receiving a calling request of application layer software for a first function; calling a middle layer function to acquire the information of a second function corresponding to the first function in the bottom software; receiving the information of the second function returned by the middle layer function; and calling the second function according to the calling request for the first function and the information of the second function. The function information of functions in the bottom software is acquired by the middle layer function so that the application layer software is needless to acknowledge the function information in the bottom software when calling a function in the bottom software, and the application layer software and the bottom software can be separately compiled, thereby realizing the decoupling of the application layer software and the bottom software.
Description
Technical field
The present invention relates to embedded system technology, particularly the method and apparatus of calling bottom software in the embedded system.
Background technology
Embedded system is used more and more widely, especially in the communications field.Embedded system can be divided into embedded system hardware and built-in system software two large divisions.
The core component of embedded system hardware part is exactly flush bonding processor.Now the kind of flush bonding processor has surpassed kind more than 1000, nearly more than 30 of popular architectures, and the addressing space of flush bonding processor does not wait from 64KB to 2GB yet, and its processing speed can be from 0.1MIPS~2000MIPS etc.In general can be divided into following 4 classes to flush bonding processor:
MPU (Micro Processor Unit) embedded microprocessor; MCU (Micro Controller Unit) embedded microcontroller; DSP embedded processor (Digital Signal Processor); Embedded SOC (system on a chip) (SOC).
The embedded system hardware part also comprises abundant peripheral interface except the flush bonding processor core.The external unit that common peripheral interface connects needs driver normally to move.
In general the built-in system software part can be divided into two parts, application layer software and bottom software.Bottom software mainly comprises embedded OS and hardware-related driver.Bottom software generally can be divided into start-up code (Boot Loader), operating system nucleus and driving (Kernel﹠amp; Driver), several sections such as plate level support package BSP (Board Support Package) file system.
Bottom software and hardware strong correlation, different hardware generally has supporting bottom software.Bottom software supplies the application layer software transfer to drive hardware effort by various interface is provided.
Application layer software is mainly realized professional relevant treatment, realizes business logic, and the interface that provides by bottom software drives hardware effort, finishes certain business processing.
The inventor finds, there are the following problems in the prior art, there are the strong coupling relation in application layer software in the embedded system and bottom software, cause application layer software and bottom software needs to compile together and generate image file, generally, application layer software and bottom software are compiled into veneer .bin file together, form structure as shown in Figure 1.
Summary of the invention
The invention provides a kind of method, device and embedded system of calling bottom software, can reduce the degree of coupling between application layer software and the bottom software.
The embodiment of the invention one embodiment provides a kind of call method of bottom software, comprising:
Receive application layer software and call the first function calls request;
Call the information that the middle layer function obtains second function of corresponding described first function in the bottom software;
Receive the information of second function that described middle layer function returns;
Call described second function according to the described information of calling the first function calls request and described second function.
Another embodiment of the present invention provides a kind of device of calling bottom software, comprising:
Receiver module is used for receiving application layer software and calls the first function calls request;
Adaptation module is used for calling the information that the middle layer function obtains second function of corresponding described first function of bottom software, and receives the information of second function that described middle layer function returns;
Calling module, be used for calling described second function another embodiment of the present invention according to second function information that described receiver module and described adaptation module are returned a kind of embedded system is provided, the device that comprises above-mentioned calling bottom software, the application layer software module, bottom software module and middle layer module;
The device of described application layer software module and described calling bottom software directly is coupled; Described middle layer module and described bottom software module directly are coupled; The device of described calling bottom software calls the function of described bottom software module by described middle layer module.
The technical scheme that the embodiment of the invention provides, obtain the function information of function in the bottom software by the middle layer function, thereby during the function of application layer software in needing calling bottom software, do not need to understand the function information in the bottom software, make application layer software and bottom software separately to compile, realized the decoupling zero of application layer software and bottom software.
Description of drawings
Fig. 1 is the coupled relation figure of bottom software and application layer software in the prior art;
The bottom software that Fig. 2 a provides for one embodiment of the invention and the coupled relation figure of application layer software;
The schematic flow sheet of the call method of the bottom software that Fig. 2 b provides for one embodiment of the invention;
The schematic flow sheet of the call method of the bottom software that Fig. 3 provides for another embodiment of the present invention;
The schematic flow sheet of the call method of the bottom software that Fig. 4 provides for another embodiment of the present invention;
The device synoptic diagram of the calling bottom software that Fig. 5 provides for another embodiment of the present invention;
The structural representation of the embedded system of the device of the application call bottom software that Fig. 6 provides for another embodiment of the present invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing several embodiments of the present invention are done detailed further description.
In an embodiment of the present invention, embedded system is made up of hardware and software, and software specifically can be divided into two-layer, i.e. application layer software and bottom software.Bottom software needs to understand the realization details of hardware mainly towards bottom operation, can directly operate hardware; And application layer software mainly is intended for application, does not need to understand hard-wired details, only need drive hardware effort by the interface that bottom software provides.
See also Fig. 2 a, in the embodiment shown in Fig. 2 a, realized the decoupling zero of application layer software and bottom software.Embedded system shown in Fig. 2 a is made up of two parts image file, and adaptation layer 12 and application layer software 11 are compiled into image file together, and middle layer function 13 and bottom software 14 are compiled into image file together.Below be described in detail its principle.
The interface that application layer software needs calling bottom software to provide, interface are a kind of for the predefined function that is called by application layer software.In the process that code is realized, all adaptive functions corresponding to each interface in the bottom software of definition in adaptation layer, application layer software directly calls the adaptive function that defines in the adaptation layer.In this way, can guarantee that application layer software can compile successfully under the situation that breaks away from bottom software.
Bottom software need provide interface for the application layer software transfer, in the process that realizes bottom software, and definition middle layer function, middle layer function and bottom software compile together.Because the two compiles together, so the middle layer function can find the details of total interface in bottom software in the bottom software.The middle layer function is used for offering the adaptation layer function call, and the actual information of interface in the bottom software is provided to the adaptation layer function.
In the process of application layer software operation, application layer software calls the adaptation layer function of adaptation layer, and the adaptation layer function is then searched the interface message of bottom software by the middle layer function, and calls.Below in conjunction with an example, action by the execution of adaptation layer function, further explain a how interface in the calling bottom software of application layer software, in realization, this interface can be a function, for ease of statement, this interface with bottom software is referred to as bsp_interface_n here.
Embodiment one
Application layer software is by adaptation layer function call bottom software, and this adaptation layer function is expressed as interface_n.See also Fig. 2 b, the adaptation layer function is carried out following action:
S21 receives the call request that application layer software calls interace_n.
The interface_n here is an example of first function.First function is arranged in adaptation layer 12, is a kind of adaptation layer function, can compile together with application layer software 11.
Parameter or instruction that call request is transmitted during for call function.In the C language, call a function form can for interface_n (var1, var2), wherein, interface_n is the title of adaptation layer function, var1 and var2 are function parameters, var1 and var2 are a kind of examples of call request.Be understandable that also can there be parameter in call request, 1 or any a plurality of parameter also can be arranged.
S22 calls the information that the middle layer function obtains the bsp_interface_n of corresponding interface_n in the bottom software.
The bsp_interface_n here is a kind of example of second function, can directly drive hardware effort.Second function is arranged in bottom software, is the interface that provides in the bottom software.
In the present embodiment, second function of corresponding interface_n is bsp_interface_n.Therefore interface_n can call the middle layer function, searches the information of bsp_interface_n in bottom software.
S23, the information of the bsp_interface_n that reception middle layer function returns.
The middle layer function is searched second function information of corresponding first function in bottom software 14, and returns the information of second function.In the present embodiment, bsp_interface_n is an example of second function, and then the middle layer function will return the information of bsp_interface_n.
The information of bsp_interface_n is the information relevant with calling bsp_interface_n, as being the function address of bsp_interface_n, also can be a function pointer that triggers bsp_interface_n, perhaps also can be an interrupt instruction etc.The information of bsp_interface_n can also comprise the parameter that need pass to bsp_interface_n, the version information of bsp_interface_n etc.
S24 calls second function according to the information of the call request of calling interface_n and bsp_interface_n.
In the present embodiment, in the information of the bsp_interface_n that the middle layer function returns, comprise the function address of bsp_interface_n.Then interface_n is with in the call request that receives, and the request that need pass to bsp_interface_n passes to bsp_interface_n as parameter, jumps to the function address of bsp_interface_n, carries out bsp_interface_n.
Exemplary, the information of the bsp_interface_n in the present embodiment comprises interrupt instruction, then carries out the function entrance place that this interrupt instruction jumps to bsp_interface_n, carries out bsp_interface_n by the mode of interrupting.
The method that above-described embodiment provides, obtain the function information of function in the bottom software by the middle layer function, thereby during the function of application layer software in needing calling bottom software, do not need to understand the specifying information of the function in the bottom software, as function address, make application layer software and bottom software separately to compile, realized the decoupling zero of application layer software and bottom software.After application layer software and the bottom software decoupling zero, can obtain following beneficial effect at least.
Bottom software can be compiled into independently version, can issue with hardware binding; Application layer software becomes executable file with adaptation layer compiling link together, separately issue.In addition, the interface in the bottom software of redaction, the interface in also can compatible legacy version bottom software changes and dependence such as following table between the version mutually:
Embodiment two
Below in conjunction with pseudo-code, how to realize method provided by the invention by the further introduction of another embodiment.
See also Fig. 3, among Fig. 3, application layer software and adaptation layer are compiled into a bin file together, are application layer .bin in Fig. 3; Bottom software and middle layer function are compiled into a bin file together, are bottom software .bin in Fig. 3.
Step s31, the function app_func in the application layer software need call interface_n; Then carry out callinterface_n (parameter 1, parameter 2 ...) instruction.Parameter 1, parameter 2 ... Deng being call request.
Step s32, for after the interface_n in the adaptation layer is called, the action that interface_n need carry out.In interface_n, concrete needs are carried out following action: define (* p_interface_n) (...); P_interface_n=call middle layer (n); Call_p_interface_n (...).
Wherein, define (* p_interface_n) (...) is function pointer variable of definition, and this variable is used for the receiver function pointer.
And p_interface_n=call middle layer (n) call the middle layer function to get the function of searching corresponding interface_n in the bottom software, and give function pointer p_interface_n with the function address assignment that obtains.Here n is the another name of adaptation layer function interface_n, passes to the middle layer function as parameter, and the middle layer function obtains the function of corresponding interface_n according to the another name of adaptation layer function.Be understandable that, also interface_n can be passed to the middle layer as parameter.
After calling the middle layer function, program just jumps to the function address of middle layer function, carries out the code of middle layer function, namely enters into step s33.After step 33 is finished, adaptation layer function interface_n will obtain function (the being made as bsp_interface_n here) information of corresponding interface_n, bsp_interface_n is an interface function in the bottom software, can be used for hardware is carried out concrete operation.Then interface_n utilizes function pointer p_interface_n, calls bsp_interface_n.Program can jump to the entry address of bsp_interface_n then, carries out the code of bsp_interface_n, and hardware is carried out concrete operation.
Below provide a kind of example of calling the middle layer function.
Adaptation layer function interface_n at first obtains the function address of middle layer function, and this function address can arrive predefined storage space and obtain, and this storage space can be memory address space, register space etc., perhaps a file.The address of middle layer function before application layer software .bin loads, after bottom software .bin loading, is updated to this storage space by bottom software.
Function pointer of definition is given this function pointer with the function address assignment of middle layer function in interface_n, and the another name of interface_n or interface_n as parameter, is called the middle layer function.
Step s33, middle layer function search in the bottom software according to the parameter of adaptation layer function passes, to function that should parameter, and return this function at the function address of the running space the inside of bottom software.Here, this parameter can be the title of adaptation layer function, or the another name of adaptation layer function.In the present embodiment, that transmission is the another name n of adaptation layer function.
Description by above embodiment can know, by the corresponding interface of definition in adaptation layer, makes application layer software to break away from bottom software and can compile separately; Adaptation layer is searched the actual information of function in the bottom software again by the middle layer function, guarantee that adaptation layer can correctly get access to the actual information of function in the bottom software.By adaptation layer and middle layer function, realized the decoupling zero in adaptation layer and middle layer, thereby bottom software can be compiled into independently version, can issue with hardware binding; Application layer software becomes executable file with adaptation layer compiling link together, separately issue.
Embodiment three
Below provide a kind of embodiment that realizes the adaptation layer function with the C language pseudo code:
A definition function int_bsp_interface_n (int var1, int var2) in the bottom software; The function of finishing in the driving of bottom software drives is as follows: bsp_interface_n (int var1, int var2) { concrete hardware operation ... .}.
In adaptation layer, define one with it corresponding adaptation layer function int interface_n (int var1, intvar2).
The function pointer categorical variable p_func consistent with the bsp_interface_n function performance of an overall situation of definition.The code that interface_n carries out is: int interface_n (in var 1, int var2)
if(NULL!=p_func)
{
return(p_func(var1,var2));
}
else
{
Get access to the address of bsp_interface_n function by the middle layer function, and assignment is given
p_func;
return(p_func(var1,var2));
}
}。
Description by above embodiment can know, by the corresponding interface of definition in adaptation layer, makes application layer software to break away from bottom software and can compile separately; Adaptation layer is searched the actual information of function in the bottom software again by the middle layer function, guarantee that adaptation layer can correctly get access to the actual address of function in the bottom software.By adaptation layer and middle layer function, realized the decoupling zero in adaptation layer and middle layer, thereby bottom software can be compiled into independently version, can issue with hardware binding; Application layer software becomes executable file with adaptation layer compiling link together, separately issue.
Embodiment four
See also Fig. 4, the method flow synoptic diagram of the calling bottom software that provides for another embodiment of the present invention.
S41, application layer software call adaptation layer function interface_n.
For example, application layer software call interface_n mode can for, interface_n (var1, var2).After system carries out this call instruction, will jump to the place, function entrance address of interface_n, carry out the code of adaptation layer function interface_n.
S42, interface_n receives the call request of application layer software.
S43, interface_n call the address that the middle layer function is searched the function of corresponding interface_n in the bottom software.
For example, interface_n as parameter, calls the middle layer function with " interface_n " character string; After the middle layer function is called, search in the bottom software function that should title according to " interface_n ".If search successfully, return success information, and return the address of the function of corresponding interface_n; If search failure, return failure information, and return the malloc failure malloc reason.
Corresponding relation in adaptation layer function and the bottom software between the function can be stored in the configuration file, is loaded in the internal memory by the middle layer function.
Call the middle layer function, can adopt following a kind of example implementation.For example, in predefined address, for example [0x80000] reads the function address of middle layer function, utilizes function pointer to call the middle layer function.Value in [0x80000] address was upgraded by bottom software before load application layer software.
S44, interface_n receive the result that calls that the middle layer function returns.
Receive the result that calls that the middle layer function returns.Comprise among the result and call successful information, execution in step S45 if call; If call and comprise malloc failure malloc information, execution in step S47 among the result.
Return success or failure information by the middle layer function, can verify return whether call the result correct, guarantee the security that code is carried out, avoid function pointer to point to incorrect address space and cause unpredictable consequence; Simultaneously, also can utilize and call successful information or malloc failure malloc information is debugged.
S45, interface_n obtain the function address of bsp_interface_n from call the result.
If in the bottom software, the function of corresponding interface_n is bsp_interface_n, and then this step will obtain the function address of bsp_interface_n in the process space of bottom software.
S46, interface_n utilize function pointer to call bsp_interface_n.
Give function pointer with the function address assignment of bsp_interface_n, adopt the mode of function pointer to call bsp_interface_n.
For example, defined function pointer int (* p) (int var1, int var2); Give p with the function address assignment of bsp_interface_n; (* p) (var1, var2).Here var1 and var2 are the call request of obtaining among the step S42.
S47, interface_n obtain and return malloc failure malloc information from call the result.
For example, malloc failure malloc information may be incompatible version, and perhaps Dui Ying function does not find.
Description by above embodiment can know, by the corresponding interface of definition in adaptation layer, makes application layer software to break away from bottom software and can compile separately; Adaptation layer is searched the actual information of function in the bottom software again by the middle layer function, guarantee that adaptation layer can correctly get access to the actual address of respective function in the bottom software.By adaptation layer and middle layer function, realized the decoupling zero in adaptation layer and middle layer, thereby bottom software can be compiled into independently version, can issue with hardware binding; Application layer software becomes executable file with adaptation layer compiling link together, separately issue.
Embodiment five
See also Fig. 5, the structural representation of the device of a kind of calling bottom software that Fig. 5 provides for another embodiment of the present invention.This device comprises:
Here describe as the example of first function with interface_n, call request can be each parameter that the middle layer passes to interface_n.Here interface_n is arranged in adaptation layer for the device itself with bottom software.
Here describe as a kind of example of second function with bsp_interface_n, bsp_interface_n can directly drive hardware effort.Second function is arranged in bottom software, is the interface that provides in the bottom software.
Adaptation module is called middle layer module, with the actual information of bsp_interface_n in the process space of bottom software that obtains corresponding interface_n.
Middle layer function and bottom software compile together, can be arranged in same image file.Can call for adaptation module 52, the function name that transmits according to adaptation module 52 is searched function that should function name.That adaptation module 52 passes to the middle layer function parameters here can be " interface_n ", can be the another name of interface_n also, as n.
Calling module 53, the information that is used for the bsp_interface_n that returns according to receiver module 51 and adaptation module 52 is called bsp_interface_n.
The bsp_interface_n here is the information relevant with calling bsp_interface_n, specifically sees also the description of method embodiment, repeats no more here.
Exemplary, the information of this bsp_interface_n can be the actual function address of bsp_interface_n.After obtaining the bsp_interface_n function address, can adopt the mode of pointer to call bsp_interface_n.Concrete call method can repeat no more here referring to the description of above-described embodiment.
The device that above-described embodiment provides, obtain the information of the function of bottom software by the middle layer function, thereby during the function of application layer software in needing calling bottom software, do not need to understand the specifying information of the function in the bottom software, as function address etc., make application layer software and bottom software separately to compile, realized the decoupling zero of application layer software and bottom software.
Concrete, adaptation module 52 can comprise following submodule:
Function address acquisition module 521 is for the function address that obtains the middle layer function.
The function address of middle layer function can be stored in the storage space of an appointment in advance, for example memory address, register or a file etc.Pass through to this storage space and read the function address that its value can obtain the middle layer function.
Middle layer function call module 522 is used for another name with interface_n or interface_n as the middle layer function parameters, calls the middle layer function according to the function address of middle layer function.
After the middle layer function receives call request, will according to the parameter of calling search to should parameter second function, during this enforcement is upright, passes to the middle layer function parameters and be the another name n of " interface_n " character string or interface_n, second function is bsp_interface_n.
The second function information acquisition module 523 be used for to receive the information of the bsp_interface_n that middle layer function call module 522 returns.
Concrete, calling module 53 can comprise following submodule:
The assignment module, the function address assignment that is used for bsp_interface_n is given predefined function pointer, and can establish this function pointer here is p.
The pointer calling module is used for parameter that the call request that receiver module 51 receives is comprised as the parameter of function pointer, utilizes function pointer to call bsp_interface_n.In the present embodiment, parameter is var1 and var2, the code that then calls bsp_interface_n for (* p) (var1, var2).
Concrete, the second function information acquisition module 523 may further include following submodule:
Call acquisition module as a result, be used for obtaining the result that calls that middle layer function that middle layer function call module 522 returns returns.
Analysis module is used for analyzing calling the result, comprises and calls successful information if call the result, from calling the information that the result obtains bsp_interface_n; Perhaps, comprise malloc failure malloc information if call the result, receive and return to application layer software and call the failure information that comprises among the result.
Analyze success or the failure information that the middle layer function returns by analysis module, can verify return whether call the result correct, guarantee the security that code is carried out; Simultaneously, also can utilize and call successful information or malloc failure malloc information is debugged.
Embodiment six
See also Fig. 6, the structural representation of a kind of embedded system that Fig. 6 provides for another embodiment of the present invention.
Application layer software module 11 is corresponding to the application layer software 11 of Fig. 2 a, and bottom software module 14 is corresponding to the bottom software 14 of Fig. 2 a, and middle layer module 13 is corresponding to the middle layer function 13 of Fig. 2 a.
Directly coupling refers to the height dependence between the software module.In the present embodiment, middle layer module 13 and bottom software module 14 directly are coupled, and refer to the directly function in the calling bottom software module 14 of middle layer module, and vice versa.The relation of application layer software module 11 and adaptation layer 12, the relation of bottom software module 14, middle layer module 13, and the description of 2a with reference to the accompanying drawings of the relation of adaptation layer 12 and middle layer module 13 do not repeat them here.
The device of the calling bottom software that device 121 provides for embodiment five is positioned at adaptation layer.Be understandable that the device of a plurality of calling bottom softwares can be arranged in the adaptation layer.Each device 121 can be corresponding to the function in the bottom software.
For example, the name of establishing each device 121 is called interface_n, and n can be for 1,2,3... etc.Corresponding to each interface_n, exist bsp_interface_n in the bottom software.This corresponding relation can be kept in the contrast relationship table 15.Be understandable that the corresponding relation of interface_n and bsp_interface_n also can be multi-to-multi.
The contrast relationship of contrast relationship table 15 can load the back by bottom software module 14 and be responsible for renewal, also can be pre-configured.Be understandable that contrast relationship table 15 is an optional feature just, in another embodiment, can be directly safeguard mapping relations between interface_n and the bsp_interface_n by middle layer module 13.
When the function in the application layer software module 11 need drive hardware n and finishes certain work, the interface of this hardware of driving that provides in bottom software module 14 is bsp_interface_n, because application layer software module 11 and adaptation layer 12 compile together, then application layer software module 11 can be directly in the adaptation layer 12 the device interface_n call by passing parameter of calling bottom software.
Device interface_n is parameter call middle layer module 13 with character string interface_n, middle layer module 13 is searched the function of corresponding interface_n in the contrast relationship table 15 according to interface_n, here be bsp_interface_n, obtain the function address of bsp_interface_n in the process space of bottom software, the function address of bsp_interface_n is returned to device interface_n.
Be understandable that, device interface_n may be arranged in different compiling files with middle layer module 13, therefore interface_n cannot directly call middle layer module 13, thereby need call middle layer module 13 by the mode of function pointer or interruption.
The function address that device interface_n returns according to middle layer module 13 is with the parameter call bsp_interface_n of application layer software module 11 transmission.And will call the result and feed back to application layer software module 11.
If middle layer module 13 is returned failure information, then interface_n directly feeds back to failure information application layer software module 11, and application layer software module 11 is handled accordingly according to error message.
The system that above-described embodiment provides, obtain the information of the function in the bottom software module by adaptation layer and middle layer module, thereby the application layer software module is when needing function in the calling bottom software module, do not need to understand the specifying information of the function in the bottom software module, make application layer software thanks to can separately not compile with the bottom software module, separately realize, realized the decoupling zero of application layer software module and bottom software module.
The some or all of of the above inventive embodiments can be realized by program or by the corresponding hardware of programmed instruction, corresponding software can be stored in the read/write memory medium of computing machine, and described storage medium can be ROM/RAM, hard disk, CD or floppy disk.
The above only is preferred embodiment of the present invention; in order to limit the present invention, for those skilled in the art, within the spirit and principles in the present invention not all; any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (7)
1. the call method of a bottom software is characterized in that, described method comprises:
Receive application layer software and call the first function calls request;
Call the information that the middle layer function obtains second function of corresponding described first function in the bottom software;
Receive the information of second function that described middle layer function returns;
Call described second function according to the described information of calling the first function calls request and described second function;
Describedly call the information that the middle layer function obtains in the bottom software second function of corresponding described first function, comprising:
Obtain the function address of described middle layer function;
With the another name of described first function or described first function as described middle layer function parameters, call described middle layer function according to described function address, so that described middle layer function, is searched the information of second function of corresponding described first function in the described bottom software according to the another name of described first function or described first function;
The information of described second function comprises the function address of described second function;
Describedly call described second function according to the described information of calling the first function calls request and described second function, comprising:
Give predefined function pointer with the function address assignment of described second function;
The parameter that the described first function calls request is comprised utilizes described function pointer to call described second function as the parameter of described function pointer.
2. the call method of bottom software as claimed in claim 1 is characterized in that, the information of second function that the described middle layer of described reception function returns comprises:
Obtain the result that calls that described middle layer function returns;
Call successful information if the described result of calling comprises, obtain the information of described second function from the described result of calling.
3. the call method of bottom software as claimed in claim 1 is characterized in that, described method also comprised before the function address that obtains described middle layer function,
After described middle layer function loads, the function address of described middle layer function is write in default memory address or the default file;
The described function address that obtains described middle layer function comprises,
From described default memory address or described default file, read the function address of described middle layer function.
4. the device of a calling bottom software is characterized in that, described device comprises:
Receiver module is used for receiving application layer software and calls the first function calls request;
Adaptation module is used for calling the information that the middle layer function obtains second function of corresponding described first function of bottom software, and receives the information of second function that described middle layer function returns;
Calling module is used for calling described second function according to second function information that described receiver module and described adaptation module are returned;
Described adaptation module comprises:
The function address acquisition module is for the function address that obtains described middle layer function;
Middle layer function call module, be used for another name with described first function or described first function as described middle layer function parameters, call described middle layer function according to described function address, so that described middle layer function, is searched the information of second function of corresponding described first function in the described bottom software according to the another name of described first function or described first function;
The second function information acquisition module be used for to receive the information of described second function that described middle layer function call module returns;
The information of described second function comprises the function address of described second function, and described calling module comprises:
The assignment module is used for giving predefined function pointer with the function address assignment of described second function;
The pointer calling module is used for parameter that the call request that described receiver module receives is comprised as the parameter of described function pointer, utilizes described function pointer to call described second function.
5. the device of calling bottom software as claimed in claim 4 is characterized in that, the described second function information acquisition module comprises:
Call acquisition module as a result, be used for obtaining the result that calls that middle layer function that described middle layer function call module returns returns;
Analysis module comprises and calls successful information if be used for the described result of calling, and obtains the information of described second function from the described result of calling.
6. the device of calling bottom software as claimed in claim 4, it is characterized in that, described function address acquisition module specifically is used for, read the function address of described middle layer function from default memory address or default file, described function address is to be written in described default memory address or the described default file after described middle layer function loads.
7. an embedded system is characterized in that, comprises the device as the described arbitrary calling bottom software of claim 4-6, application layer software module, bottom software module and middle layer module;
The device of described application layer software module and described calling bottom software directly is coupled; Described middle layer module and described bottom software module directly are coupled;
The device of described calling bottom software calls the function of described bottom software module by described middle layer module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910190239 CN101819526B (en) | 2009-09-18 | 2009-09-18 | Method and device for calling bottom software and embedded system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910190239 CN101819526B (en) | 2009-09-18 | 2009-09-18 | Method and device for calling bottom software and embedded system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101819526A CN101819526A (en) | 2010-09-01 |
CN101819526B true CN101819526B (en) | 2013-08-28 |
Family
ID=42654641
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200910190239 Active CN101819526B (en) | 2009-09-18 | 2009-09-18 | Method and device for calling bottom software and embedded system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101819526B (en) |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102566996B (en) * | 2010-12-20 | 2015-04-01 | 中兴通讯股份有限公司 | Method and system for realizing multi-task management input and output resources |
CN102520957A (en) * | 2011-12-19 | 2012-06-27 | 厦门雅迅网络股份有限公司 | Method for software separation design of embedded system |
CN104023260B (en) * | 2013-02-28 | 2018-04-27 | 腾讯科技(深圳)有限公司 | Hardware decoding realization method, device and player |
CN104951289A (en) * | 2014-03-28 | 2015-09-30 | 中国移动通信集团公司 | Method and system for calling system bottom layer function |
CN105446714B (en) * | 2014-08-14 | 2019-03-15 | 阿里巴巴集团控股有限公司 | Interface call method and device |
CN105577709B (en) * | 2014-10-09 | 2019-01-29 | 阿里巴巴集团控股有限公司 | Service publishing method and server |
CN105260246A (en) * | 2015-11-10 | 2016-01-20 | 中国建设银行股份有限公司 | Method and device for calling application system |
CN108132816B (en) * | 2016-12-01 | 2020-12-18 | 腾讯科技(深圳)有限公司 | Method and device for realizing local framework layer calling in application |
CN108205452B (en) * | 2016-12-16 | 2021-05-18 | 北京小米移动软件有限公司 | Software execution control method and device |
CN108984223B (en) * | 2018-05-31 | 2021-04-02 | 北京三快在线科技有限公司 | Program call decoupling method and device, electronic equipment and storage medium |
CN108920289B (en) * | 2018-07-03 | 2022-09-16 | 上海仪电汽车电子系统有限公司 | Data processing method of vehicle-mounted controller and vehicle-mounted controller |
CN110413327B (en) * | 2019-07-16 | 2022-07-19 | 创新先进技术有限公司 | Hardware driving method and device based on hardware abstraction layer |
CN110851138A (en) * | 2019-11-06 | 2020-02-28 | 山东超越数控电子股份有限公司 | BMC software development method for separating kernel and application |
CN111935126A (en) * | 2020-08-05 | 2020-11-13 | 深圳市明泰智能技术有限公司 | Industrial equipment networking protocol library |
CN112416308B (en) * | 2020-11-30 | 2024-08-09 | 上海汽车集团股份有限公司 | Software optimization method and device and software architecture |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1490724A (en) * | 2002-10-18 | 2004-04-21 | 上海贝尔有限公司 | Virtual machine for embedded systemic software development |
US6983460B1 (en) * | 1999-11-17 | 2006-01-03 | Cp8 Technologies | Method for loading applications into a multiapplication embedded system equipped with data processing resources, corresponding embedded system and execution method |
CN101178653A (en) * | 2007-12-03 | 2008-05-14 | 北京中星微电子有限公司 | Embedded system and method supporting various processor |
-
2009
- 2009-09-18 CN CN 200910190239 patent/CN101819526B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6983460B1 (en) * | 1999-11-17 | 2006-01-03 | Cp8 Technologies | Method for loading applications into a multiapplication embedded system equipped with data processing resources, corresponding embedded system and execution method |
CN1490724A (en) * | 2002-10-18 | 2004-04-21 | 上海贝尔有限公司 | Virtual machine for embedded systemic software development |
CN101178653A (en) * | 2007-12-03 | 2008-05-14 | 北京中星微电子有限公司 | Embedded system and method supporting various processor |
Also Published As
Publication number | Publication date |
---|---|
CN101819526A (en) | 2010-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101819526B (en) | Method and device for calling bottom software and embedded system | |
CN100476721C (en) | Methods and apparatus to provide a modular native method invocation system, and system thereof | |
US9766867B2 (en) | Systems and methods for improving performance of mobile applications | |
US7669186B2 (en) | Debugging applications at resource constrained virtual machines using dynamically installable lightweight agents | |
CN100555218C (en) | Be used to improve the apparatus and method of the simulation velocity of the middle-and-high-ranking language of analogue system on the sheet | |
CN1224903C (en) | Module-by-module verification | |
CN1203404C (en) | Full-delay interlinkage with module-by-module verification | |
CN100562847C (en) | A kind of apparatus for establishing method of driving, device drives device and veneer | |
US20030084431A1 (en) | Intermediate code execution system, intermediate code execution method, and computer program product for executing intermediate code | |
CN102667714B (en) | Support the method and system that the function provided by the resource outside operating system environment is provided | |
CN113110859A (en) | Embedded terminal remote online development system | |
US8752056B2 (en) | Running native code across single or multi-core hybrid processor achitecture | |
CN116643778B (en) | Application program optimization method and electronic equipment | |
CN1877521A (en) | Method for accomplishing embedded system board support package across different operating system | |
CN1162770C (en) | Soft ware installation concerned with hardware | |
CN1169046C (en) | Total delay chaining | |
CN109542464A (en) | Development deployment system, method and the storage medium of IoT equipment shell script | |
CN100349121C (en) | Embedded type parallel computation system and embedded type parallel computing method | |
CN114816491A (en) | System upgrading method and device for multi-system mobile terminal and terminal | |
CN114519582B (en) | Service preheating method, preheating device and service system | |
US20040015943A1 (en) | Embedded computer system equipped with an upgradeable software library | |
Moon et al. | SYZYGY-a framework for scalable cross-module IPO | |
CN112650512A (en) | Hardware driving method and device, terminal and storage medium | |
CN102591669A (en) | Modularized computer firmware and realizing method thereof | |
US20060277164A1 (en) | Apparatus, system, and method for scanning a partitioned data set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |