CN104503738B - Parameter transfer method, veneer loader, veneer and veneer emulator - Google Patents

Parameter transfer method, veneer loader, veneer and veneer emulator Download PDF

Info

Publication number
CN104503738B
CN104503738B CN201410710191.0A CN201410710191A CN104503738B CN 104503738 B CN104503738 B CN 104503738B CN 201410710191 A CN201410710191 A CN 201410710191A CN 104503738 B CN104503738 B CN 104503738B
Authority
CN
China
Prior art keywords
executable program
veneer
operational factor
parameter
executable
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
Application number
CN201410710191.0A
Other languages
Chinese (zh)
Other versions
CN104503738A (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

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

Abstract

The embodiment of the present invention, which proposes a kind of parameter transfer method, veneer loader, veneer and veneer emulator, this method, to be included:Call instruction row parameter, wherein, the command line parameter carries executable program mark and the operational factor of the executable program;The command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program;The executable program is loaded according to the mark of the executable program, wherein, the executable program includes supplemental characteristic section;The supplemental characteristic section for the executable program that the operational factor write-in of the executable program has been loaded;The executable program loaded is sent to long-range veneer.In the embodiment of the present invention, by the supplemental characteristic section that the operational factor of executable program is write to executable program, so that veneer can be according to the operational factor of the information initializing executable program of the supplemental characteristic section of executable program, so as to realize the parameter transmission that Main functions are supported in veneer.

Description

Parameter transfer method, veneer loader, veneer and veneer emulator
Technical field
The present invention relates to computer realm, more particularly to a kind of parameter transfer method, veneer loader, veneer and Veneer emulator.
Background technology
It is different from directly running executable program on PC, in order to which application program needs to answer from local loader loadings on veneer With program, then local loader passes through serial ports or JTAG passages according to standard executable files format analysis application program Application program is copied to long-range veneer, then veneer performs executable program since the entry address provided.Universal PC Upper application program can obtain operational factor with resolve command row, and directly be performed on veneer since program entry address, can not Obtain command line parameter.
Tensilica companies provide a sets of plan and support to support Main functions to pass ginseng on veneer emulator. The solution of Tensilica companies is to provide the other set libc supporting with veneer emulator, (true hard by dummy order The instruction being not present in part) mode support application program Main functions pass ginseng.This scheme needs two sets of maintenance to need maintenance two Cover libc, disunity is safeguarded complicated, and requires that veneer emulator realizes dummy order, the veneer under real hardware environment does not prop up Hold operational factor transmission.
Support operational factor transmission in the veneer under real hardware environment how is realized, is to be solved by this invention ask Topic.
The content of the invention
The present invention provides a kind of parameter transfer method, veneer loader, veneer and veneer emulator, can realize in list The parameter transmission of Main functions is supported in plate.
First aspect, it is proposed that a kind of veneer loader, the veneer loader include:Call unit, for call instruction Row parameter, wherein, the command line parameter carries executable program mark and the operational factor of the executable program;Resolution unit, For parsing the command line parameter to obtain the operational factor of the mark of the executable program and the executable program;It is loaded into single Member, for loading the executable program according to the mark of the executable program, wherein, the executable program includes supplemental characteristic Section;Data write unit, for the parameter for writing the operational factor of the executable program in the executable program loaded Data segment;Output unit, for the executable program loaded to be sent into long-range veneer.
With reference in a first aspect, in the first possible implementation, it is implemented as:The form of the executable program is ELF。
With reference to the possible implementation of the first of first aspect or first aspect, in second of possible implementation In, it is implemented as:The output unit is specifically used for have loaded by joint test behavior tissue jtag interface or serial ports The executable program is sent to long-range veneer.
Second aspect, it is proposed that a kind of veneer, the veneer include:Input block, for receiving long-range veneer loader The executable program of transmission, the operational factor of the executable program is carried in the supplemental characteristic section of the executable program;Initialization Unit, for the supplemental characteristic section according to the executable program, initialize the operational factor of the executable program.
With reference to second aspect, in the first possible implementation, the input block is specifically used for passing through jtag interface Or serial ports receives the executable program.
With reference to the possible implementation of the first of second aspect or second aspect, in second of possible implementation In, the initialization unit is additionally operable to initialize other correlations beyond operational factor in the executable program;The veneer also wraps Include:Execution unit, for performing the executable program.
The third aspect, it is proposed that a kind of veneer emulator, the veneer emulator include:Call unit, for call instruction Row parameter, wherein, the command line parameter carries executable program mark and the operational factor of the executable program;Resolution unit, For parsing the command line parameter to obtain the operational factor of the mark of the executable program and the executable program;It is loaded into single Member, for loading the executable program according to the mark of the executable program, wherein, the executable program includes supplemental characteristic Section;Data write unit, for the parameter for writing the operational factor of the executable program in the executable program loaded Data segment;Initialization unit, for the supplemental characteristic section in the executable program loaded, initialize the executable journey The operational factor of sequence.
With reference to the third aspect, in the first possible implementation, it is implemented as:The form of the executable program is ELF。
With reference to the possible implementation of the first of the third aspect or the third aspect, in second of possible implementation In, the initialization unit is additionally operable to initialize other correlations beyond operational factor in the executable program;The veneer emulates Device also includes:Execution unit, for performing the executable program.
Fourth aspect, it is proposed that a kind of parameter transfer method, this method include:Call instruction row parameter, wherein, the order Row parameter carries executable program mark and the operational factor of the executable program;Parsing the command line parameter can be held with obtaining this The operational factor of the mark of line program and the executable program;The executable program is loaded according to the mark of the executable program, Wherein, the executable program includes supplemental characteristic section;This that the operational factor write-in of the executable program has been loaded can perform The supplemental characteristic section of program;The executable program loaded is sent to long-range veneer.
With reference to fourth aspect, in the first possible implementation, it is implemented as:The form of the executable program is ELF。
With reference to the possible implementation of the first of fourth aspect or fourth aspect, in second of possible implementation In, the executable program loaded is sent to long-range veneer and is implemented as:Connect by joint test behavior tissue JTAG The executable program loaded is sent to long-range veneer by mouth or serial ports.
5th aspect, it is proposed that a kind of parameter transfer method, this method include:Receive what long-range veneer loader was sent Executable program, the operational factor of the executable program is carried in the supplemental characteristic section of the executable program;It is executable according to this The supplemental characteristic section of program, initialize the operational factor of the executable program.
6th aspect, it is proposed that a kind of parameter transfer method, this method include:Call instruction row parameter, wherein, the order Row parameter carries executable program mark and the operational factor of the executable program;Parsing the command line parameter can be held with obtaining this The operational factor of the mark of line program and the executable program;The executable program is loaded according to the mark of the executable program, Wherein, the executable program includes supplemental characteristic section;This that the operational factor write-in of the executable program has been loaded can perform Supplemental characteristic section in program;According to the supplemental characteristic section in the executable program loaded, the executable program is initialized Operational factor.
Based on above technical scheme, the present invention is by being written to the operational factor of executable program and can hold in load phase The supplemental characteristic section of line program, and journey can perform according to the information initializing of the supplemental characteristic section of executable program in the operation phase The operational factor of sequence, so as to realize the parameter transmission that Main functions are supported in veneer.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, it will make below to required in the embodiment of the present invention Accompanying drawing is briefly described, it should be apparent that, drawings described below is only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is parameter transfer method flow chart of the embodiment of the present invention.
Fig. 2 is another parameter transfer method flow chart of the embodiment of the present invention.
Fig. 3 is the another parameter transfer method flow chart of the embodiment of the present invention.
Fig. 4 is the another parameter transfer method flow chart of the embodiment of the present invention.
Fig. 5 is the another parameter transfer method flow chart of the embodiment of the present invention.
Fig. 6 is the structural representation of veneer loader of the embodiment of the present invention.
Fig. 7 is the structural representation of veneer of the embodiment of the present invention.
Fig. 8 is the structural representation of veneer emulator of the embodiment of the present invention.
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, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is the part of the embodiment of the present invention, rather than whole embodiments.Based on this hair Embodiment in bright, the every other reality that those of ordinary skill in the art are obtained on the premise of creative work is not made Example is applied, should all belong to the scope of protection of the invention.
To facilitate understanding of the present embodiment of the invention, introduced first at this embodiment of the present invention description in can introduce it is several will Element.
Operational factor transmission:So-called operational factor transmission refers to the Main functions in the programming languages such as C/C++, frequent band There are parameter argc, argv, for example, Main function int Main (int argc, char**argv) and int Main (int Argc, char*argv []) in, parameter argc, argv effect include:Argc is used for the number for storing order line input parameter (being separated with blank character), argv are used to store all command line parameters.It is hello.exe that executable program, which might as well be assumed, such as Fruit runs the program in order line, and it is catalogue where the program to run catalogue, and operation order is:“hello.exe hello World ", then now argc value is that 3, argv [0] is " hello.exe ", and argv [1] is " hello ", and argv [2] is " world"。
Emulator:(simulator), its software is referred to as simulation softward, refers to mainly by software analog hardware processor Function and instruction system program make computer or other multimedia platforms (palm PC, mobile phone) can to run other flat Software on platform.
Libc:Libc is the function library of the ANSI C under Linux.ANSI C are basic C language function libraries, contain C The most basic built-in function of language.
Serial ports (Serial Port):Serial port, an input/output end port (passage), it can be with one every time Mode receives data from the CPU or communication equipment of computer or sends data to them.Serial port is used for serial data Communication and the interface of much ancillary equipment, such as:Mouse and printer.
Joint test behavior tissue (Joint Test Action Group, JTAG):One by the main electronics system of several families Make the tissue of business's composition, it is therefore intended that formulate printed circuit board (Printed Circuit Board, PCB) plate and integrated circuit (Integrated Circuit, IC) standard.JTAG is conventionally used to indicate the international standard test protocol of tissue proposition, mainly Tested for chip internal.
Executable linking format (Executable and Linkable Format, ELF):For the class on x86 frameworks The binary file format standard of Unix operating systems.Because of its scalability and flexibility, other processors, meter are also applicable in In the operating system of calculation machine system architecture.Part comprising some storage programs and data, referred to as section in Elf files.Its intermediate range Sequence section preserves binary program, and data segment is used for the global variable and static variable of save routine.
Some current base band veneers need to support multimode (network such as UMTS, LTE), need to pass through application when starting veneer The mode that program passes ginseng specifies which kind of network started.Such as specified by-LTE options and start LTE network.
When testing veneer application program and veneer, it is necessary to be tested for different scenes.If do not support Application program main functions pass ginseng, it is necessary to be compiled to every kind of test scene, build corresponding veneer application test program.
After supporting that veneer application program parameter is transmitted, survey can flexibly be controlled by veneer application journey main function parameters Examination hall scape, it is only necessary to which once, can controls the application scenarios of test by command line parameter afterwards, and can be to surveying for compiling Examination hall scape carries out flexible parameter configuration.
Fig. 1 is the method flow diagram of parameter transmission of the embodiment of the present invention.Fig. 1 method is performed by veneer loader.
101, call instruction row parameter.
Wherein, the command line parameter carries executable program mark and the operational factor of the executable program.
It 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 functions, and the operational factor of executable program is the main letters of executable program Several parameters.Certainly, if executable program uses other functions as principal function, the signified as main letter of operational factor Several parameters.
One specific example of the embodiment of the present invention, the call instruction of veneer loader loading executable program are specific such as Under:loader Helloword-argument“argv0 argv1”.
Wherein, loader is veneer loader, and " argv0 argv1 " are command line parameter to Helloword-argument Content, carry the mark Helloword and its operational factor argv0, argv1 of executable program.
In addition, in specific application, the mark of executable program, can be executable program an absolute address, An either relative address of executable program.For example, as veneer loader loader load documents folder " C:App " under During entitled Helloword executable program, the catalogue " C that current directory can be arranged to where Helloword:App ", so " argv0 argv1 ", this is the mode that relative address is called to operation order loader Helloword-argument afterwards.Or It can also directly perform order loader C:App Helloword-argument " argv0 argv1 ", this be absolute address adjust Mode.
In addition, during veneer loader call instruction row parameter, call instruction can be manually entered in runnable interface, also can be Call instruction is edited in executable script, then performs executable script.For example, call instruction is inputted in autoexec Deng.
102, the command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program.
Specifically, veneer loader by resolve command row parameter, can obtain the executable program mark and this can hold The operational factor of line program.For example, according to command line parameter Helloword-argument " argv0 argv1 ", veneer loading Device loader can determine that the Helloword that is identified as of executable program, and determine executable program operational factor argv0, argv1。
103, the executable program is loaded according to the mark of the executable program.
Wherein, the executable program includes supplemental characteristic section.
Alternatively, the form of executable program is ELF.
There is no harm in one of the embodiment of the present invention link script Helloword application heaps are defined it is specific as follows:
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 data segment used for arguments store*/
Wherein, supplemental characteristic section is arg_data_seg.
104, the supplemental characteristic section that the operational factor of the executable program is write in the executable program loaded.
First, can section name find storage operational factor supplemental characteristic section arg_data_seg.
Then, by information records such as the number of operational factor, parameter value, parameter pointers into arg_data_seg.
With loader C:App Helloword-argument " exemplified by argv0 argv1 " call instruction.One section of reality Existing false code and its step illustrates specific as follows:
// define data pointer sensing self-defining data section
Char*ptr_mem=arg_data_seg_addr;
// remarks:First three long of supplemental characteristic section preserves argc respectively in internal memory, argv [0] address, argv [1] Location
// 1. memory parameters data segment first address preserve argc value
((long*) ptr_mem) [0]=(long) 2;
// 2. preserve argv [0] address
((long*) ptr_mem) [1]=ptr_mem+sizeof (long) * 3;
// 3. preserve argv [0] address
((long*) ptr_mem) [2]=ptr_mem+sizeof (long) * 3+length (argv [0]);
// 4. preserve argv [0] value
strcpy(ptr_mem+sizeof(long)*3,argv[0]);
// 5. preserve argv [1] value
strcpy(ptr_mem+sizeof(long)*3+length(argv[0]),argv[1]);
Certainly, in concrete implementation, because number of parameters is that indefinitely, the write-in of supplemental characteristic section can pass through for Circulation, while circulations etc. are realized.Those skilled in the art can easily realize that the embodiment of the present invention repeats no more.
105, the executable program loaded is sent to long-range veneer.
Specifically, the executable program can be sent to long-range list by veneer loader loader by jtag interface or serial ports Plate.
Certainly, also it is not excluded for the possibility sent using other interfaces.
In the embodiment of the present invention, by the way that the operational factor of executable program to be write to the supplemental characteristic section of executable program, So that veneer can be according to the operational factor of the information initializing executable program of the supplemental characteristic section of executable program, so as to real The parameter transmission of Main functions is supported in present veneer.
Fig. 2 is the method flow diagram of parameter transmission of the embodiment of the present invention.Fig. 2 method is performed by veneer.
201, receive the executable program that long-range veneer loader is sent.
Wherein, the operational factor of the executable program is carried in the supplemental characteristic section of the executable program.
Specifically, veneer can receive the executable program that long-range veneer loader is sent by jtag interface or serial ports. Certainly, also it is not excluded for the possibility using other interfaces.
202, according to the supplemental characteristic section of the executable program, initialize the operational factor of the executable program.
In specific application, veneer can realize the initialization of the operational factor of executable program by function library libc Operation.Specifically, can Modification growth function storehouse libc, enable the parameter from supplemental characteristic section parsing main functions, and by repairing Change parameter argc and argv that main functions stack sets main functions.
It might as well assume that veneer sends executable program with the embodiment shown in Fig. 1.
Now, veneer obtains executable program Helloword from executable program Helloword supplemental characteristic section Operational factor argv0 and argv1, then initialize Helloword Main functions parameter.
In the embodiment of the present invention, by receiving the executable program of veneer loader transmission, and according in executable program Supplemental characteristic section information initializing executable program operational factor, so as to realize in veneer support Main functions ginseng Number transmits.
Alternatively, as shown in figure 3, this method may also include:
203, initialize other correlations beyond operational factor in the executable function.
204, perform the executable program.
Fig. 4 is the method flow diagram of parameter transmission of the embodiment of the present invention.Fig. 4 method is performed by veneer emulator.
401, call instruction row parameter.
Wherein, the command line parameter carries executable program mark and the operational factor of the executable program.
It 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 functions, and the operational factor of executable program is the ginseng of the main functions of executable program Number.Certainly, if executable program uses other functions as principal function, the ginseng of the signified as principal function of operational factor Number.
One specific example of the embodiment of the present invention, the call instruction of veneer emulator loading executable program are specific such as Under:simulator Helloword-argument“argv0 argv1”.
Wherein, simulator is veneer emulator, and " argv0 argv1 " join Helloword-argument for order line Several contents, carry the mark Helloword and its operational factor argv0, argv1 of executable program.
In addition, in specific application, the mark of executable program, can be executable program an absolute address, An either relative address of executable program.For example, as veneer emulator simulator load documents folder " C:\app\” Under entitled Helloword executable program when, the catalogue " C that current directory can be arranged to where Helloword:\ App ", then " argv0 argv1 ", this is that relative address is called to operation order simulator Helloword-argument Mode.Or it can also directly perform order simulator C:App Helloword-argument " argv0 argv1 ", This is the mode that absolute address is called.
In addition, during veneer emulator call instruction row parameter, call instruction can be manually entered in runnable interface, also can be Call instruction is edited in executable script, then performs executable script.For example, call instruction is inputted in autoexec Deng.
402, the command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program.
Specifically, veneer emulator by resolve command row parameter, can obtain the executable program mark and this can hold The operational factor of line program.For example, according to command line parameter Helloword-argument " argv0 argv1 ", veneer emulation Device simulator can determine that the Helloword that is identified as of executable program, and determine executable program operational factor argv0, argv1。
403, the executable program is loaded according to the mark of the executable program.
Wherein, the executable program includes supplemental characteristic section.
Alternatively, the form of executable program is ELF.
There is no harm in one of the embodiment of the present invention link script Helloword application heaps are defined it is specific as follows:
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 supplemental characteristic section that the operational factor of the executable program is write in the executable program loaded.
First, can section name find storage operational factor supplemental characteristic section arg_data_seg.
Then, by information records such as the number of operational factor, parameter value, parameter pointers into arg_data_seg.In fact Existing false code refers to the false code in Fig. 1 step 104, and the embodiment of the present invention will not be repeated here.
405, according to the supplemental characteristic section in the executable program loaded, the operation for initializing the executable program is joined Number.
Veneer emulator can obtain executable journey from the executable program Helloword loaded supplemental characteristic section Sequence Helloword operational factor argv0 and argv1, then initialize the parameter of Helloword Main functions.
In the embodiment of the present invention, by the supplemental characteristic section that the operational factor of executable program is write to executable program In, and the information initializing executable program of the supplemental characteristic section in dry run executable program in executable program Operational factor, so as to realize in veneer support Main functions parameter transmission analogue simulation.
In addition, the method for the embodiment of the present invention, it is only necessary to a set of libc, and need not be real in the libc of veneer emulator Existing dummy order.
Alternatively, as shown in figure 5, this method also includes:
406, initialize other correlations beyond operational factor in executable function.
407, perform the executable program.
Fig. 6 is the structural representation of veneer of embodiment of the present invention loader 600.Veneer loader 600 may include:Call single Member 601, resolution unit 602, it is loaded into unit 603, data write unit 604, and output unit 605.
Call unit 601, for call instruction row parameter, wherein, the command line parameter carry executable program mark and The operational factor of the executable program;
Resolution unit 602, for parsing the command line parameter to obtain the mark of the executable program and the executable journey The operational factor of sequence;
Unit 603 is loaded into, for loading the executable program according to the mark of the executable program, wherein, this is executable Program bag containing parameter data segment;
Data write unit 604, for the executable program for having loaded the operational factor write-in of the executable program In supplemental characteristic section;
Output unit 605, for the executable program loaded to be sent into long-range veneer.
In the embodiment of the present invention, veneer loader 600 by the operational factor of executable program by writing executable program Supplemental characteristic section, so that veneer can be according to the fortune of the information initializing executable program of the supplemental characteristic section of executable program Row parameter, so as to realize the parameter transmission that Main functions are supported in veneer.
Alternatively, the form of the executable program is ELF.
Alternatively, the output unit is specifically used for the executable program is sent into long-range list by jtag interface or serial ports Plate.
Veneer loader 600 can also carry out Fig. 1 method, and possess veneer loader or loader in implementation shown in Fig. 1 The function of example, the embodiment of the present invention will not be repeated here.
Fig. 7 is the structural representation of veneer of the embodiment of the present invention 700.Veneer 700 may include:Input block 701 and initial Change unit 702.
Input block 701, the executable program sent for receiving long-range veneer loader.
Wherein, the operational factor of the executable program is carried in the supplemental characteristic section of the executable program.
Initialization unit 702, for the supplemental characteristic section according to the executable program, initialize the fortune of the executable program Row parameter.
In the embodiment of the present invention, executable program that veneer 700 is sent by receiving veneer loader, and according to executable The operational factor of the information initializing executable program of supplemental characteristic section in program, so as to realize the support Main letters in veneer Several parameter transmission.
Alternatively, input block 701 is specifically used for receiving the executable program by jtag interface or serial ports.
Alternatively, initialization unit 702 is additionally operable to initialize other correlations beyond operational factor in the executable program Value.In addition, as shown in fig. 7, veneer 700 may also include:Execution unit 703, for performing the executable program.
Veneer 700 can also carry out Fig. 2 method, and it is real in Fig. 2, the function of embodiment illustrated in fig. 3, the present invention to possess veneer Example is applied to will not be repeated here.
Fig. 8 is the structural representation of veneer of embodiment of the present invention emulator 800.Veneer emulator 800 may include:Call single Member 801, resolution unit 802, it is loaded into unit 803, data write unit 804 and initialization unit 805.
Call unit 801, for call instruction row parameter.
Wherein, the command line parameter carries executable program mark and the operational factor of the executable program.
Resolution unit 802, for parsing the command line parameter to obtain the mark of the executable program and the executable journey The operational factor of sequence;
Unit 803 is loaded into, for loading the executable program according to the mark of the executable program.
Wherein, the executable program includes supplemental characteristic section.
Data write unit 804, for the executable program for having loaded the operational factor write-in of the executable program In supplemental characteristic section.
Initialization unit 805, for the supplemental characteristic section in the executable program loaded, initializing this can hold The operational factor of line program.
In the embodiment of the present invention, veneer emulator 800 by the operational factor of executable program by writing executable program Supplemental characteristic section in, and the information of the supplemental characteristic section in dry run executable program in executable program is initial Change the operational factor of executable program, so as to realize the analogue simulation of the parameter transmission to supporting Main functions in veneer.
Alternatively, the form of the executable program is ELF.
Alternatively, the initialization unit 805 is additionally operable to initialize other phases beyond operational factor in the executable program Pass is worth.In addition, as shown in figure 8, the veneer emulator also includes:Execution unit 806, for performing the executable program.
Veneer emulator 800 can also carry out Fig. 4 method, and possess veneer emulator in Fig. 4, embodiment illustrated in fig. 5 Function, the embodiment of the present invention will not be repeated here.
Fig. 9 is the structural representation of veneer of embodiment of the present invention loader 900.Veneer loader 900 may include that passage connects Mouth 901, processor 902 and memory 903.
Channel interface 901, processor 902 and memory 903 are connected with each other by the system of bus 904.Bus 904 can be Isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data/address bus, controlling bus etc..For just Only represented in expression, Fig. 9 with a four-headed arrow, it is not intended that an only bus or a type of bus.
Memory 903, for depositing program.Specifically, program can include program code, and described program code includes meter Calculation machine operational order.Memory 903 can include read-only storage and random access memory, and provide and refer to processor 902 Order and data.Memory 903 may include high-speed RAM memory, it is also possible to also including nonvolatile memory (non- Volatile memory), a for example, at least magnetic disk storage.
Processor 902, the program that memory 903 is deposited is performed, and specifically for performing following operate:
Call instruction row parameter, wherein, the command line parameter carries executable program mark and the fortune of the executable program Row parameter;
The command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program;
The executable program is loaded according to the mark of the executable program, wherein, the executable program includes supplemental characteristic Section;
Supplemental characteristic section in the executable program that the operational factor write-in of the executable program has been loaded;
The executable program loaded is sent to by long-range veneer by channel interface 901.
The method that above-mentioned veneer loader or loader as disclosed in any embodiment in Fig. 1 of the present invention performs can be applied Realized in processor 902, or by processor 902.Processor 902 is probably a kind of IC chip, has signal Disposal ability.In implementation process, each step of the above method can pass through the integrated logic circuit of the hardware in processor 902 Or the instruction of software form is completed.Above-mentioned processor 902 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be numeral Signal processor (DSP), application specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) or other programmable logic devices Part, discrete gate or transistor logic, discrete hardware components.It can realize or perform the disclosure in the embodiment of the present invention Each method, step and logic diagram.General processor can be microprocessor or the processor can also be any routine Processor etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processor execution Complete, or completion is performed with the hardware in decoding processor and software module combination.Software module can be located at random storage Device, flash memory, read-only storage, this area such as programmable read only memory or electrically erasable programmable memory, register into In ripe storage medium.The storage medium is located at memory 903, and processor 902 reads the information in memory 903, with reference to it Hardware completes the step of above method.
In the embodiment of the present invention, veneer loader 900 by the operational factor of executable program by writing executable program Supplemental characteristic section, so that veneer can be according to the fortune of the information initializing executable program of the supplemental characteristic section of executable program Row parameter, so as to realize the parameter transmission that Main functions are supported in veneer.
Alternatively, the form of the executable program is ELF.
Alternatively, channel interface 901 can be jtag interface or serial ports.For will have been loaded by channel interface 901 The executable program be sent to long-range veneer during, processor 902 is specifically used for should by jtag interface or serial ports Executable program is sent to long-range veneer.
Veneer loader 900 can also carry out Fig. 1 method, and possess veneer loader or loader in implementation shown in Fig. 1 The function of example, the embodiment of the present invention will not be repeated here.
Figure 10 is the structural representation of veneer of the embodiment of the present invention 1000.Veneer 1000 may include channel interface 1001, place Manage device 1002 and memory 1003.
Channel interface 1001, processor 1002 and memory 1003 are connected with each other by the system of bus 1004.Bus 1004 Can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data/address bus, controlling bus Deng.For ease of representing, only represented in Figure 10 with a four-headed arrow, it is not intended that an only bus or a type of total Line.
Memory 1003, for depositing program.Specifically, program can include program code, and described program code includes Computer-managed instruction.Memory 1003 can include read-only storage and random access memory, and be carried to processor 1002 For instruction and data.Memory 1003 may include high-speed RAM memory, it is also possible to also including nonvolatile memory (non- Volatile memory), a for example, at least magnetic disk storage.
Processor 1002, the program that memory 1003 is deposited is performed, and specifically for performing following operate:
The executable program of long-range veneer loader transmission is received by channel interface 1001, wherein, the executable journey The operational factor of the executable program is carried in the supplemental characteristic section of sequence;
According to the supplemental characteristic section of the executable program, the operational factor of the executable program is initialized.
The method that the above-mentioned veneer as disclosed in any embodiment in Fig. 2-3 of the present invention performs can apply to processor 1002 In, or realized by processor 1002.Processor 1002 is probably a kind of IC chip, has the disposal ability of signal. In implementation process, each step of the above method can pass through the integrated logic circuit or software of the hardware in processor 1002 The instruction of form is completed.Above-mentioned processor 1002 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be numeral Signal processor (DSP), application specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) or other programmable logic devices Part, discrete gate or transistor logic, discrete hardware components.It can realize or perform the disclosure in the embodiment of the present invention Each method, step and logic diagram.General processor can be microprocessor or the processor can also be any routine Processor etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processor execution Complete, or completion is performed with the hardware in decoding processor and software module combination.Software module can be located at random storage Device, flash memory, read-only storage, this area such as programmable read only memory or electrically erasable programmable memory, register into In ripe storage medium.The storage medium is located at memory 1003, and processor 1002 reads the information in memory 1003, with reference to Its hardware completes the step of above method.
In the embodiment of the present invention, executable program that veneer 1000 is sent by receiving veneer loader, and according to can hold The operational factor of the information initializing executable program of supplemental characteristic section in line program, Main is supported so as to realize in veneer The parameter transmission of function.
Alternatively, channel interface 1001 can be jtag interface or serial ports.For being received far by channel interface 1001 During the executable program that the veneer loader of journey is sent, processor 902 is specifically used for connecing by jtag interface or serial ports Receive the executable program.
Alternatively, processor 1002 is additionally operable to initialize other correlations beyond operational factor in the executable program, And perform the executable program.
Veneer 1000 can also carry out Fig. 2 method, and possess veneer in Fig. 2, the function of embodiment illustrated in fig. 3, the present invention Embodiment will not be repeated here.
Figure 11 is the structural representation of veneer of embodiment of the present invention emulator 1100.Veneer emulator 1100 may include passage Interface 1101, processor 1102 and memory 1103.
Channel interface 1101, processor 1102 and memory 1103 are connected with each other by the system of bus 1104.Bus 1104 Can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data/address bus, controlling bus Deng.For ease of representing, only represented in Figure 11 with a four-headed arrow, it is not intended that an only bus or a type of total Line.
Memory 1103, for depositing program.Specifically, program can include program code, and described program code includes Computer-managed instruction.Memory 1103 can include read-only storage and random access memory, and be carried to processor 1102 For instruction and data.Memory 1103 may include high-speed RAM memory, it is also possible to also including nonvolatile memory (non- Volatile memory), a for example, at least magnetic disk storage.
Processor 1102, the program that memory 1103 is deposited is performed, and specifically for performing following operate:
Call unit 1101, for call instruction row parameter, wherein, the command line parameter carry executable program mark and The operational factor of the executable program;
The command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program;
The executable program is loaded according to the mark of the executable program, wherein, the executable program includes supplemental characteristic Section;
Supplemental characteristic section in the executable program that the operational factor write-in of the executable program has been loaded;
According to the supplemental characteristic section in the executable program loaded, the operational factor of the executable program is initialized.
The method that the above-mentioned veneer emulator as disclosed in any embodiment in Fig. 4-5 of the present invention performs can apply to handle In device 1102, or realized by processor 1102.Processor 1102 is probably a kind of IC chip, has the processing of signal Ability.In implementation process, each step of the above method can by the integrated logic circuit of the hardware in processor 1102 or The instruction of person's software form is completed.Above-mentioned processor 1102 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be numeral Signal processor (DSP), application specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) or other programmable logic devices Part, discrete gate or transistor logic, discrete hardware components.It can realize or perform the disclosure in the embodiment of the present invention Each method, step and logic diagram.General processor can be microprocessor or the processor can also be any routine Processor etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processor execution Complete, or completion is performed with the hardware in decoding processor and software module combination.Software module can be located at random storage Device, flash memory, read-only storage, this area such as programmable read only memory or electrically erasable programmable memory, register into In ripe storage medium.The storage medium is located at memory 1103, and processor 1102 reads the information in memory 1103, with reference to Its hardware completes the step of above method.
In the embodiment of the present invention, veneer emulator 1100 by the operational factor of executable program by writing executable program Supplemental characteristic section in, and the information of the supplemental characteristic section in dry run executable program in executable program is initial Change the operational factor of executable program, so as to realize the analogue simulation of the parameter transmission to supporting Main functions in veneer.
Alternatively, the form of the executable program is ELF.
Alternatively, processor 1102 is additionally operable to initialize other correlations beyond operational factor in the executable program, And perform the executable program.
Veneer emulator 1100 can also carry out Fig. 4 method, and possess veneer emulator in Fig. 4, embodiment illustrated in fig. 5 Function, the embodiment of the present invention will not be repeated here.
Those of ordinary skill in the art with reference to each method described in the embodiments described herein it is to be appreciated that walk Rapid and unit, it can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and soft The interchangeability of part, the step of generally describing each embodiment according to function in the above description and composition.These Function is performed with hardware or software mode actually, application-specific and design constraint depending on technical scheme.Ability Domain those of ordinary skill can realize described function using distinct methods to each specific application, but this reality Now it is not considered that beyond the scope of this invention.
The method or step described with reference to the embodiments described herein can use hardware, the software journey of computing device Sequence, or the two combination are implemented.Software program can be placed in random access memory (RAM), internal memory, read-only storage (ROM), Institute is public in electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field In any other form of storage medium known.
Although by reference to the mode of accompanying drawing and combination preferred embodiment to the present invention have been described in detail, the present invention It 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 be to the present invention Embodiment carry out various equivalent modifications or substitutions, and these modifications or substitutions all should be in the covering scope of the present invention.

Claims (14)

  1. A kind of 1. veneer loader, it is characterised in that including:
    Call unit, for call instruction row parameter, wherein, the command line parameter carry executable program mark and it is described can The operational factor of configuration processor, the operational factor of the executable program are the parameter of the principal function of the executable program;
    Resolution unit, for parsing the command line parameter to obtain the mark of the executable program and the executable program Operational factor;
    Unit is loaded into, for loading the executable program according to the mark of the executable program, wherein, the executable journey Sequence includes supplemental characteristic section;
    Data write unit, for the operational factor of the executable program to be write in the executable program loaded Supplemental characteristic section;
    Output unit, for the executable program loaded to be sent into long-range veneer.
  2. 2. veneer loader as claimed in claim 1, it is characterised in that the form of the executable program is executable connection Form ELF.
  3. 3. veneer loader as claimed in claim 1 or 2, it is characterised in that the output unit is specifically used for passing through joint The executable program loaded is sent to long-range veneer by behavioral test tissue jtag interface or serial ports.
  4. A kind of 4. veneer, it is characterised in that including:
    Input block, the executable program sent for receiving long-range veneer loader, the parameter number of the executable program According to the operational factor that the executable program is carried in section, the operational factor of the executable program is the executable program The parameter of principal function;
    Initialization unit, for the supplemental characteristic section according to the executable program, initialize the operation of the executable program Parameter.
  5. 5. veneer as claimed in claim 4, it is characterised in that the input block is specifically used for passing through joint test behavior group Knit jtag interface or serial ports receives the executable program.
  6. 6. the veneer as described in claim 4 or 5, it is characterised in that
    The initialization unit is additionally operable to initialize other correlations beyond operational factor in the executable program;
    The veneer also includes:Execution unit, for performing the executable program.
  7. A kind of 7. veneer emulator, it is characterised in that including:
    Call unit, for call instruction row parameter, wherein, the command line parameter carry executable program mark and it is described can The operational factor of configuration processor, the operational factor of the executable program are the parameter of the principal function of the executable program;
    Resolution unit, for parsing the command line parameter to obtain the mark of the executable program and the executable program Operational factor;
    Unit is loaded into, for loading the executable program according to the mark of the executable program, wherein, the executable journey Sequence includes supplemental characteristic section;
    Data write unit, for the operational factor of the executable program to be write in the executable program loaded Supplemental characteristic section;
    Initialization unit, for the supplemental characteristic section in the executable program loaded, initialize described executable The operational factor of program.
  8. 8. veneer emulator as claimed in claim 7, it is characterised in that the form of the executable program is executable connection Form ELF.
  9. 9. such as claim 7 or 8 or described veneer emulator, it is characterised in that
    The initialization unit is additionally operable to initialize other correlations beyond operational factor in the executable program;
    The veneer emulator also includes:Execution unit, for performing the executable program.
  10. A kind of 10. parameter transfer method, it is characterised in that including:
    Call instruction row parameter, wherein, the command line parameter carries executable program mark and the fortune of the executable program Row parameter, the operational factor of the executable program are the parameter of the principal function of the executable program;
    The command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program;
    The executable program is loaded according to the mark of the executable program, wherein, the executable program includes parameter number According to section;
    The supplemental characteristic section for the executable program that the operational factor write-in of the executable program has been loaded;
    The executable program loaded is sent to long-range veneer.
  11. 11. method as claimed in claim 10, it is characterised in that the form of the executable program is executable linking format ELF。
  12. 12. the method as described in claim 10 or 11, it is characterised in that described to send the executable program loaded Include to long-range veneer:
    The executable program loaded is sent to by long-range veneer by joint test behavior tissue jtag interface or serial ports.
  13. A kind of 13. parameter transfer method, it is characterised in that including:
    Receive the executable program that long-range veneer loader is sent, carried in the supplemental characteristic section of the executable program described in The operational factor of executable program, the operational factor of the executable program are the parameter of the principal function of the executable program;
    According to the supplemental characteristic section of the executable program, the operational factor of the executable program is initialized.
  14. A kind of 14. parameter transfer method, it is characterised in that including:
    Call instruction row parameter, wherein, the command line parameter carries executable program mark and the fortune of the executable program Row parameter, the operational factor of the executable program are the parameter of the principal function of the executable program;
    The command line parameter is parsed to obtain the operational factor of the mark of the executable program and the executable program;
    The executable program is loaded according to the mark of the executable program, wherein, the executable program includes parameter number According to section;
    Supplemental characteristic section in the executable program that the operational factor write-in of the executable program has been loaded;
    According to the supplemental characteristic section in the executable program loaded, the operational factor of the executable program is initialized.
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 CN104503738A (en) 2015-04-08
CN104503738B true 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 (4)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011161722A1 (en) * 2010-06-24 2011-12-29 Hitachi, Ltd. Data transfer system and data transfer method

Patent Citations (4)

* 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
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
CN104503738A (en) 2015-04-08

Similar Documents

Publication Publication Date Title
Johnson et al. Jetset: Targeted firmware rehosting for embedded systems
Van der Hoeven et al. Emulation for digital preservation in practice: The results
US20040237062A1 (en) Method and apparatus for emulating a hardware/software system using a computer
Bazhaniuk et al. Symbolic Execution for {BIOS} Security
Lacamera Embedded Systems Architecture: Explore architectural concepts, pragmatic design patterns, and best practices to produce robust systems
US10915426B2 (en) Intercepting and recording calls to a module in real-time
Liu et al. Firmguide: Boosting the capability of rehosting embedded linux kernels through model-guided kernel execution
CN111176663B (en) Data processing method, device, equipment and storage medium of application program
CN104503738B (en) Parameter transfer method, veneer loader, veneer and veneer emulator
Casinghino et al. Using binary analysis frameworks: The case for BAP and angr
CN116126690A (en) Debugging method and system for lightweight embedded system
CN109144575B (en) Device and method for running application across operating systems, electronic equipment and memory
CN112380133B (en) Method and device for simulating instruction set simulator by utilizing function library
Dinda Towards virtual passthrough I/O on commodity devices
CN101593257B (en) System and method for protecting software based on.Net virtual machine
Ye Embedded programming with Android: bringing up an Android system from scratch
US20220066911A1 (en) Virtual machine for developing and testing target code for hardware designs
Nappa et al. Fuzzing Against the Machine: Automate vulnerability research with emulated IoT devices on QEMU
US11989291B2 (en) System, method, and apparatus for software verification
Shehzad et al. Modular Software for MicroTCA. 4 Based Control Applications
WO2024069772A1 (en) Analysis device, analysis method, and analysis program
JP3308953B2 (en) Debugger, debugging method, and recording medium recording debug program
Wootton et al. General Purpose Input/Output (GPIO)
Lindblom Nuking Duke Nukem: Reaching the Stack via a Glboal Buffer Overflow in DOS Protected Mode
Kovač et al. Development of Programmable Logic Controller Emulator With QEMU

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: Super fusion Digital Technology Co.,Ltd.

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

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.