The integrated update method of embedded system loading procedure and application program
Technical field
The present invention relates to the renewal technology of built-in system software program, specifically be meant the integrated update method of embedded system loading procedure and application program.
Background technology
Embedded system is application-centered, but the dedicated computer system of software and hardware cutting.Generally form, be used to realize control, supervision and management miscellaneous equipment by flush bonding processor, peripheral hardware equipment, embedded OS and application program of user.The order that embedded system starts generally is that CPU moved from fixed address when system powered on, normally the 0x00000000 position of FLASH ROM; Boot loader brings into operation, and is downloading mode or loading mode according to external world's input decision start-up mode; Construct embedded system at last and start environment, start embedded OS and application program.Downloading mode is used for finishing the work that the user upgrades operating system or application program, and this part working routine is stored among the isolated low capacity ROM usually; Loading mode is used for finishing and is loaded into work among the main memory block RAM in the embedded system being kept at application data in the FLASH ROM storer.
The renewal that is kept at built-in system software program among the FLASH ROM has dual mode: burning and download; Burning refers to use the internal processes of special-purpose burning renewal of the equipment embedded system, and general burning can only be upgraded the routine data in the same group of storer; Download is meant to carry out and downloads that downloading writes FLASH ROM storer to the data of coming by the communication interface transmission in embedded system.Usually, embedded system is used burning schema update loading procedure, uses downloading mode to upgrade embedded OS and application program.This built-in system software more new model not only will be operated twice (burning, once download), and if downloading process occur unusually, will cause the collapse of total system.
Summary of the invention
The objective of the invention is to overcome the shortcoming and defect of above-mentioned prior art, provide embedded system loading procedure and application program integrated update method, it is simple to operate, and security is good.
Purpose of the present invention is achieved through the following technical solutions: the integrated update method of this embedded system loading procedure and application program, and its step comprises:
(1) loading procedure, load information and application program input computing machine, by compiler compiling is unified in the combination of loading procedure and application program, generation can a burning data, this data form computer outputs to cd-rom recorder, and cd-rom recorder is burnt among the unique storage stack FLASH ROM of flush bonding processor by the burning cable; Described load information is to be used for preserving the described information that needs loading application programs;
Simultaneously, by compiler from compile back loading procedure, load information and application program can the data of a burning, application program is decomposed out, generation downloads;
(2) embedded system is carried out back-up processing to its operating system and application program after the burning, promptly preserves two parts of operating systems and application program in the storer, and portion is in Status of Backups, and portion is in state of activation in addition;
(3) after embedded OS and application program launching, embedded system starts simultaneously and downloads, and receives the routine data that transmission comes by communication interface, finishes the renewal of backup embedded OS and application program;
(4) after downloading successfully, download, will back up embedded OS and application program and activate, and current embedded OS and Application Status are changed to Status of Backups by revising load information;
(5) new embedded OS resets, and loads new application program operation, thereby only uses the burning of embedded system of storage stack FLASH ROM to finish the renewal of described application program in the realization of Development and Production stage.
Must realize the present invention for better, the described storer FLASH of step (1) ROM comprises routine data conservation zone 1#, routine data conservation zone 2#, loading procedure promoter region and load information conservation zone; Described routine data conservation zone 1# is the data storage area when developing the production burning; Routine data conservation zone 2# is the blank back-up storage district that alternately does program backup work with routine data conservation zone 1#; Data storage area when loading procedure promoter region and load information conservation zone are burning program.
In the described compilation process of step (1), the operation to interruption, function and variable between loading procedure and the application program must be isolated fully.
Load information forced to be set to load default application program when the described back-up processing of step (2) was meant burning.
The loading of the described new application program of step (5), comprise the steps: that the loading procedure that deposit the loading procedure promoter region at first moves, judge according to the load information of load information conservation zone then if during the program run among the 1# of routine data conservation zone, require the application program that is kept among the 1# of routine data conservation zone to copy among the RAM according to the initialization that moves, otherwise the application program among the reproducer data conservation zone 2#, initialization application program is then moved needed variable and interrupt vector, changes the entry address in RAM of jumping to application program at last and finishes loading work; Download if carry out successful application program after the embedded system burning, it is empty that routine data conservation zone 2# just is always, start-up loading just must be application program among the 1# of routine data conservation zone.
The present invention compared with prior art has following advantage and beneficial effect: the first secondary program of simplifying existing system is written into flow process, makes things convenient for application software and load software combined debugging; Simple to operate, security is good.
Description of drawings
Fig. 1,2 is respectively burning, the download synoptic diagram of embedded system loading procedure and the existing more new model of application program;
Fig. 3,4 is respectively burning, the download synoptic diagram of embedded system loading procedure of the present invention and the integrated more new model of application program;
Fig. 5 is that the storage space of storer of the present invention constitutes synoptic diagram;
Fig. 6 is the loading schematic flow sheet of new application program of the present invention.
Embodiment
Below in conjunction with embodiment and accompanying drawing, the present invention is described in further detail, but embodiments of the present invention are not limited thereto.
Embodiment one
As shown in Figure 1, 2, in the prior art, the update method of embedded system loading procedure and application program need be operated twice, burning (Fig. 1), once downloads (Fig. 2).
Shown in Fig. 3,4, the integrated update method of this embedded system loading procedure and application program comprises the steps:
(1) loading procedure, load information and application program input computing machine, by compiler compiling is unified in the combination of loading procedure and application program, generation can a burning data, this data form computer outputs to cd-rom recorder, and cd-rom recorder is burnt among the unique storage stack FLASH ROM of flush bonding processor by the burning cable; Described load information is to be used for preserving the described information that needs loading application programs;
Simultaneously, by compiler from compile back loading procedure, load information and application program can the data of a burning, application program is decomposed out, generation downloads;
(2) embedded system is carried out back-up processing to its operating system and application program after the burning, promptly preserves two parts of operating systems and application program in the storer, and portion is in Status of Backups, and portion is in state of activation in addition;
(3) after embedded OS and application program launching, embedded system starts simultaneously and downloads, and receives the routine data that transmission comes by communication interface, finishes the renewal of backup embedded OS and application program;
(4) after downloading successfully, download, will back up embedded OS and application program and activate, and current embedded OS and Application Status are changed to Status of Backups by revising load information;
(5) new embedded OS resets, and loads new application program operation, thereby only uses the burning of embedded system of storage stack FLASH ROM to finish the renewal of described application program in the realization of Development and Production stage.
Wherein, as shown in Figure 5, the described storer FLASH of step (1) ROM comprises routine data conservation zone 1#, routine data conservation zone 2#, loading procedure promoter region and load information conservation zone; Described routine data conservation zone 1# is the data storage area when developing the production burning; Routine data conservation zone 2# is the blank back-up storage district that alternately does program backup work with routine data conservation zone 1#; Data storage area when loading procedure promoter region and load information conservation zone are burning program.
In the described compilation process of step (1), the operation to interruption, function and variable between loading procedure and the application program must be isolated fully.
Load information forced to be set to load default application program when the described back-up processing of step (2) was meant burning.
As shown in Figure 6, the loading of the described new application program of step (5), comprise the steps: that the loading procedure that deposit the loading procedure promoter region at first moves, judge according to the load information of load information conservation zone then if during the program run among the 1# of routine data conservation zone, require the application program that is kept among the 1# of routine data conservation zone to copy among the RAM according to the initialization that moves, otherwise the application program among the reproducer data conservation zone 2#, initialization application program is then moved needed variable and interrupt vector, changes the entry address in RAM of jumping to application program at last and finishes loading work; Download if carry out successful application program after the embedded system burning, it is empty that routine data conservation zone 2# just is always, start-up loading just must be application program among the 1# of routine data conservation zone.
As mentioned above, just can realize the present invention preferably.