CN102169445B - Security upgrading method for BootRom - Google Patents
Security upgrading method for BootRom Download PDFInfo
- Publication number
- CN102169445B CN102169445B CN2011101232407A CN201110123240A CN102169445B CN 102169445 B CN102169445 B CN 102169445B CN 2011101232407 A CN2011101232407 A CN 2011101232407A CN 201110123240 A CN201110123240 A CN 201110123240A CN 102169445 B CN102169445 B CN 102169445B
- Authority
- CN
- China
- Prior art keywords
- address table
- mirror image
- bootrom
- upgrade
- standby
- 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
Links
Images
Abstract
The invention discloses a security upgrading method for a BootRom. The method comprises the following steps of: starting a system, downloading a high-version BootRom mirror image and storing the BootRom mirror image into a memory; verifying the correctness of the downloaded mirror image; analyzing a primary address table to obtain standby area addresses; storing the mirror image and judging whether the mirror image is stored successfully or not; and updating the primary address table and a standby address table in turn. By the security upgrading method for the BootRom, the problem of a situation that Flash is back to a factory to be reprogrammed by using equipment because of an upgrading failure of the BootRom, so that the security upgrading method has the advantages that the system can be started normally, the data damaged by the upgrading failure can be modified and the like even if the upgrading fails.
Description
Technical field
The present invention relates to the security upgrading method of a kind of BootRom (Boot Read-Only-Memory, system start ROM (read-only memory)), especially a kind of upgrade security upgrading method of failed BootRom of communication facilities BootRom of avoiding.
Background technology
In communication facilities, the startup mirror image that equipment one powers on and will carry out in BootRom, then come application programs to be unpacked, decompress, guide the operations such as execution by this startup mirror image.Wherein, this application program has comprised operating system program, BSP program and other application layer programs etc.When the packet format of application program, compression algorithm etc. change, just need to be upgraded to BootRom.
Usually, upgrading for BootRom has three kinds of modes: in (1) BootRom operational process, upgrade self, this upgrading mode is simple and convenient, cost is lower, if but cut off the power supply in escalation process, the mishap such as device reset, may cause system to start, can not again upgrade; Equipment need to be returned to manufacturer, change chip or sintering again, thereby affect normal operation and the use of equipment; (2) open device housings, from board, the Flash chip soldering is got off, by special-purpose Flash fever writes, ROMPaq is write, and then be soldered on board; (3) utilize the jtag interface that CPU provides to be programmed to Flash.Described latter two method all needs special-purpose hardware supported, and technician's technical merit is had relatively high expectations, need to train accordingly the technician, all need very high cost from hardware and human resources, this can cause the raising of device upgrade cost undoubtedly.
In prior art, for addressing these problems, usually BootRom is compiled as to two different mirror images, usually is referred to as root segment and expanding section (as shown in Figure 7).Root segment and expanding section are carried out respectively different functions.The function of root segment is very simple, and Main Function is the upgrading realized expanding section.Expanding section is realized system initialization, the greater functionality such as application program updating.Root segment and expanding section are stored in the different spaces of Flash.The mirror image of scalable expanding section in root segment, if upgrade unsuccessfully, can be upgraded to expanding section again.When the upgrading root segment, in the time of in root segment is write to Flash, if the accidents such as generation is cut off the power supply suddenly, device reset can cause root segment to be upgraded unsuccessfully.Now, imperfect due to root segment, will cause equipment to start, and have only equipment is brought back to producer, again burned BootRom mirror image.And, the expanding section of upgrading in root segment, root segment will comprise some communications protocol, this has just increased the complicacy that root segment realizes.
Summary of the invention
The present invention is the weak point existed in above-mentioned prior art for avoiding, and the security upgrading method of a kind of BootRom is provided, and causes upgrading unsuccessfully, can not start the problem of system with solution burst accident in upgrading BootRom process.
The invention provides the security upgrading method of a kind of BootRom.
The security upgrading method of a kind of BootRom comprises the following steps:
A. system starts, and the BootRom image download of highest version is got off, and is saved in internal memory; B. the mirror image downloaded is carried out to the correctness verification; If the mirror image of downloading is incorrect, upgrade unsuccessfully; If the mirror image of downloading is correct, continue next step; C. resolve the primary address table, obtain the address, spare area; D. preserve mirror image, and judge whether successful mirror image is preserved; If it is unsuccessful that mirror image is preserved, upgrade unsuccessfully; If mirror image is preserved successfully, continuing next step; E. the effective identifier of primary address table be set to invalid; Upgrade the primary address table, be about to main area address and the exchange of address, spare area in the primary address table; Then, the effective identifier of primary address table is set for effective; F. the effective identifier of standby address table be set to invalid; Upgrade the standby address table, be about to main area address and the exchange of address, spare area in the standby address table; Then, the effective identifier of standby address table is set for effective; G. upgrade successfully.
Compared with the prior art, beneficial effect of the present invention is embodied in:
The security upgrading method of BootRom of the present invention, in the process of upgrading, leave the BootRom of operation in main area in, and the BootRom of the highest version downloaded leaves in spare area.If upgrade successfully, then the main area address in address table and address, spare area are exchanged.So, when system powers on again, new BootRom mirror image will be used.The mode mutually backed up by primary address table and standby address table, the accidents such as unexpected power down, device reset while preventing the scheduler table.Determine the main area address with address table, what can guarantee after upgrading successfully to carry out is up-to-date BootRom mirror image, upgrades unsuccessful, still carries out original BootRom mirror image, can normally start system.Determine the main area address by address table, the main area address can change like this, in the time of can be in the BootRom mirror image is write to Flash, thereby avoids bad piece of Flash or bad block.The mirror image of downloading first is kept at spare area, the original BootRom mirror image of the unsuccessful destruction that prevents from upgrading.The security upgrading method of BootRom of the present invention, not there will be because BootRom upgrades and unsuccessfully will return factory's use equipment situation of Burning flash again, unsuccessfully also can normally start system even upgrade, and can repair the data of damaging because of the failure of upgrading, effectively reduce human cost and handling cost, improved the synthesized competitiveness of product.
The accompanying drawing explanation
The distribution schematic diagram in space in the Flash of the security upgrading method that Fig. 1 is BootRom of the present invention.
The structural representation of the address table of the security upgrading method that Fig. 2 is BootRom of the present invention.
The upgrading process flow diagram of the security upgrading method that Fig. 3 is BootRom of the present invention.
The BootRom of the security upgrading method that Fig. 4 is BootRom of the present invention starts process flow diagram.
Address table before the upgrading of the security upgrading method that Fig. 5 is BootRom of the present invention.
Address table after the upgrading successfully of the security upgrading method that Fig. 6 is BootRom of the present invention.
The distribution schematic diagram that Fig. 7 is space in Flash of the prior art.
Below pass through embodiment, and the invention will be further described by reference to the accompanying drawings.
Embodiment
Referring to Fig. 1~Fig. 6, the security upgrading method of a kind of BootRom comprises the following steps:
A. system starts, and the BootRom image download of highest version is got off, and is saved in S301 in internal memory;
B. the mirror image downloaded is carried out to correctness verification S302; If the mirror image of downloading is incorrect, upgrade unsuccessfully; If the mirror image of downloading is correct, continue next step;
C. resolve the primary address table, obtain address, spare area S303;
D. preserve mirror image S304, and judge that whether mirror image preserve successful S305; If it is unsuccessful that mirror image is preserved, upgrade unsuccessfully; If mirror image is preserved successfully, continuing next step; Mirror image in spare area is read, with image ratio in internal memory, if the two is consistent, illustrates and preserve successfully, continue execution step e.If the two is inconsistent, explanation is preserved unsuccessfully, can again preserve.If, while repeatedly preserving all failures, will preserve address and add constant offset, then continue to preserve.If now preserve successfully, continue execution step e.If also failure, this is upgraded unsuccessfully.If cut off the power supply in the implementation of step a~steps d, the fortuitous event such as device reset, now primary address table and standby address table do not change, when system is restarted, will carry out the BootRom in original MIRROR SITE, also just can not occur to upgrade unsuccessfully, can not guide and the situation of upgrade-system.
E. the effective identifier of primary address table is set to invalid S306; Upgrade the primary address table, be about to main area address and address, spare area exchange S307 in the primary address table; Then, the effective identifier of primary address table being set is effective S308; The process that step e guarantees to upgrade the primary address table is an atomic operation; In this process, if cut off the power supply, the accident such as device reset, effective sign of primary address table is invalid, illustrates that this upgrades unsuccessfully.When system re-powers, the fixed mirror picture of execution can be come the content of standby address table copy, upgrades the primary address table, to repair the primary address table.
F. the effective identifier of standby address table is set to invalid S309; Upgrade the standby address table, be about to main area address and address, spare area exchange S310 in the standby address table; Then, the effective identifier of standby address table being set is effective S311; The process that step f guarantees to upgrade the standby address table is an atomic operation, and in this process, if cut off the power supply, the accident such as device reset, effective sign of standby address table is invalid, illustrates that this upgrades unsuccessfully.When system re-powers, the fixed mirror picture of execution can be come the content of primary address table copy, upgrades the standby address table, to repair the standby address table.
G. upgrade successfully.
Security upgrading method of the present invention, the mode mutually backed up by primary address table and standby address table, the phenomenon that while preventing the scheduler table, the accidents such as unexpected power down, device reset cause system to start.After upgrading successfully, the main area address in address table and address, spare area exchange, and this sampling device again powers on and will use the BootRom mirror image that upgrading obtains recently.The mirror image of downloading first is kept at spare area, and the unsuccessful original BootRom mirror image that destroyed that prevents from upgrading has solved and destroyed original BootRom mirror image, can't start the problem of system because of the failure of upgrading.
While dispatching from the factory, by fixed area mirror image, primary address table, standby address table, the burned Flash of BootRom mirror image difference.Burned when the fixed area mirror image dispatches from the factory, do not allow to change.The BootRom mirror image is in burned main area.After burned, the allocation of space of Flash as shown in Figure 1.As shown in Figure 2, primary address table and standby address table include the effective identifier of address table, main area address and address, spare area.Now the content of primary address table and standby address table is effective and on all four.
When device powers on, at first carry out the fixed area mirror image.In the fixed area mirror image, synchronous primary address table and standby address table, then obtain the main area address from the primary address table, carry out and be kept at the BootRom mirror image in main area.
During upgrading, BootRom is kept at the upgrade image downloaded in spare area according to the address, spare area in address table.If upgrade successfully, the scheduler table, exchange main area address and address, spare area, after the operation fixed area mirror image that powers on next time like this, by the BootRom mirror image of carrying out after upgrading; If upgrade unsuccessfully, address table can not change, and powers on next time after operation fixed area mirror image, will carry out original Bootrom mirror image.
The standby address table is the backup of primary address table, and both contents are on all four under normal circumstances.While only having upgrading BootRom, after preserving the BootRom mirror image of downloading, power down suddenly in the process of renewal primary address table or standby address table, this will cause upgrading unsuccessfully, and the content of two tables just can be different in such cases.When powering on execution fixed area mirror image, can carry out synchronously these two address tables.The mirror image of current operation can not upgraded to self; Primary address table and standby address table can be simultaneously not invalid.The BootRom mirror image leaves in main area, and the mirror image downloaded during upgrading is kept in spare area.
When device powers on, at first carry out the fixed area mirror image.Realizing of fixed area mirror image is fairly simple, mainly contains following two functions: (1) synchronous primary address table and standby address table are consistent the two; (2) obtain the main area address, jump to this address, carry out the BootRom mirror image.
As shown in Figure 4, after system powers on, start the startup system, the startup flow process of system comprises the steps:
S401: read the effective identifier of primary address table;
S402: judge that whether the primary address table is effective, effectively perform step S403, the invalid S407 that performs step;
S403: read the effective identifier of standby address table;
S404: judge that whether the standby address table is effective, effectively carry out S409; The invalid S405 that carries out;
S405: the data except the address table identifier in the primary address table are copied in the standby address table;
S406: put the effective identifier of standby address table for effectively, then perform step S409;
S407: the data except the address table identifier in the standby address table are copied in the primary address table;
S408: put the effective identifier of primary address table for effectively, perform step S409;
S409: resolve the primary address table, obtain the main area address, the entry address of Here it is BootRom mirror image.
S410: jump to this place, entry address, carry out the BootRom mirror image in main area.Then, system starts flow process and finishes, and carries out corresponding application system or operating system.
When device powers on, first carry out and start flow process, synchronous primary address table and standby address table, keep the consistent of two address tables, reboots the BootRom mirror image.In the BootRom mirror image, download the BootRom mirror image of redaction, carry out as the upgrading flow process in Fig. 3, upgraded.
The security upgrading method of BootRom of the present invention, the mode that is fixed area, primary address table, standby address table, main area and spare area by the spatial division of flash, primary address table and standby address table can back up mutually, make the BootRom of communication facilities can realize safety, reliable, convenient and upgrading cheaply, solved the problem that in upgrading BootRom process burst accident causes upgrading unsuccessfully, can not start system.
Claims (1)
1. the security upgrading method of a BootRom, is characterized in that, comprises the following steps:
A. system starts, and at first carries out the fixed area mirror image, and in the fixed area mirror image, synchronous primary address table and standby address table, guarantee that the primary address table is consistent with the standby address table; Resolve the primary address table, obtain the entry address of BootRom mirror image, carry out BootRom; The BootRom image download of highest version is got off, be saved in (S301) in internal memory;
B. the mirror image downloaded is carried out to correctness verification (S302); If the mirror image of downloading is incorrect, upgrade unsuccessfully; If the mirror image of downloading is correct, continue next step;
C. resolve the primary address table, obtain address, spare area (S303);
D. upgrade image is kept in spare area, then this mirror image in spare area is read, with image ratio in internal memory, if the two is consistent, illustrates and preserve successfully; If it is unsuccessful that mirror image is preserved, upgrade unsuccessfully; If mirror image is preserved successfully, continue next step;
E. the effective identifier of primary address table is set to invalid (S306); Upgrade the primary address table, be about to main area address and address, spare area exchange (S307) in the primary address table; Then, the effective identifier of primary address table is set for effective (S308);
F. the effective identifier of standby address table is set to invalid (S309); Upgrade the standby address table, be about to main area address and address, spare area exchange (S310) in the standby address table; Then, the effective identifier of standby address table is set for effective (S311);
G. upgrade successfully.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011101232407A CN102169445B (en) | 2011-05-13 | 2011-05-13 | Security upgrading method for BootRom |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011101232407A CN102169445B (en) | 2011-05-13 | 2011-05-13 | Security upgrading method for BootRom |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102169445A CN102169445A (en) | 2011-08-31 |
CN102169445B true CN102169445B (en) | 2013-12-04 |
Family
ID=44490611
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011101232407A Active CN102169445B (en) | 2011-05-13 | 2011-05-13 | Security upgrading method for BootRom |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102169445B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105119952B (en) * | 2015-07-07 | 2018-12-21 | 北京京东尚科信息技术有限公司 | The method and system of resource is distributed to automatic elastic under cloud platform |
CN106933606A (en) * | 2015-12-29 | 2017-07-07 | 普天信息技术有限公司 | The update method and device of VxWorks system image image files |
CN106598654B (en) * | 2016-11-30 | 2020-09-04 | 中国兵器装备集团自动化研究所 | Method for updating PowerPC mainboard boot chip on line |
CN109254799B (en) * | 2018-08-29 | 2023-03-10 | 新华三技术有限公司 | Boot program starting method and device and communication equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1437113A (en) * | 2002-02-08 | 2003-08-20 | 华为技术有限公司 | Guide memory and its construction method and usage |
CN101464804A (en) * | 2008-12-29 | 2009-06-24 | 杭州迪普科技有限公司 | Double-boot backup method and security equipment |
CN101826027A (en) * | 2010-05-28 | 2010-09-08 | 深圳市融创天下科技发展有限公司 | Embedded system and updating method thereof |
CN102023908A (en) * | 2010-12-03 | 2011-04-20 | 中兴通讯股份有限公司 | Method and device for backing up boot program |
CN102033790A (en) * | 2010-12-15 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for upgrading embedded-type system BOOTROM |
-
2011
- 2011-05-13 CN CN2011101232407A patent/CN102169445B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1437113A (en) * | 2002-02-08 | 2003-08-20 | 华为技术有限公司 | Guide memory and its construction method and usage |
CN101464804A (en) * | 2008-12-29 | 2009-06-24 | 杭州迪普科技有限公司 | Double-boot backup method and security equipment |
CN101826027A (en) * | 2010-05-28 | 2010-09-08 | 深圳市融创天下科技发展有限公司 | Embedded system and updating method thereof |
CN102023908A (en) * | 2010-12-03 | 2011-04-20 | 中兴通讯股份有限公司 | Method and device for backing up boot program |
CN102033790A (en) * | 2010-12-15 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for upgrading embedded-type system BOOTROM |
Also Published As
Publication number | Publication date |
---|---|
CN102169445A (en) | 2011-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI386847B (en) | Method of safe and recoverable firmware update and device using the same | |
CN107179909A (en) | Method for upgrading software, device and computer-readable recording medium | |
US8539471B2 (en) | Updating firmware of an electronic device | |
CN102693139B (en) | A kind of method and system of radio upgrade cell phone software | |
CN109062598B (en) | Safe OTA (over the air) upgrading method and system | |
CN108027741A (en) | Document handling method, device, terminal and storage medium based on patch upgrading | |
US8136108B2 (en) | Updating firmware with multiple processors | |
CN104133709B (en) | The upgrade method and device of embedded system | |
US20090222650A1 (en) | Communication device and firmware update method thereof | |
US20120117557A1 (en) | Method and system for upgrading wireless data card | |
CN102073517A (en) | Upgrading and backup method and device for embedded system | |
CN102169445B (en) | Security upgrading method for BootRom | |
CN102646043A (en) | Method and device for upgrading mobile terminal software and mobile terminal | |
CN103688268A (en) | Vehicle unit and method for operating the vehicle unit | |
CN112947977B (en) | Online software upgrading method and system | |
CN102004657B (en) | A kind of electronic equipment and upgrade method thereof | |
WO2011088701A1 (en) | Method and device for online upgrading cross-platform version | |
CN109753299A (en) | A kind of method for upgrading system, device and computer storage medium | |
CN108170457A (en) | Firmware upgrade method, device and VR head-mounted displays | |
CN114281394A (en) | Method, system, equipment and medium for fast on-line upgrading program | |
CN112152846B (en) | Metering instrument remote upgrading method based on Internet of things | |
JP5533935B2 (en) | Software distribution system and software distribution method | |
CN115454469A (en) | Mirror image updating method and device, chip, electronic equipment and storage medium | |
CN102541585A (en) | Remote upgrade method and embedded system | |
JP6073710B2 (en) | Information processing apparatus, automatic recovery method from startup failure, and automatic recovery program from startup failure |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210722 Address after: 230000 room 2153, D8 floor, Hefei Innovation Industrial Park, 800 Wangjiang West Road, high tech Zone, Hefei, Anhui Province Patentee after: Anhui tengling Technology Co., Ltd Address before: 230001 Room 405, building A1, animation and service outsourcing industry base, high tech Zone, Hefei, Anhui Province Patentee before: Hefei Huayun Communication Technology Co.,Ltd. |
|
TR01 | Transfer of patent right |