Invention content
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of compiling sides of software development kit
Method, system and the switch device being applicable in, for solving kernel and the occupied storage of kernel module file in the prior art
The problem of space is excessive.
In order to achieve the above objects and other related objects, the present invention provides a kind of Compilation Method of software development kit, including
Following steps:Required software development kit public library is called to be compressed together with kernel program kernel module file, obtain kernel
With with the relevant inquiry list of parameter information each in the software development kit public library;Kernel module file is loaded, and is therefrom read
The parameter information of called software development kit public library is taken, is believed by inquiring the inquiry list with obtaining read parameter
The corresponding software development kit public library being located in the kernel of breath;Call the software development kit inquired in the kernel
Public library, and run the kernel module file.
Preferably, it is described required software development kit public library to be called to be pressed together with kernel program kernel module file
Contracting obtains including with the mode of the relevant inquiry list of parameter information each in the software development kit public library:By kernel module
File calls required software development kit public library to be compiled together with kernel program, and generate core symbo file;From the core
Export and each relevant inquiry list of parameter information in the software development kit public library in heart symbol file, and will be after compiling
Kernel program and the inquiry list after software development kit public library, compiling is together as kernel, and compressed.
Preferably, the mode of the loading kernel module file includes:Kernel module file is loaded by serial ports.
Preferably, the loading kernel module file, and therefrom read the parameter of called software development kit public library
Information is opened by inquiring the inquiry list with obtaining the software being located in the kernel corresponding to read parameter information
The mode of public library of giving out a contract for a project includes:During the kernel module file is loaded, it is public to extract software development kit in corresponding kernel
Parameter information without link in library;
It is corresponding, it is described to call the software development kit public library inquired in kernel, and run the kernel module text
The mode of part includes:Using the external software development kit public library transferred command calls and inquired, and run the kernel module
File.
Based on above-mentioned purpose, the present invention also provides a kind of compiling system of software development kit, including:Kernel generation module,
For by kernel module file call needed for software development kit public library compressed together with kernel program, obtain kernel and with institute
State each relevant inquiry list of parameter information in software development kit public library;Public library calling module, for loading kernel module
File, and therefrom read the parameter information of called software development kit public library, by inquiring the inquiry list to obtain
The software development kit public library being located in the kernel corresponding to read parameter information;Kernel module running paper mould
Block for calling the software development kit public library inquired in the kernel, and runs the kernel module file.
Preferably, the kernel generation module be used for by kernel module file call needed for software development kit public library with
Kernel program compiles together, and generates core symbo file;And it exports from the core symbo file and is opened with the software
Give out a contract for a project each relevant inquiry list of parameter information in public library, and by after compiling software development kit public library, after compiling in
Core program and the inquiry list are together as kernel, and compressed.
Preferably, the public library calling module is used to load kernel module file by serial ports.
Preferably, the public library calling module is used for during the kernel module file is loaded, and extraction to be called
Software development kit public library in the parameter information without link;
Corresponding, the kernel module running paper module is opened for transferring the software that command calls are inquired using outside
Give out a contract for a project public library, and run the kernel module file.
Based on above-mentioned purpose, the present invention also provides a kind of switch device, including:As above any compiling system.
As described above, the present invention software development kit Compilation Method, system and the switch device being applicable in, with
Lower advantageous effect:Script is located at the public library in kernel module file to extract, is put into kernel, utilizes the compression of kernel
Mechanism effectively reduces the occupied memory space of public library, and more memory spaces are provided for operation application program;Separately
Outside, the core symbo file generated during being compiled using kernel is believed to export with parameter each in the software development kit public library
Relevant inquiry list is ceased, can be convenient for carrying out parameter information each in software development kit public library during loading kernel module file
Quick search;In addition, using serial ports load kernel module file, can particular for the switch device without debugging serial interface,
During effectively increasing exploitation debugging, the efficiency of kernel module file is loaded;In addition, remove in kernel module file in kernel
Public library links consistent link, can prevent mistake occur when calling public library.
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification
Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from
Various modifications or alterations are carried out under the spirit of the present invention.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
It should be noted that the diagram provided in following embodiment only illustrates the basic structure of the present invention in a schematic way
Think, component count, shape and size when only display is with related component in the present invention rather than according to actual implementation in schema then
It draws, kenel, quantity and the ratio of each component can be a kind of random change during actual implementation, and its assembly layout kenel
It is likely more complexity.
Referring to Fig. 1, the present invention provides a kind of Compilation Method of software development kit.The Compilation Method is used primarily in exchange
In the embedded OSs such as machine.The Compilation Method is mainly connected by installing in a switch or by serial ports with interchanger
Commissioning device in compiling system perform.
In step sl, kernel module file is called required software development kit public library (SDK) by the compiling system
It compresses with kernel program, obtain kernel and is arranged with the relevant inquiry of parameter information each in the software development kit public library together
Table.
By taking (SuSE) Linux OS as an example, kernel module file includes:linux-kernel-bde.ko、linux-bcm-
Core.ko, linux-uk-proxy.ko, linux-bcm-diag.ko etc., calling is soft needed for each kernel module file
File in part development kit public library includes but not limited to:libbcmx.a、libbcm.alibbcm_esw.a、
libsoccommon.a、libfirebolt.a、libbradley.a、libtriumph.a、libtrx.a、libtriumph2.a
Deng the file using .a as suffix.
Specifically, script is located at the software development kit public library in each kernel module file and extracted by research staff,
And the compiling system is instructed by the kernel in the All Files and embedded OS in the software development kit public library
Program is compiled and is compressed together, to obtain kernel.In compilation process, the compiling system will the corresponding software development Bao Zheng
The parameter information of each file is individually created an inquiry list, and be stored in the system file directory of kernel in library altogether.
Preferably, when the compiling system is compiled software development kit public library and kernel program, the compiling
Applications are supplied in parameter information of the system generation comprising each file in the software development kit public library and the kernel program
The core symbo file (the bcm-core-symbols.h files under such as Linux) of the parameter information of calling;Again from the core
Export and each relevant inquiry list of parameter information in the software development kit public library in symbol file, and will be soft after compiling
Kernel program and the inquiry list after part development kit public library, compiling are used as kernel together.Then, the compiling system is adopted
With such as GZIP tools of compression etc., obtained kernel is compressed.Wherein, the parameter information includes but not limited to:Kernel
Required function and address of variable etc. when module file calls.
In step s 2, the kernel module file of software development kit public library is removed in the compiling system loading, and therefrom
The parameter information of called software development kit public library is read, by inquiring the inquiry list to obtain read parameter
The software development kit public library being located in the kernel corresponding to information.
Specifically, when no longer link software development kit public library in kernel module file, in the kernel module file
Only indicate the parameter information in the software development kit public library to be called.The compiling system loads the kernel module file
When, the content in the kernel module file is read, and called software development Bao Zheng is determined using preset key symbol
The parameter information in library altogether.Read parameter information and inquiry list are subjected to match query again, to obtain read parameter
The software development kit public library being located in the kernel corresponding to information.
Wherein, when on interchanger without debugging serial interface, the compiling system loads kernel module file by serial ports.
In step s3, the compiling system calls the software development kit public library inquired in the kernel, and transports
The row kernel module file.
Since each parameter information that software development kit public library in kernel is corresponded in the kernel module file has no accordingly
Link, the compiling system found by inquiry in inquiry list after corresponding file, and generation includes filename, read-write life
Order is transferred, and pass through and run the outside and transfer the software development kit public library that command calls are inquired in the outside enabled etc., with
Just the kernel module file is run.
By taking (SuSE) Linux OS as an example, the compiling system is interior using insmod order dynamic loads SDK compiling generations
Core module file, to carry out exploitation debugging to it.
It should be noted that it should be appreciated by those skilled in the art that above-mentioned Compilation Method can be used in (SuSE) Linux OS
In, it can also be used in other operating systems with compressible kernel.The embedded OS occurred from now on can such as be applied
Scheme of the present invention, should also be covered in it is of the present invention within the scope of.
Referring to Fig. 2, the present invention provides a kind of compiling system of software development kit.The compiling system is used primarily in exchange
In the embedded OSs such as machine.The compiling system is mainly connected by installing in a switch or by serial ports with interchanger
Commissioning device in software perform.
The compiling system 1 includes:Kernel generation module 11, public library calling module 12, kernel module running paper mould
Block 13.
The kernel generation module 11 be used for by kernel module file call needed for software development kit public library (SDK) with
Kernel program compresses together, obtain kernel and with the relevant inquiry list of parameter information each in the software development kit public library.
By taking (SuSE) Linux OS as an example, kernel module file includes:linux-kernel-bde.ko、linux-bcm-
Core.ko, linux-uk-proxy.ko, linux-bcm-diag.ko etc., calling is soft needed for each kernel module file
File in part development kit public library includes but not limited to:libbcmx.a、libbcm.alibbcm_esw.a、
libsoccommon.a、libfirebolt.a、libbradley.a、libtriumph.a、libtrx.a、libtriumph2.a
Deng the file using .a as suffix.
Specifically, script is located at the software development kit public library in each kernel module file and extracted by research staff,
And instruct the kernel generation module 11 will be in the All Files and embedded OS in the software development kit public library
Kernel program compile and compress together, to obtain kernel.In compilation process, the kernel generation module 11 will be described in correspondence
The parameter information of each file is individually created an inquiry list in software development kit public library, and is stored in the system file mesh of kernel
In record.
Preferably, when the kernel generation module 11 is compiled software development kit public library and kernel program, institute
State parameter information of the generation of kernel generation module 11 comprising each file in the software development kit public library and the kernel program
The core symbo file (the bcm-core-symbols.h files under such as Linux) of the middle parameter information called for applications;
Export and each relevant inquiry list of parameter information in the software development kit public library from the core symbo file again, and
Using the software development kit public library after compiling, the kernel program after compiling and the inquiry list together as kernel.Then, institute
It states kernel generation module 11 and uses such as GZIP tools of compression, obtained kernel is compressed.Wherein, the parameter information
Including but not limited to:Required function and address of variable etc. when kernel module file calls.
The public library calling module 12 removes the kernel module file of software development kit public library for loading, and therefrom
The parameter information of called software development kit public library is read, by inquiring the inquiry list to obtain read parameter
The software development kit public library being located in the kernel corresponding to information.
Specifically, when no longer link software development kit public library in kernel module file, in the kernel module file
Only indicate the parameter information in the software development kit public library to be called.The public library calling module 12 loads the kernel
During module file, the content in the kernel module file is read, and called software is determined using preset key symbol
The parameter information of development kit public library.Read parameter information and inquiry list are subjected to match query again, to obtain being read
The software development kit public library being located in the kernel corresponding to the parameter information taken.
Wherein, when on interchanger without debugging serial interface, the public library calling module 12 loads kernel mould by serial ports
Block file.
The kernel module running paper module 13 is used to call the software development kit inquired in the kernel public
Library, and run the kernel module file.
Since each parameter information that software development kit public library in kernel is corresponded in the kernel module file has no accordingly
Link, in inquiry list is found by inquiry after corresponding file, generation includes the kernel module running paper module 13
Order is transferred in the outside of filename, read write command etc., and passes through to run the outside and transfer the software that command calls are inquired and open
Give out a contract for a project public library, to run the kernel module file.
By taking (SuSE) Linux OS as an example, the kernel module running paper module 13 uses insmod order dynamic loads
The kernel module file of SDK compiling generations, to carry out exploitation debugging to it.
It should be noted that it should be appreciated by those skilled in the art that above-mentioned compiling system 1 can be used in Linux operations system
In system, it can also be used in other operating systems with compressible kernel.The embedded OS occurred from now on can such as answer
With scheme of the present invention, should also be covered in it is of the present invention within the scope of.
It extracts, is put into kernel in conclusion script is located at the public library in kernel module file by the present invention, profit
With the compression mechanism of kernel, the occupied memory space of public library is effectively reduced, is provided more for operation application program
Memory space;In addition, the core symbo file generated during being compiled using kernel is public with the software development kit to export
Each relevant inquiry list of parameter information in library, to each in software development kit public library when can be convenient for loading kernel module file
Parameter information carries out quick search;In addition, kernel module file is loaded using serial ports, it can be particular for without debugging serial interface
Switch device during effectively increasing exploitation debugging, loads the efficiency of kernel module file;In addition, remove kernel module text
In part in kernel public library link it is consistent link, can prevent call public library when there is mistake.So the present invention has
Effect overcomes various shortcoming of the prior art and has high industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause
This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as
Into all equivalent modifications or change, should by the present invention claim be covered.