CN104503738A - Parameter transferring method, single-broad loader, single broad and single-broad simulator - Google Patents

Parameter transferring method, single-broad loader, single broad and single-broad simulator Download PDF

Info

Publication number
CN104503738A
CN104503738A CN201410710191.0A CN201410710191A CN104503738A CN 104503738 A CN104503738 A CN 104503738A CN 201410710191 A CN201410710191 A CN 201410710191A CN 104503738 A CN104503738 A CN 104503738A
Authority
CN
China
Prior art keywords
executable program
veneer
operational factor
described executable
supplemental characteristic
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.)
Granted
Application number
CN201410710191.0A
Other languages
Chinese (zh)
Other versions
CN104503738B (en
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.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410710191.0A priority Critical patent/CN104503738B/en
Publication of CN104503738A publication Critical patent/CN104503738A/en
Application granted granted Critical
Publication of CN104503738B publication Critical patent/CN104503738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Tests Of Electronic Circuits (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The embodiment of the invention provides a parameter transferring method, a single-broad loader, a single broad and a single-broad simulator. The parameter transferring method comprises the following steps: invoking a command line parameter, wherein the command line parameter carries an identifier of an executable program and a running parameter of the executable program; analyzing the command line parameter so as to acquire the identifier of the executable program and the running parameter of the executable program; loading the executable program according to the identifier of the executable program, wherein the executable program comprises a parameter data segment; writing the running parameter of the executable program into the parameter data segment of the loaded executable program; sending the loaded executable program to a remote single broad. In the parameter transferring method, by writing the running parameter of the executable program into the parameter data segment of the executable program, the single broad can initialize the running parameter of the executable program according to information of the parameter data segment of the executable program, so that parameter transfer of a Main function in the single broad is supported.

Description

Parameter transfer method, veneer loader, veneer and veneer emulator
Technical field
The present invention relates to computer realm, more specifically, relate to a kind of parameter transfer method, veneer loader, veneer and veneer emulator.
Background technology
From PC directly to run executable program different, in order to application program needs from local loader loading application programs on veneer, local loader is according to standard executable files format analysis application program, then by serial ports or JTAG passage, application program is copied to long-range veneer, then veneer performs executable program from the entry address provided.On universal PC, application program can obtain operational factor by resolve command row, and veneer directly performs from program entry address, cannot obtain command line parameter.
Tensilica company provides a sets of plan and is supported in and veneer emulator supports Main function passes ginseng.The solution of Tensilica company is to provide the other a set of libc supporting with veneer emulator, passes ginseng by the mode support application program Main function of pseudoinstruction (in real hardware non-existent instruction).This scheme needs maintenance two cover to need maintenance two to overlap libc, disunity, and safeguard complicated, and require that veneer emulator realizes pseudoinstruction, operational factor transmission do not supported by the veneer under real hardware environment.
How realizing supporting operational factor transmission in the veneer under real hardware environment, is problem to be solved by this invention.
Summary of the invention
The invention provides a kind of parameter transfer method, veneer loader, veneer and veneer emulator, can realize at the Parameter transfer supporting Main function in veneer.
First aspect, proposes a kind of veneer loader, and this veneer loader comprises: call unit, and for call instruction line parameter, wherein, this command line parameter carries the operational factor of executable program mark and this executable program; Resolution unit, for resolving this command line parameter with the operational factor of the mark and this executable program that obtain this executable program; Be loaded into unit, for loading this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section; Data write unit, for writing the supplemental characteristic section in this executable program of having loaded by the operational factor of this executable program; Output unit, for sending to long-range veneer by this executable program loaded.
In conjunction with first aspect, in the implementation that the first is possible, be implemented as: the form of this executable program is ELF.
In conjunction with the first possible implementation of first aspect or first aspect, in the implementation that the second is possible, be implemented as: this executable program loaded is sent to long-range veneer specifically for being organized jtag interface or serial ports by joint test behavior by this output unit.
Second aspect, proposes a kind of veneer, and this veneer comprises: input block, for receiving the executable program that long-range veneer loader sends, carries the operational factor of this executable program in the supplemental characteristic section of this executable program; Initialization unit, for the supplemental characteristic section according to this executable program, the operational factor of this executable program of initialization.
In conjunction with second aspect, in the implementation that the first is possible, this input block is specifically for receiving this executable program by jtag interface or serial ports.
In conjunction with the first possible implementation of second aspect or second aspect, in the implementation that the second is possible, this initialization unit is also for other correlation beyond operational factor in this executable program of initialization; This veneer also comprises: performance element, for performing this executable program.
The third aspect, proposes a kind of veneer emulator, and this veneer emulator comprises: call unit, and for call instruction line parameter, wherein, this command line parameter carries the operational factor of executable program mark and this executable program; Resolution unit, for resolving this command line parameter with the operational factor of the mark and this executable program that obtain this executable program; Be loaded into unit, for loading this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section; Data write unit, for writing the supplemental characteristic section in this executable program of having loaded by the operational factor of this executable program; Initialization unit, for the supplemental characteristic section in this executable program that basis has loaded, the operational factor of this executable program of initialization.
In conjunction with the third aspect, in the implementation that the first is possible, be implemented as: the form of this executable program is ELF.
In conjunction with the first possible implementation of the third aspect or the third aspect, in the implementation that the second is possible, this initialization unit is also for other correlation beyond operational factor in this executable program of initialization; This veneer emulator also comprises: performance element, for performing this executable program.
Fourth aspect, propose a kind of parameter transfer method, the method comprises: call instruction line parameter, and wherein, this command line parameter carries the operational factor of executable program mark and this executable program; Resolve this command line parameter with the operational factor of the mark and this executable program that obtain this executable program; Load this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section; The operational factor of this executable program is write the supplemental characteristic section of this executable program loaded; This executable program loaded is sent to long-range veneer.
In conjunction with fourth aspect, in the implementation that the first is possible, be implemented as: the form of this executable program is ELF.
In conjunction with the first possible implementation of fourth aspect or fourth aspect, in the implementation that the second is possible, long-range veneer is sent to be implemented as this executable program loaded: to organize jtag interface or serial ports that this executable program loaded is sent to long-range veneer by joint test behavior.
5th aspect, propose a kind of parameter transfer method, the method comprises: receive the executable program that long-range veneer loader sends, carry the operational factor of this executable program in the supplemental characteristic section of this executable program; According to the supplemental characteristic section of this executable program, the operational factor of this executable program of initialization.
6th aspect, propose a kind of parameter transfer method, the method comprises: call instruction line parameter, and wherein, this command line parameter carries the operational factor of executable program mark and this executable program; Resolve this command line parameter with the operational factor of the mark and this executable program that obtain this executable program; Load this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section; The operational factor of this executable program is write the supplemental characteristic section in this executable program loaded; According to the supplemental characteristic section in this executable program loaded, the operational factor of this executable program of initialization.
Based on above technical scheme, the present invention is by being written to the supplemental characteristic section of executable program by the operational factor of executable program in load phase, and the operational factor in the operation phase according to the information initializing executable program of the supplemental characteristic section of executable program, thus realize the Parameter transfer supporting Main function in veneer.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, be briefly described to the accompanying drawing used required in the embodiment of the present invention below, apparently, accompanying drawing described is below only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is embodiment of the present invention parameter transfer method process flow diagram.
Fig. 2 is another parameter transfer method process flow diagram of the embodiment of the present invention.
Fig. 3 is an embodiment of the present invention parameter transfer method process flow diagram again.
Fig. 4 is an embodiment of the present invention parameter transfer method process flow diagram again.
Fig. 5 is an embodiment of the present invention parameter transfer method process flow diagram again.
Fig. 6 is the structural representation of embodiment of the present invention veneer loader.
Fig. 7 is the structural representation of embodiment of the present invention veneer.
Fig. 8 is the structural representation of embodiment of the present invention veneer emulator.
Fig. 9 is the structural representation of another veneer loader of the embodiment of the present invention.
Figure 10 is the structural representation of another veneer of the embodiment of the present invention.
Figure 11 is the structural representation of another veneer emulator of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is a part of embodiment of the present invention, instead of whole embodiment.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not making creative work, all should belong to the scope of protection of the invention.
To facilitate understanding of the present embodiment of the invention, first introduce during the embodiment of the present invention describes at this several key elements that can introduce.
Operational factor is transmitted: so-called operational factor transmission refers to the Main function in the programming languages such as C/C++, often with parameter argc, argv, such as, Main function int Main (int argc, char**argv) and int Main (int argc, char*argv []) in, the effect of parameter argc, argv comprises: argc is used for the number (separating with blank character) of the capable input parameter of memory command, and argv is for storing all command line parameters.Might as well suppose that executable program is hello.exe, if run this program in order line, and operation catalogue is this program place catalogue, action command is: " hello.exe hello world ", then now the value of argc is 3, argv [0] is " hello.exe ", and argv [1] is " hello ", and argv [2] is " world ".
Emulator: (simulator), its software is called simulation softward, refer to and make computing machine or other multimedia platforms (palm PC, mobile phone) that software on other platforms can be run mainly through the function of software simulation hardware processor and the program of order set.
Libc:Libc is the function library of the ANSI C under Linux.ANSI C is basic C language function library, contains the built-in function that C language is the most basic.
Serial ports (Serial Port): serial port, an input/output end port (passage), it can receive data in the mode of each from the CPU of computing machine or communication facilities or send data to them.Serial port is used for the interface of serial data communication and much peripherals, as: mouse and printer.
Joint test behavior tissue (Joint Test Action Group, JTAG): a tissue be made up of the electronics manufacturer that a few family is main, object is to formulate printed circuit board (Printed Circuit Board, PCB) plate and integrated circuit (Integrated Circuit, IC) standard.JTAG is commonly used to the international standard test protocol representing that this tissue proposes, and is mainly used in chip internal test.
Linking format (Executable and Linkable Format, ELF) can be performed: be the binary file format standard of the class Unix operating system on x86 framework.Because of its extensibility and dirigibility, also can be applicable in the operating system of other processor, computer system architecture.The part of some storage programs and data is comprised, the section of being called in Elf file.Wherein program segment preserves binary program, and data segment is used for global variable and the static variable of save routine.
More current base band veneers need to support multimode networks such as () UMTS, LTE, need the mode being passed ginseng by application program to specify to start which kind of network when starting veneer.Such as pass through-LTE option and specify startup LTE network.
When testing veneer application program and veneer, need to test for different scene.If support application program main function does not pass ginseng, need to compile often kind of test scene, build corresponding veneer application testing program.
After supporting veneer application program Parameter transfer, test scene can be controlled flexibly by veneer application journey main function parameter, only need compiling once, just can be controlled the application scenarios of test afterwards by command line parameter, and flexible parameter configuration can be carried out to test scene.
Fig. 1 is the method flow diagram of embodiment of the present invention Parameter transfer.The method of Fig. 1 is performed by veneer loader.
101, call instruction line parameter.
Wherein, this command line parameter carries the operational factor of executable program mark and this executable program.
Should be understood that the operational factor of executable program, refer to the parameter of the principal function of executable program.Generally, the principal function of the executable program of veneer is main function, and the operational factor of executable program is the parameter of the main function of executable program.Certainly, if executable program uses other function as principal function, then the parameter being this principal function of operational factor indication.
An object lesson of the embodiment of the present invention, the call instruction that veneer loader loads executable program is specific as follows: loader Helloword-argument " argv0 argv1 ".
Wherein, loader is veneer loader, the content that Helloword – argument " argv0 argv1 " is command line parameter, carries mark Helloword and operational factor argv0, the argv1 of executable program.
In addition, in concrete application, the mark of executable program can be a specific address of executable program, or executable program relative address.Such as, when the executable program of the Helloword by name under veneer loader loader load document folder " C: app ", current directory can be set to the catalogue " C: app " at Helloword place, then action command loader Helloword-argument " argv0 argv1 ", this is the mode that relative address is called.Or, also can directly fill order loader C: app Helloword-argument " argv0 argv1 ", this is the mode that specific address is called.
In addition, during veneer loader call instruction line parameter, call instruction can be inputted by hand in runnable interface, also can perform the call instruction of script inediting, then perform and can perform script.Such as, in autoexec, call instruction etc. is inputted.
102, resolve this command line parameter with the operational factor of the mark and this executable program that obtain this executable program.
Concrete, veneer loader, by resolve command line parameter, can obtain the mark of this executable program and the operational factor of this executable program.Such as, that can determine executable program according to command line parameter Helloword – argument " argv0 argv1 ", veneer loader loader is designated Helloword, and determines operational factor argv0, the argv1 of executable program.
103, load this executable program according to the mark of this executable program.
Wherein, this executable program comprises supplemental characteristic section.
Alternatively, the form of executable program is ELF.
The link script that there is no harm in the embodiment of the present invention is specific as follows to the definition of Helloword application heap:
MEMORY
{
sram0_seg:org=0x38000000,len=0x40
sram1_seg:org=0x38000040,len=0x40
sram2_seg:org=0x38000080,len=0x40
sram3_seg:org=0x380000c0,len=0x40
sram4_seg:org=0x38000100,len=0x40
sram5_seg:org=0x38000140,len=0x40
sram14_seg:org=0x38000180,len=0x7fe80
sram15_seg:org=0x40000000,len=0xffff980
sram16_seg:org=0x4ffff980,len=0x100
sram17_seg:org=0x4ffffa80,len=0x300
sram18_seg:org=0x4ffffd80,len=0x100
sram19_seg:org=0x4ffffe80,len=0x180
……
arg_data_seg:org=0x38201000,len=0x1000/*user-defined datasegment used for arguments store*/
Wherein, supplemental characteristic section is arg_data_seg.
104, the operational factor of this executable program is write the supplemental characteristic section in this executable program loaded.
First, the supplemental characteristic section arg_data_seg depositing operational factor is found by section name.
Then, the information such as the number of operational factor, parameter value, parameter pointer are recorded in arg_data_seg.
For loader C: app the call instruction of Helloword-argument " argv0 argv1 ".One section of false code realized and step thereof illustrate specific as follows:
// definition data pointer points to self-defining data section
char*ptr_mem=arg_data_seg_addr;
// remarks: in internal memory, first three long of supplemental characteristic section preserves argc respectively, argv [0] address, argv [1] address
// 1. memory parameters data segment first addresss preserve the value of argc
((long*)ptr_mem)[0]=(long)2;
The address of // 2. preservations argv [0]
((long*)ptr_mem)[1]=ptr_mem+sizeof(long)*3;
The address of // 3. preservations argv [0]
((long*)ptr_mem)[2]=ptr_mem+sizeof(long)*3+length(argv[0]);
The value of // 4. preservations argv [0]
strcpy(ptr_mem+sizeof(long)*3,argv[0]);
The value of // 5. preservations argv [1]
strcpy(ptr_mem+sizeof(long)*3+length(argv[0]),argv[1]);
Certainly, in concrete realization, because number of parameters is indefinitely, the write of supplemental characteristic section realizes by for circulation, while circulation etc.Those skilled in the art can realize easily, and the embodiment of the present invention repeats no more.
105, this executable program loaded is sent to long-range veneer.
Particularly, this executable program is sent to long-range veneer by jtag interface or serial ports by veneer loader loader.
Certainly, the possibility using other interface to send is not got rid of yet.
In the embodiment of the present invention, by the supplemental characteristic section by the operational factor of executable program write executable program, so that veneer according to the operational factor of the information initializing executable program of the supplemental characteristic section of executable program, thus can realize the Parameter transfer supporting Main function in veneer.
Fig. 2 is the method flow diagram of embodiment of the present invention Parameter transfer.The method of Fig. 2 is performed by veneer.
201, receive the executable program that long-range veneer loader sends.
Wherein, the operational factor of this executable program is carried in the supplemental characteristic section of this executable program.
Particularly, veneer receives the executable program of long-range veneer loader transmission by jtag interface or serial ports.Certainly, the possibility using other interface is not got rid of yet.
202, according to the supplemental characteristic section of this executable program, the operational factor of this executable program of initialization.
In concrete application, veneer realizes the initialization operation of the operational factor of executable program by function library libc.Particularly, can Modification growth function storehouse libc, enable the parameter of resolving main function from supplemental characteristic section, and parameter argc and the argv of main function are set by revising main function stack.
Might as well suppose that veneer sends executable program with the embodiment shown in Fig. 1.
Now, veneer, from the supplemental characteristic section of executable program Helloword, obtains operational factor argv0 and the argv1 of executable program Helloword, then the parameter of the Main function of initialization Helloword.
In the embodiment of the present invention, by receiving the executable program that veneer loader sends, and the operational factor of information initializing executable program according to the supplemental characteristic section in executable program, thus realize the Parameter transfer supporting Main function in veneer.
Alternatively, as shown in Figure 3, the method also can comprise:
203, initialization this can perform other correlation in function beyond operational factor.
204, perform this executable program.
Fig. 4 is the method flow diagram of embodiment of the present invention Parameter transfer.The method of Fig. 4 is performed by veneer emulator.
401, call instruction line parameter.
Wherein, this command line parameter carries the operational factor of executable program mark and this executable program.
Should be understood that the operational factor of executable program, refer to the parameter of the principal function of executable program.Generally, the principal function of executable program is main function, and the operational factor of executable program is the parameter of the main function of executable program.Certainly, if executable program uses other function as principal function, then the parameter being this principal function of operational factor indication.
An object lesson of the embodiment of the present invention, the call instruction that veneer emulator loads executable program is specific as follows: simulator Helloword-argument " argv0 argv1 ".
Wherein, simulator is veneer emulator, the content that Helloword – argument " argv0 argv1 " is command line parameter, carries mark Helloword and operational factor argv0, the argv1 of executable program.
In addition, in concrete application, the mark of executable program can be a specific address of executable program, or executable program relative address.Such as, when the executable program of the Helloword by name under veneer emulator simulator load document folder " C: app ", current directory can be set to the catalogue " C: app " at Helloword place, then action command simulator Helloword-argument " argv0 argv1 ", this is the mode that relative address is called.Or, also can directly fill order simulator C: app Helloword-argument " argv0 argv1 ", this is the mode that specific address is called.
In addition, during veneer emulator call instruction line parameter, call instruction can be inputted by hand in runnable interface, also can perform the call instruction of script inediting, then perform and can perform script.Such as, in autoexec, call instruction etc. is inputted.
402, resolve this command line parameter with the operational factor of the mark and this executable program that obtain this executable program.
Concrete, veneer emulator, by resolve command line parameter, can obtain the mark of this executable program and the operational factor of this executable program.Such as, that can determine executable program according to command line parameter Helloword – argument " argv0 argv1 ", veneer emulator simulator is designated Helloword, and determines operational factor argv0, the argv1 of executable program.
403, load this executable program according to the mark of this executable program.
Wherein, this executable program comprises supplemental characteristic section.
Alternatively, the form of executable program is ELF.
The link script that there is no harm in the embodiment of the present invention is specific as follows to the definition of Helloword application heap:
MEMORY
{
sram0_seg:org=0x38000000,len=0x40
sram1_seg:org=0x38000040,len=0x40
sram2_seg:org=0x38000080,len=0x40
sram3_seg:org=0x380000c0,len=0x40
sram4_seg:org=0x38000100,len=0x40
sram5_seg:org=0x38000140,len=0x40
sram14_seg:org=0x38000180,len=0x7fe80
sram15_seg:org=0x40000000,len=0xffff980
sram16_seg:org=0x4ffff980,len=0x100
sram17_seg:org=0x4ffffa80,len=0x300
sram18_seg:org=0x4ffffd80,len=0x100
sram19_seg:org=0x4ffffe80,len=0x180
……
arg_data_seg:org=0x38201000,len=0x1000/*user-defined datasegment used for arguments store*/
Wherein, supplemental characteristic section is arg_data_seg.
404, the operational factor of this executable program is write the supplemental characteristic section in this executable program loaded.
First, the supplemental characteristic section arg_data_seg depositing operational factor is found by section name.
Then, the information such as the number of operational factor, parameter value, parameter pointer are recorded in arg_data_seg.Its false code realized can with reference to the false code in the step 104 of figure 1, and the embodiment of the present invention does not repeat them here.
405, according to the supplemental characteristic section in this executable program loaded, the operational factor of this executable program of initialization.
Veneer emulator, from the supplemental characteristic section of the executable program Helloword loaded, can obtain operational factor argv0 and the argv1 of executable program Helloword, then the parameter of the Main function of initialization Helloword.
In the embodiment of the present invention, by the operational factor of executable program being write in the supplemental characteristic section of executable program, and when dry run executable program according to the operational factor of the information initializing executable program of the supplemental characteristic section in executable program, thus realize the analogue simulation to the Parameter transfer supporting Main function in veneer.
In addition, the method for the embodiment of the present invention, only needs a set of libc, and does not need to realize pseudoinstruction in the libc of veneer emulator.
Alternatively, as shown in Figure 5, the method also comprises:
406, initialization can perform other correlation in function beyond operational factor.
407, perform this executable program.
Fig. 6 is the structural representation of embodiment of the present invention veneer loader 600.Veneer loader 600 can comprise: call unit 601, resolution unit 602, is loaded into unit 603, data write unit 604, and output unit 605.
Call unit 601, for call instruction line parameter, wherein, this command line parameter carries the operational factor of executable program mark and this executable program;
Resolution unit 602, for resolving this command line parameter with the operational factor of the mark and this executable program that obtain this executable program;
Be loaded into unit 603, for loading this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section;
Data write unit 604, for writing the supplemental characteristic section in this executable program of having loaded by the operational factor of this executable program;
Output unit 605, for sending to long-range veneer by this executable program loaded.
In the embodiment of the present invention, veneer loader 600 is by the supplemental characteristic section by the operational factor of executable program write executable program, so that veneer according to the operational factor of the information initializing executable program of the supplemental characteristic section of executable program, thus can realize the Parameter transfer supporting Main function in veneer.
Alternatively, the form of this executable program is ELF.
Alternatively, this output unit is specifically for sending to long-range veneer by jtag interface or serial ports by this executable program.
Veneer loader 600 also can perform the method for Fig. 1, and possesses veneer loader or loader in function embodiment illustrated in fig. 1, and the embodiment of the present invention does not repeat them here.
Fig. 7 is the structural representation of embodiment of the present invention veneer 700.Veneer 700 can comprise: input block 701 and initialization unit 702.
Input block 701, for receiving the executable program that long-range veneer loader sends.
Wherein, the operational factor of this executable program is carried in the supplemental characteristic section of this executable program.
Initialization unit 702, for the supplemental characteristic section according to this executable program, the operational factor of this executable program of initialization.
In the embodiment of the present invention, the executable program that veneer 700 sends by receiving veneer loader, and the operational factor of information initializing executable program according to the supplemental characteristic section in executable program, thus realize the Parameter transfer supporting Main function in veneer.
Alternatively, input block 701 is specifically for receiving this executable program by jtag interface or serial ports.
Alternatively, initialization unit 702 is also for other correlation beyond operational factor in this executable program of initialization.In addition, as shown in Figure 7, veneer 700 also can comprise: performance element 703, for performing this executable program.
Veneer 700 also can perform the method for Fig. 2, and possesses veneer in Fig. 2, function embodiment illustrated in fig. 3, and the embodiment of the present invention does not repeat them here.
Fig. 8 is the structural representation of embodiment of the present invention veneer emulator 800.Veneer emulator 800 can comprise: call unit 801, resolution unit 802, loading unit 803, data write unit 804 and initialization unit 805.
Call unit 801, for call instruction line parameter.
Wherein, this command line parameter carries the operational factor of executable program mark and this executable program.
Resolution unit 802, for resolving this command line parameter with the operational factor of the mark and this executable program that obtain this executable program;
Be loaded into unit 803, for loading this executable program according to the mark of this executable program.
Wherein, this executable program comprises supplemental characteristic section.
Data write unit 804, for writing the supplemental characteristic section in this executable program of having loaded by the operational factor of this executable program.
Initialization unit 805, for the supplemental characteristic section in this executable program that basis has loaded, the operational factor of this executable program of initialization.
In the embodiment of the present invention, veneer emulator 800 is by writing in the supplemental characteristic section of executable program by the operational factor of executable program, and when dry run executable program according to the operational factor of the information initializing executable program of the supplemental characteristic section in executable program, thus realize the analogue simulation to the Parameter transfer supporting Main function in veneer.
Alternatively, the form of this executable program is ELF.
Alternatively, this initialization unit 805 is also for other correlation beyond operational factor in this executable program of initialization.In addition, as shown in Figure 8, this veneer emulator also comprises: performance element 806, for performing this executable program.
Veneer emulator 800 also can perform the method for Fig. 4, and possesses veneer emulator in Fig. 4, function embodiment illustrated in fig. 5, and the embodiment of the present invention does not repeat them here.
Fig. 9 is the structural representation of embodiment of the present invention veneer loader 900.Veneer loader 900 can comprise channel interface 901, processor 902 and storer 903.
Channel interface 901, processor 902 and storer 903 are interconnected by bus 904 system.Bus 904 can be isa bus, pci bus or eisa bus etc.Described bus can be divided into address bus, data bus, control bus etc.For ease of representing, only representing with a four-headed arrow in Fig. 9, but not representing the bus only having a bus or a type.
Storer 903, for depositing program.Particularly, program can comprise program code, and described program code comprises computer-managed instruction.Storer 903 can comprise ROM (read-only memory) and random access memory, and provides instruction and data to processor 902.Storer 903 may comprise high-speed RAM storer, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory.
Processor 902, the program that execute store 903 is deposited, and specifically for performing following operation:
Call instruction line parameter, wherein, this command line parameter carries the operational factor of executable program mark and this executable program;
Resolve this command line parameter with the operational factor of the mark and this executable program that obtain this executable program;
Load this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section;
The operational factor of this executable program is write the supplemental characteristic section in this executable program loaded;
By channel interface 901, this executable program loaded is sent to long-range veneer.
The method that the above-mentioned veneer loader as any embodiment announcement in Fig. 1 of the present invention or loader perform can be applied in processor 902, or is realized by processor 902.Processor 902 may be a kind of integrated circuit (IC) chip, has the processing power of signal.In implementation procedure, each step of said method can be completed by the instruction of the integrated logic circuit of the hardware in processor 902 or software form.Above-mentioned processor 902 can be general processor, comprises central processing unit (Central Processing Unit is called for short CPU), network processing unit (Network Processor is called for short NP) etc.; Can also be digital signal processor (DSP), special IC (ASIC), ready-made programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components.Can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.The processor etc. of general processor can be microprocessor or this processor also can be any routine.Step in conjunction with the method disclosed in the embodiment of the present invention directly can be presented as that hardware decoding processor is complete, or combines complete by the hardware in decoding processor and software module.Software module can be positioned at random access memory, flash memory, ROM (read-only memory), in the storage medium of this area maturations such as programmable read only memory or electrically erasable programmable storer, register.This storage medium is positioned at storer 903, and processor 902 reads the information in storer 903, completes the step of said method in conjunction with its hardware.
In the embodiment of the present invention, veneer loader 900 is by the supplemental characteristic section by the operational factor of executable program write executable program, so that veneer according to the operational factor of the information initializing executable program of the supplemental characteristic section of executable program, thus can realize the Parameter transfer supporting Main function in veneer.
Alternatively, the form of this executable program is ELF.
Alternatively, channel interface 901 can be jtag interface or serial ports.For sending in the process of long-range veneer by channel interface 901 by this executable program loaded, processor 902 is specifically for sending to long-range veneer by jtag interface or serial ports by this executable program.
Veneer loader 900 also can perform the method for Fig. 1, and possesses veneer loader or loader in function embodiment illustrated in fig. 1, and the embodiment of the present invention does not repeat them here.
Figure 10 is the structural representation of embodiment of the present invention veneer 1000.Veneer 1000 can comprise channel interface 1001, processor 1002 and storer 1003.
Channel interface 1001, processor 1002 and storer 1003 are interconnected by bus 1004 system.Bus 1004 can be isa bus, pci bus or eisa bus etc.Described bus can be divided into address bus, data bus, control bus etc.For ease of representing, only representing with a four-headed arrow in Figure 10, but not representing the bus only having a bus or a type.
Storer 1003, for depositing program.Particularly, program can comprise program code, and described program code comprises computer-managed instruction.Storer 1003 can comprise ROM (read-only memory) and random access memory, and provides instruction and data to processor 1002.Storer 1003 may comprise high-speed RAM storer, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory.
Processor 1002, the program that execute store 1003 is deposited, and specifically for performing following operation:
Received the executable program of long-range veneer loader transmission by channel interface 1001, wherein, in the supplemental characteristic section of this executable program, carry the operational factor of this executable program;
According to the supplemental characteristic section of this executable program, the operational factor of this executable program of initialization.
The method that the above-mentioned veneer disclosed as any embodiment in Fig. 2-3 of the present invention performs can be applied in processor 1002, or is realized by processor 1002.Processor 1002 may be a kind of integrated circuit (IC) chip, has the processing power of signal.In implementation procedure, each step of said method can be completed by the instruction of the integrated logic circuit of the hardware in processor 1002 or software form.Above-mentioned processor 1002 can be general processor, comprises central processing unit (Central Processing Unit is called for short CPU), network processing unit (Network Processor is called for short NP) etc.; Can also be digital signal processor (DSP), special IC (ASIC), ready-made programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components.Can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.The processor etc. of general processor can be microprocessor or this processor also can be any routine.Step in conjunction with the method disclosed in the embodiment of the present invention directly can be presented as that hardware decoding processor is complete, or combines complete by the hardware in decoding processor and software module.Software module can be positioned at random access memory, flash memory, ROM (read-only memory), in the storage medium of this area maturations such as programmable read only memory or electrically erasable programmable storer, register.This storage medium is positioned at storer 1003, and processor 1002 reads the information in storer 1003, completes the step of said method in conjunction with its hardware.
In the embodiment of the present invention, the executable program that veneer 1000 sends by receiving veneer loader, and the operational factor of information initializing executable program according to the supplemental characteristic section in executable program, thus realize the Parameter transfer supporting Main function in veneer.
Alternatively, channel interface 1001 can be jtag interface or serial ports.In the process for being received the executable program that long-range veneer loader sends by channel interface 1001, processor 902 is specifically for receiving this executable program by jtag interface or serial ports.
Alternatively, processor 1002 also for other correlation beyond operational factor in this executable program of initialization, and performs this executable program.
Veneer 1000 also can perform the method for Fig. 2, and possesses veneer in Fig. 2, function embodiment illustrated in fig. 3, and the embodiment of the present invention does not repeat them here.
Figure 11 is the structural representation of embodiment of the present invention veneer emulator 1100.Veneer emulator 1100 can comprise channel interface 1101, processor 1102 and storer 1103.
Channel interface 1101, processor 1102 and storer 1103 are interconnected by bus 1104 system.Bus 1104 can be isa bus, pci bus or eisa bus etc.Described bus can be divided into address bus, data bus, control bus etc.For ease of representing, only representing with a four-headed arrow in Figure 11, but not representing the bus only having a bus or a type.
Storer 1103, for depositing program.Particularly, program can comprise program code, and described program code comprises computer-managed instruction.Storer 1103 can comprise ROM (read-only memory) and random access memory, and provides instruction and data to processor 1102.Storer 1103 may comprise high-speed RAM storer, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory.
Processor 1102, the program that execute store 1103 is deposited, and specifically for performing following operation:
Call unit 1101, for call instruction line parameter, wherein, this command line parameter carries the operational factor of executable program mark and this executable program;
Resolve this command line parameter with the operational factor of the mark and this executable program that obtain this executable program;
Load this executable program according to the mark of this executable program, wherein, this executable program comprises supplemental characteristic section;
The operational factor of this executable program is write the supplemental characteristic section in this executable program loaded;
According to the supplemental characteristic section in this executable program loaded, the operational factor of this executable program of initialization.
The method that the above-mentioned veneer emulator disclosed as any embodiment in Fig. 4-5 of the present invention performs can be applied in processor 1102, or is realized by processor 1102.Processor 1102 may be a kind of integrated circuit (IC) chip, has the processing power of signal.In implementation procedure, each step of said method can be completed by the instruction of the integrated logic circuit of the hardware in processor 1102 or software form.Above-mentioned processor 1102 can be general processor, comprises central processing unit (Central Processing Unit is called for short CPU), network processing unit (Network Processor is called for short NP) etc.; Can also be digital signal processor (DSP), special IC (ASIC), ready-made programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components.Can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.The processor etc. of general processor can be microprocessor or this processor also can be any routine.Step in conjunction with the method disclosed in the embodiment of the present invention directly can be presented as that hardware decoding processor is complete, or combines complete by the hardware in decoding processor and software module.Software module can be positioned at random access memory, flash memory, ROM (read-only memory), in the storage medium of this area maturations such as programmable read only memory or electrically erasable programmable storer, register.This storage medium is positioned at storer 1103, and processor 1102 reads the information in storer 1103, completes the step of said method in conjunction with its hardware.
In the embodiment of the present invention, veneer emulator 1100 is by writing in the supplemental characteristic section of executable program by the operational factor of executable program, and when dry run executable program according to the operational factor of the information initializing executable program of the supplemental characteristic section in executable program, thus realize the analogue simulation to the Parameter transfer supporting Main function in veneer.
Alternatively, the form of this executable program is ELF.
Alternatively, processor 1102 also for other correlation beyond operational factor in this executable program of initialization, and performs this executable program.
Veneer emulator 1100 also can perform the method for Fig. 4, and possesses veneer emulator in Fig. 4, function embodiment illustrated in fig. 5, and the embodiment of the present invention does not repeat them here.
Those of ordinary skill in the art can recognize, in conjunction with the various method steps described in embodiment disclosed herein and unit, can realize with electronic hardware, computer software or the combination of the two, in order to the interchangeability of hardware and software is clearly described, generally describe step and the composition of each embodiment in the above description according to function.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Those of ordinary skill in the art can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
The software program that the method described in conjunction with embodiment disclosed herein or step can use hardware, processor to perform, or the combination of the two is implemented.Software program can be placed in the storage medium of other form any known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
Although by reference to accompanying drawing and mode in conjunction with the preferred embodiments to invention has been detailed description, the present invention is not limited to this.Without departing from the spirit and substance of the premise in the present invention, those of ordinary skill in the art can carry out amendment or the replacement of various equivalence to embodiments of the invention, and these amendments or replacement all should in covering scopes of the present invention.

Claims (14)

1. a veneer loader, is characterized in that, comprising:
Call unit, for call instruction line parameter, wherein, described command line parameter carries the operational factor of executable program mark and described executable program;
Resolution unit, for resolving described command line parameter with the operational factor of the mark and described executable program that obtain described executable program;
Be loaded into unit, for loading described executable program according to the mark of described executable program, wherein, described executable program comprises supplemental characteristic section;
Data write unit, for writing the supplemental characteristic section in the described executable program that loaded by the operational factor of described executable program;
Output unit, for sending to long-range veneer by the described executable program loaded.
2. veneer loader as claimed in claim 1, it is characterized in that, the form of described executable program is for can perform linking format ELF.
3. veneer loader as claimed in claim 1 or 2, it is characterized in that, the described executable program loaded is sent to long-range veneer specifically for being organized jtag interface or serial ports by joint test behavior by described output unit.
4. a veneer, is characterized in that, comprising:
Input block, for receiving the executable program that long-range veneer loader sends, carries the operational factor of described executable program in the supplemental characteristic section of described executable program;
Initialization unit, for the supplemental characteristic section according to described executable program, the operational factor of executable program described in initialization.
5. veneer as claimed in claim 4, it is characterized in that, described input block is specifically for organizing jtag interface or serial ports to receive described executable program by joint test behavior.
6. the veneer as described in claim 4 or 5, is characterized in that,
Described initialization unit is also for other correlation beyond operational factor in executable program described in initialization;
Described veneer also comprises: performance element, for performing described executable program.
7. a veneer emulator, is characterized in that, comprising:
Call unit, for call instruction line parameter, wherein, described command line parameter carries the operational factor of executable program mark and described executable program;
Resolution unit, for resolving described command line parameter with the operational factor of the mark and described executable program that obtain described executable program;
Be loaded into unit, for loading described executable program according to the mark of described executable program, wherein, described executable program comprises supplemental characteristic section;
Data write unit, for writing the supplemental characteristic section in the described executable program that loaded by the operational factor of described executable program;
Initialization unit, for the supplemental characteristic section in the described executable program that basis has loaded, the operational factor of executable program described in initialization.
8. veneer emulator as claimed in claim 7, it is characterized in that, the form of described executable program is for can perform linking format ELF.
9. as claim 7 or 8 or as described in veneer emulator, it is characterized in that,
Described initialization unit is also for other correlation beyond operational factor in executable program described in initialization;
Described veneer emulator also comprises: performance element, for performing described executable program.
10. a parameter transfer method, is characterized in that, comprising:
Call instruction line parameter, wherein, described command line parameter carries the operational factor of executable program mark and described executable program;
Resolve described command line parameter with the operational factor of the mark and described executable program that obtain described executable program;
Load described executable program according to the mark of described executable program, wherein, described executable program comprises supplemental characteristic section;
The operational factor of described executable program is write the supplemental characteristic section of the described executable program loaded;
The described executable program loaded is sent to long-range veneer.
11. methods as claimed in claim 10, it is characterized in that, the form of described executable program is for can perform linking format ELF.
12. methods as described in claim 10 or 11, is characterized in that, describedly send to long-range veneer to comprise the described executable program loaded:
Organize jtag interface or serial ports that the described executable program loaded is sent to long-range veneer by joint test behavior.
13. 1 kinds of parameter transfer methods, is characterized in that, comprising:
Receive the executable program that long-range veneer loader sends, in the supplemental characteristic section of described executable program, carry the operational factor of described executable program;
According to the supplemental characteristic section of described executable program, the operational factor of executable program described in initialization.
14. 1 kinds of parameter transfer methods, is characterized in that, comprising:
Call instruction line parameter, wherein, described command line parameter carries the operational factor of executable program mark and described executable program;
Resolve described command line parameter with the operational factor of the mark and described executable program that obtain described executable program;
Load described executable program according to the mark of described executable program, wherein, described executable program comprises supplemental characteristic section;
The operational factor of described executable program is write the supplemental characteristic section in the described executable program loaded;
According to the supplemental characteristic section in the described executable program loaded, the operational factor of executable program described in initialization.
CN201410710191.0A 2014-11-28 2014-11-28 Parameter transfer method, veneer loader, veneer and veneer emulator Active CN104503738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410710191.0A CN104503738B (en) 2014-11-28 2014-11-28 Parameter transfer method, veneer loader, veneer and veneer emulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410710191.0A CN104503738B (en) 2014-11-28 2014-11-28 Parameter transfer method, veneer loader, veneer and veneer emulator

Publications (2)

Publication Number Publication Date
CN104503738A true CN104503738A (en) 2015-04-08
CN104503738B CN104503738B (en) 2018-03-06

Family

ID=52945139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410710191.0A Active CN104503738B (en) 2014-11-28 2014-11-28 Parameter transfer method, veneer loader, veneer and veneer emulator

Country Status (1)

Country Link
CN (1) CN104503738B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117241A (en) * 2009-12-30 2011-07-06 华为技术有限公司 Multi-core system debugging method and multi-core system
US20120036286A1 (en) * 2010-06-24 2012-02-09 Hitachi, Ltd. Data transfer system and data transfer method
CN102402480A (en) * 2011-10-12 2012-04-04 吴华中 Tool for debugging (testing) command line of circuit board firmware
CN102722440A (en) * 2012-06-07 2012-10-10 中兴通讯股份有限公司 Debugging device of executive codes of embedded system, debugging method and embedded system
CN103077112A (en) * 2012-10-16 2013-05-01 中兴通讯股份有限公司 Software debugging method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117241A (en) * 2009-12-30 2011-07-06 华为技术有限公司 Multi-core system debugging method and multi-core system
US20120036286A1 (en) * 2010-06-24 2012-02-09 Hitachi, Ltd. Data transfer system and data transfer method
CN102402480A (en) * 2011-10-12 2012-04-04 吴华中 Tool for debugging (testing) command line of circuit board firmware
CN102722440A (en) * 2012-06-07 2012-10-10 中兴通讯股份有限公司 Debugging device of executive codes of embedded system, debugging method and embedded system
CN103077112A (en) * 2012-10-16 2013-05-01 中兴通讯股份有限公司 Software debugging method and system

Also Published As

Publication number Publication date
CN104503738B (en) 2018-03-06

Similar Documents

Publication Publication Date Title
Homescu et al. Microgadgets: Size Does Matter in Turing-Complete Return-Oriented Programming.
CN104050080B (en) User space debugs the method and system of linux kernel
CN104134039A (en) Virus checking and killing method, virus checking and killing client, virus checking and killing server and virus checking and killing system
CN102231128A (en) Online debugging method and debugging host
CN115390945B (en) Application program running method and device, electronic equipment and readable storage medium
CN114089975A (en) Expansion method and device of computing software, nonvolatile storage medium and processor
Dullien et al. Exploitation and state machines
CN102364433A (en) Method for realizing Wine construction tool transplanting on ARM (Advanced RISC Machines) processor
CN115617687A (en) Program instrumentation method, apparatus, device and storage medium
CN111176663B (en) Data processing method, device, equipment and storage medium of application program
Votipka et al. Passe-partout: A general collection methodology for Android devices
CN110688198B (en) System calling method and device and electronic equipment
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN117149209A (en) Code increment compiling method and device, computer equipment and storage medium
CN109144575B (en) Device and method for running application across operating systems, electronic equipment and memory
CN116594861A (en) Native dynamic link library analysis method and system based on simulation execution
CN114428642B (en) Random instruction generation environment based on novel processor architecture
CN113342702B (en) Application program testing method, device, equipment and readable storage medium
CN116126690A (en) Debugging method and system for lightweight embedded system
CN104503738A (en) Parameter transferring method, single-broad loader, single broad and single-broad simulator
CN110909347B (en) Mcsema-based Remill library stack pollution analysis method and device
CN104572482A (en) Process variable storage method and device
Brizendine et al. A Novel Method for the Automatic Generation of JOP Chain Exploits
Wootton et al. General Purpose Input/Output (GPIO)
WO2024069772A1 (en) Analysis device, analysis method, and analysis program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211228

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: xFusion Digital Technologies Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.