Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide the program debugging method in a kind of ONU system and system, for solving the program debugging method problem that spended time is longer in compiling and burning in existing ONU system.
For achieving the above object and other relevant objects, the invention provides the program debugging method in a kind of ONU system, be applicable to linux system, the program debugging method in described ONU system comprises: control the ONU after powering up startup and rest on the order line stage; Utilize the startup configuration parameter in the start-up loading system of the described ONU of amendment order amendment; After described startup configuration parameter has been revised, utilize replacement order to restart described ONU, so that the automatic carry network file system(NFS) of described ONU is the root file system of self, carried out program debug.
Alternatively, the program debugging method in described ONU system also comprises: load and install and open TFTP service system and network file system(NFS); Open the share directory configuration file of described network file system(NFS), and the file directory needing to share and relevant priority assignation are write in described share directory configuration file; In Linux dialog box, enter exploitation catalogue, compiling configuration is carried out to the engineering project under described exploitation catalogue; Enter local command and be about to the first file copy in the root directory of described TFTP service system, to power up the ONU after startup loads linux system from described root directory kernel mirror image by network.
Alternatively, described linux system comprises a kind of implementation procedure that the engineering project under described exploitation catalogue carries out compiling configuration: the configuration file being loaded into current use; Selecting the root file system option in described configuration file, is network file system(NFS) parameter by the compressed read-only file system parameter modification in described root file system option; Select the driving option in described configuration file, the parameter M of the Ethernet item in described driving option is revised as desirable value; Preserve amended configuration file; Clear up the whole engineering project under described exploitation catalogue; Described amended configuration file is utilized to compile described whole engineering project.
Alternatively, program debugging method in described ONU system comprises: after the kernel of described linux system powers up operation, the file directory carry utilizing high-speed radio gateway to be shared by described needs by network is at the root directory of self, so that the internal memory that the relative program of file directory that described needs are shared by described high-speed radio gateway calls in self runs.
The present invention also provides the program debug system in a kind of ONU system, be applicable to linux system, program debug system in described ONU system comprises: control module, control the ONU after powering up startup and rest on the order line stage, utilize the startup configuration parameter in the start-up loading system of the described ONU of amendment order amendment, after described startup configuration parameter has been revised, replacement order is utilized to restart described ONU, so that the automatic carry network file system(NFS) of described ONU is the root file system of self, carry out program debug.
Alternatively, the program debug system in described ONU system also comprises: load-on module, loads and installs and open TFTP service system and network file system(NFS); Writing module, is connected with described load-on module, opens the share directory configuration file of described network file system(NFS), and writes in described share directory configuration file by the file directory needing to share and relevant priority assignation; Configuration module, is connected with said write module, enters exploitation catalogue in Linux dialog box, carries out compiling configuration to the engineering project under described exploitation catalogue; Copy module, be connected with described configuration module, enter local command and be about to the first file copy in the root directory of described TFTP service system, to power up the ONU after startup loads described linux system from described root directory kernel mirror image by network.
Alternatively, described configuration module comprises: be loaded into unit, be loaded into the configuration file of current use; First amendment unit, being connected with described loading unit, selecting the root file system option in described configuration file, is network file system(NFS) parameter by the compressed read-only file system parameter modification in described root file system option; Second amendment unit, revises unit be connected with described first, select the driving option in described configuration file, the parameter M of the Ethernet item in described driving option is revised as desirable value; Storage unit, revises unit be connected with described second, preserve amended configuration file; Cleaning unit, is connected with described storage unit, clears up the whole engineering project under described exploitation catalogue; Compilation unit, is connected with storage unit respectively with described cleaning unit, utilizes described amended configuration file to compile described whole engineering project.
Alternatively, after the kernel of described linux system powers up operation, the file directory carry that described linux system utilizes high-speed radio gateway to be shared by described needs by network is at the root directory of self, so that the internal memory that the relative program of the file directory that described needs are shared by described high-speed radio gateway calls in self runs, be convenient to the kernel mirror image that the ONU after powering up startup loads linux system.
As mentioned above, the program debugging method in ONU system of the present invention and system, have following beneficial effect:
The present invention has broken away from the process of burning image, the debugging of ONU and test is become and is more prone to.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this instructions can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this instructions also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
Refer to Fig. 1, the embodiment of the present invention provides the program debugging method in a kind of ONU system, is applicable to linux system, and the program debugging method in described ONU system comprises:
S101, described linux system loads and installs and open TFTP (TrivialFileTransferProtocol, TFTP) service system and network file system(NFS) (NetworkFileSystem, NFS).Network file system(NFS) (NetworkFileSystem, NFS) be a kind of one mechanism subregion (catalogue) on distance host being mounted to local system through network, by the support to network file system(NFS), user can operate the shared partition (catalogue) of distance host on a local system as operation Local partition.
S102, described linux system opens the share directory configuration file of described network file system(NFS), and the file directory needing to share and relevant priority assignation is write in described share directory configuration file.
S103, described linux system enters exploitation catalogue in Linux dialog box, carries out compiling configuration to the engineering project under described exploitation catalogue.
Further, shown in Figure 2, described linux system comprises a kind of implementation procedure that the engineering project under described exploitation catalogue carries out compiling configuration:
S201, is loaded into the configuration file Profile of current use;
S202, selecting the Rootfilesystemselection option (i.e. root file system option) in described Profile, is NFS (network file system(NFS)) parameter by SQUASHFS (SquashFS is a set of compressed read-only file system used based on the linux kernel) parameter modification in described Rootfilesystemselection option;
S203, select the Driverselection option (driving option) in described Profile, the parameter <M> of Ethernet (Ethernet) item in described Driverselection option is revised as <*>, the parameter M of the Ethernet item in described driving option is revised as desirable value;
S204, preserves amended Profile;
S205, clears up the whole engineering project under described exploitation catalogue;
S206, utilizes described amended Profile to compile described whole engineering project.
S104, described linux system enters local command and is about to the first file copy in the root directory of described TFTP service system, to power up the ONU after startup loads described linux system from described root directory kernel mirror image by network.
Further, shown in Figure 3, described in power up startup after ONU a kind of implementation procedure of being loaded the kernel mirror image of described linux system by network from described root directory comprise:
S301, described linux system controls the ONU after powering up startup and rests on the order line stage.
S302, described linux system uses c order (namely revising order) to revise the startup configuration parameter of Bootloader (start-up loading system).
S303, described linux system, after described startup configuration parameter has been revised, uses reset order (namely resetting order) to restart described ONU, so that network file system(NFS) is the root file system of self described in the automatic carry of described ONU.
S105, after the kernel of described linux system powers up operation, the file directory carry utilizing CPE (high-speed radio gateway) to be shared by described needs by network is at the root directory of self, so that the internal memory that the relative program of file directory that described needs are shared by described CPE (high-speed radio gateway) calls in self runs.CPE (high-speed radio gateway) is exactly a kind of equipment high speed 4G signal being converted to the general WiFi signal of the mobile terminals such as panel computer, smart mobile phone, notebook, can support that multi-section terminal is surfed the Net simultaneously, sizableness is in a book, there iing the place of 4G quorum sensing inhibitor, plug in and just can use, need not draw in the net line, use and carry all very convenient.
The present invention relates to the method for ONU system Program debugging, it debugs the exploitation program in ONU system by the network file system(NFS) NFS of the tftp that utilizes Bootloader to provide service and Linux, this method is without the need to being burnt to the image of compiling on ONU plank, when have modified in code somewhere after, only need to compile, then restart ONU just can realize having debugged, the kernel used in ONU and file system are completely on the PC of developer this locality.Like this, just eliminate the time of burning, the thing of amendment just can be verified at once.
The protection domain of the program debugging method in ONU system of the present invention is not limited to the step execution sequence that the present embodiment is enumerated, and the step increase and decrease of the prior art that every principle according to the present invention is done, step are replaced the scheme realized and be all included in protection scope of the present invention.
The present invention also provides the program debug system in a kind of ONU system; program debug system in described ONU system can realize the program debugging method in ONU system of the present invention; but the implement device of the program debugging method in ONU system of the present invention includes but not limited to the structure of the program debug system in the ONU system that the present embodiment is enumerated; the malformation of the prior art that every principle according to the present invention is done and replacement, be all included in protection scope of the present invention.
Shown in Figure 4, the one of the program debug system 500 in described ONU system realizes scene and is: the program debug system 500 in described ONU system communicates with CPE300 and is connected, and described CPE300 and ONU plank 100 communicates and is connected.
Shown in Figure 5, the program debug system 500 in described ONU system is applicable to linux system, and the program debug system 500 in described ONU system comprises: load-on module 510, writing module 520, configuration module 530, copy module 540, control module 550.
Described load-on module 510 loads and installs and open TFTP service system and network file system(NFS).
Said write module 520 is connected with described load-on module 510, opens the share directory configuration file of described network file system(NFS), and the file directory needing to share and relevant priority assignation is write in described share directory configuration file.
Described configuration module 530 is connected with said write module 520, enters exploitation catalogue in Linux dialog box, carries out compiling configuration to the engineering project under described exploitation catalogue.
Further, shown in Figure 6, described configuration module 530 comprises: be loaded into unit 531, first and revise unit 532, second amendment unit 533, storage unit 534, cleaning unit 535, compilation unit 536.
Described loading unit 531 is loaded into the Profile of current use.
Described first amendment unit 532 is connected with described loading unit 531, and selecting the Rootfilesystemselection option in described Profile, is NFS by the SQUASHFS parameter modification in described Rootfilesystemselection option.
Described second amendment unit 533 and described first is revised unit 532 and is connected, select the Driverselection option in described Profile, the parameter <M> of the Ethernet item in described Driverselection option is revised as <*>.
Described storage unit 534 and described second is revised unit 533 and is connected, and preserves amended Profile.
Described cleaning unit 535 is connected with described storage unit 534, clears up the whole engineering project under described exploitation catalogue.
Described compilation unit 536 is connected with storage unit 534 respectively with described cleaning unit 535, utilizes described amended Profile to compile described whole engineering project.
Described copy module 540 is connected with described configuration module 530, enter local command and be about to the first file copy in the root directory of described TFTP service system, to power up the ONU after startup loads described linux system from described root directory kernel mirror image by network.
Described control module 550 is connected with described copy module 540, described control module controls the ONU after powering up startup and rests on the order line stage, use the startup configuration parameter of c order amendment Bootloader, after described startup configuration parameter has been revised, reset order is used to restart described ONU, so that network file system(NFS) is the root file system of self described in the automatic carry of described ONU.
After the kernel of described linux system powers up operation, the file directory carry that described linux system utilizes CPE to be shared by described needs by network is at the root directory of self, so that the internal memory that the relative program of file directory that described needs are shared by described CPE calls in self runs.
A kind of specific implementation process of the program debugging method in the ONU system described in the embodiment of the present invention is:
1) installed on the LINUX system PC of debugging ONU product and opened TFTPserver and NFSserver service, having guaranteed the operation that debugged program can be correct.
2) the share directory configuration file of nfs server (being generally speaking /etc/exports file) is found, use vi or other text compiler to open this share directory configuration file, then the file directory needing to share and priority assignation are written in this share directory configuration file.Such as :/opt/bcm963xx/targets/96358GW/fs192.168.1.* (rw, no_root_squash)/opt/bcm963xx/targets/96358GW/fs " for needing the catalogue of shared or carry.CPE powers up startup, after kernel gets up, CPE to be shared by these needs by network or the catalogue carry of carry is its root directory, and all programs (except kernel) run afterwards are all to share from this or the catalogue of carry is called in CPE internal memory and run.Wherein, " 192.168.1.* " be access control of authority, represent that the host of all 192.168.1. network segments can access this catalogue, " * " number be represent 0 ~ 255 Any Digit.Last " (rw, no_root_squash) " represents the access limit of this catalogue, be that the loom of this catalogue of statement carry can be read and write arbitrarily this catalogue here, and authority is equivalent to root.
3) in Linux session, exploitation catalogue is entered, as :/opt/bcm963xx.Then run makemenuconfig order, compiling configuration is carried out to project.The compiling of amendment is needed to be configured to:
A. the Profile of current use is loaded into;
B. select Rootfilesystemselection option, SQUASHFS is revised as NFS;
C. select Driverselection option, find Ethernet item, then <M> is revised as <*>;
D. amended Profile is preserved;
4) the whole engineering below exploitation catalogue, all clean is once.
5) amended Profile is just now used now to carry out the compiling of whole engineering.
6) local command line is entered, then by the root directory of bcm963xx/targets/96368GW/vmlinux file copy to TFTP, as :/tftproot catalogue.After ONU starts, ONU will load linux kernel mirror image with file directory by network from this.
7) power up startup ONU plank, then make ONU plank rest on the order line stage, use the startup configuration parameter of ' c ' order amendment Bootloader.Use after having revised reset order to restart ONU plank, restart rear CPE and TFTP agreement will be used to obtain kernel mirror image from Host machine call in CPE internal memory, then run this kernel mirror image.Kernel has started, and automatic carry NFS file system is its root file system by ONU plank, and whole system has also just been got up.
The present invention has broken away from the process of burning image, the debugging of ONU and test is become and is more prone to.Compared with best prior art, the invention has the advantages that without the need to the image of compiling is burnt on ONU plank, when have modified in code somewhere after, only need to compile, then restart ONU and just can realize having debugged.
In sum, the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.