Make up the method for multiple boot storage organization and backup
Technical field
The present invention relates to a kind of multiple boot storage organization and backup of the method that makes up multisystem reboot storage organization and backup, particularly vehicle-mounted computer system.
Background technology
Along with the widespread use of embedded technology in various vehicle electronics products, data storage in the embedded system and safety have become an important research project.MLC(MultiLevelCell, the multiple field storage) NANDFlash is with high density, high capacity, high data storage speed, and characteristics such as more erasing times, become the main flow that the embedded memory device of high capacity is used gradually, be mainly used in storage system program and data.But its intrinsic memory mechanism and have this deadly defect of bad piece becomes its major obstacle in application, and all flash devices all are subjected to the puzzlement of position exchange phenomenon, and MLCNAND is especially serious.This problem is not fatal for MLCNAND storage multimedia messages the time.But; if when coming storage operating system, configuration file or other sensitive informations with local memory device; this slight hitch may cause system-down; though can use the ECC system to guarantee reliability; but the error correcting capability of ECC is limited, so can not guarantee the stability of system.In addition, the structure of system all is only to be divided into two parts (boot and system) now, after system powered on, CPU can remove to read boot, and the size of boot is generally about 1M, but CPU only is responsible for reading, no matter whether accurate the data of reading are, well-known, the flash device all is subjected to the puzzlement of position exchange phenomenon, in case data are made mistakes like this, system has just collapsed.Vehicle-mounted computer system particularly, this equipment is different from other digital products, and maintenance is inconvenient.Think the stability that guarantees vehicle-mounted computer system, we have proposed the multiple boot structure of system, and how to store and back up this invention.
Summary of the invention
The method that the purpose of this invention is to provide a kind of constructing system multiple boot storage organization and backup, this automatic repair ability of method energy realization system, the stability of assurance system is specially adapted to vehicle-mounted computer system.
The present invention realizes by the following technical solutions: the method for a kind of constructing system multiple boot storage organization and backup, it is characterized in that: system is divided into: one-level boot, secondary boot and system program, described one-level boot is directly called after by system start-up, adopts the storage mode of individual layer to be stored in the starting position of first piece of NANDFlash; Described secondary boot comprises secondary guiding master routine and secondary guiding copy program, and described system program comprises system's master routine and system's copy program; When the upper level boot found that the next stage program is made mistakes, boot was called copy data, repaired master routine.
The present invention utilizes boot by setting up the copy program, when system's master routine is made mistakes, calls the copy program and repairs, and can effectively guarantee the stability of system, is skillfully constructed, and has use value preferably.
Description of drawings
Fig. 1 is a system architecture synoptic diagram of the present invention.
Embodiment
The present invention will be further described below in conjunction with drawings and Examples.
As shown in Figure 1, the invention provides the method for a kind of constructing system multiple boot storage organization and backup, it is characterized in that: system is divided into: one-level boot, secondary boot and system program, described one-level boot is directly called after by system start-up, (annotate: the storage unit of MLCnandflash is divided into two-layer the storage mode of employing individual layer, equal MLCNAND is stored in as SLCNAND (SingleLevelCell is the single-layer type storage, and the stability of SLCNAND is higher than MLCNAND) starting position of first piece of NANDFlash like this; Described secondary boot comprises secondary guiding master routine and secondary guiding copy program, and described system program comprises system's master routine and system's copy program; When the upper level boot found that the next stage program is made mistakes, boot was called copy data, repaired master routine.
In preferred embodiment of the present invention, described one-level boot size is no more than 4KB, and like this, the program that CPU only need read less than 4KB just can start, and greatly reduces risk.
Copy program of the present invention can be entered with master routine burning together in production programming program process, mark a zone specially and be used to store described secondary guiding copy program and system's copy program in NANDFlash, this zone is not influenced by later stage robot system upgrading.So, the data stability in this copy zone just obtains guaranteeing.
What deserves to be mentioned is that in present embodiment, when the upper level boot found that the next stage program is made mistakes, at first the Page that makes mistakes by ECC verification locking read corresponding Page then and duplicates over from the copy program.
The present invention is specially adapted to vehicle-mounted computer system.The above only is preferred embodiment of the present invention, and all equalizations of being done according to the present patent application claim change and modify, and all should belong to covering scope of the present invention.