CN111104173A - Protection design method of bootstrap program - Google Patents
Protection design method of bootstrap program Download PDFInfo
- Publication number
- CN111104173A CN111104173A CN201911166979.9A CN201911166979A CN111104173A CN 111104173 A CN111104173 A CN 111104173A CN 201911166979 A CN201911166979 A CN 201911166979A CN 111104173 A CN111104173 A CN 111104173A
- Authority
- CN
- China
- Prior art keywords
- partition
- bootloader
- boot
- data
- boot0
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1433—Saving, restoring, recovering or retrying at system level during software upgrading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a protection design method of a bootstrap program, which comprises the following steps: a Boot program is stored in a Bootloader partition of a logical partition of a storage device, Boot programs similar to the Boot program in the Bootloader partition are also stored in a Boot0 and a Boot1 of an inherent partition of the storage device, and the backup Boot sequence of the Boot programs in the partitions is set as follows: first Bootloader, second Boot0, and finally Boot 1. By the bootstrap program protection design method provided by the invention, the problem that the bootstrap program is empty or the bootstrap program in the Bootloader partition is damaged to cause the system to be incapable of being started due to the power failure phenomenon of the intelligent terminal equipment in the upgrading process can be effectively prevented.
Description
Technical Field
The invention relates to the application field of embedded systems, in particular to a protection design method of a bootstrap program.
Background
According to the existing software system of the intelligent terminal equipment, along with the frequent upgrading requirement of the service cycle, the upgrading software can effectively solve various problems of the software of the intelligent terminal equipment after a production merchant leaves a factory, wherein the problem comprises bug of a bootstrap program part, and machine upgrading of a terminal user is required to be carried out by using Ethernet; on the other hand, in order to improve the market competitiveness of the product, a manufacturer can push out new software products at intervals, wherein part of functions may need to modify the bootstrap program, and corresponding upgrading is needed at this time.
In the process of upgrading the intelligent terminal device, in order to ensure the integrity of the upgrade, a method is generally adopted in the industry, namely, a Bootloader partition (a partition for storing a bootstrap program) is erased first, and then other partitions, such as a Boot partition (a kernel partition), a System partition (a file System partition), and a Data partition (a user Data partition), are upgraded, and after the other partitions are upgraded, the bootstrap program of the Bootloader partition is upgraded. This has the advantage that the integrity of the upgrade can be ensured, but if the upgrade process is powered down, the system cannot boot. However, for the end user, if the power is lost in the upgrade process, the boot program in the Bootloader partition is empty or damaged, so that the smart device cannot respond and fails, and if Recovery is to be performed, the operation is very troublesome.
Disclosure of Invention
In order to solve the problems, the invention provides a protection design method of a bootstrap program, which can effectively prevent the problem that the bootstrap program is empty or the bootstrap program in a Bootloader partition is damaged to cause the system to be unable to be started due to the power failure phenomenon of intelligent terminal equipment in the upgrading process.
The invention is realized by the following technical scheme:
the invention provides a protection design method of a bootstrap program, which comprises the following steps:
a Boot program is stored in a Bootloader partition of a logical partition of a storage device, Boot programs similar to the Boot program in the Bootloader partition are also stored in a Boot0 and a Boot1 of an inherent partition of the storage device, and the backup Boot sequence of the Boot programs in the partitions is set as follows: first Boot loader, second Boot0, and last Boot 1;
when the data of the Bootloader partition is started, the integrity of the data is detected firstly, and if the data is complete, a bootstrap program is loaded from the Bootloader partition; if not, Boot0 partition data in the backup scheme is started quickly;
when the data of the Boot0 partition is started, the integrity of the data is detected, if the data is complete, a bootstrap program is loaded from the Boot0 partition, and if the data is incomplete, the Boot1 partition data in the backup scheme is started quickly;
when data of Boot1 partition is started, the integrity of the data is firstly detected, and if the data is complete, a Boot program is loaded from the Boot1 partition.
Further, the method comprises the following steps:
in the process of online upgrading, before upgrading the Boot partition, the System partition and the Data partition, the Boot partition is not erased;
after the Boot partition, the System partition and the Data partition are upgraded, the Boot partition is firstly erased, then the latest bootstrap program is upgraded for the Boot loader, then the Boot0 partition is erased, then the latest backup bootstrap program is upgraded for the Boot0, finally the Boot1 partition is erased, and then the latest backup bootstrap program is upgraded for the Boot 1.
The invention has the beneficial effects that:
by the bootstrap program protection design method provided by the invention, the problem that the bootstrap program is empty or the bootstrap program in the Bootloader partition is damaged due to the power failure phenomenon in the upgrading process of the intelligent terminal equipment can be effectively prevented, and the system can still be normally started from the Boot0 or Boot1 partition when the bootstrap program in the Bootloader partition makes mistakes or the partition is empty; if the power failure phenomenon occurs in the upgrading process, the data of the boot program is arranged in at least one partition, so that the system cannot respond to the boot program, and the problem that the boot program cannot be started is solved.
Drawings
Fig. 1 is a flowchart illustrating a boot program protection design method according to the present invention.
Detailed Description
In order to more clearly and completely explain the technical scheme of the invention, the invention is further explained with reference to the attached drawings.
Referring to fig. 1, the present invention provides a design method for protecting a bootstrap program, including:
a Boot program is stored in a Bootloader partition of a logical partition of a storage device, Boot programs similar to the Boot program in the Bootloader partition are also stored in a Boot0 and a Boot1 of an inherent partition of the storage device, and the backup Boot sequence of the Boot programs in the partitions is set as follows: first Boot loader, second Boot0, and last Boot 1;
when the data of the Bootloader partition is started, the integrity of the data is detected firstly, and if the data is complete, a bootstrap program is loaded from the Bootloader partition; if not, Boot0 partition data in the backup scheme is started quickly;
when the data of the Boot0 partition is started, the integrity of the data is detected, if the data is complete, a bootstrap program is loaded from the Boot0 partition, and if the data is incomplete, the Boot1 partition data in the backup scheme is started quickly;
when data of Boot1 partitions are started, integrity of the data is detected, and if the data are complete, a Boot program is loaded from the Boot1 partitions; if not, it indicates a failed start.
In this embodiment, once the boot program is damaged, the system cannot be started, so the present invention introduces the storage backup mechanism of the boot program as described above. The emmc (embedded Multi Media card) can be divided into two partitions according to its physical characteristics: the method comprises the steps of logical partitioning and inherent partitioning, wherein the inherent partitioning comprises Boot0 and Boot1, the size of each partition is about 2M or 4M, and users do not generally operate the inherent partitioning; the capacity of the logical partition is relatively large, and generally all system data is stored in the logical partition: including bootstrap Data, Boot Data, System Data, Data, and so forth. In consideration of the security of the intrinsic partition, when the eMMC burner burns a program, a Boot program is stored in the Bootloader partition of the logical partition of the storage device, the same Boot program as the Boot program in the Bootloader partition is also stored in the intrinsic partition Boot0 and Boot1 of the storage device, and the backup Boot sequence of the Boot program in the partition is set as follows: first Bootloader, second Boot0, and finally Boot 1.
Further, the method comprises the following steps: in the process of online upgrading, before upgrading the Boot partition, the System partition and the Data partition, the Boot partition is not erased;
after the Boot partition, the System partition and the Data partition are upgraded, the Boot partition is firstly erased, then the latest bootstrap program is upgraded for the Boot loader, then the Boot0 partition is erased, then the latest backup bootstrap program is upgraded for the Boot0, finally the Boot1 partition is erased, and then the latest backup bootstrap program is upgraded for the Boot 1.
In this embodiment, compared with the existing method adopted in the industry, the method includes that a Bootloader partition (a partition storing a Boot program) is erased first, and then other partitions, such as a Boot partition (a kernel partition), a System partition (a file System partition), and a Data partition (a user Data partition), are upgraded, and then the Boot program of the Bootloader partition is upgraded after the other partitions are upgraded. Therefore, in order to avoid the problems, before upgrading the Boot partition, the System partition and the Data partition, the Boot partition is not erased; after the Boot partition, the System partition and the Data partition are upgraded, the Boot partition is firstly erased, then the latest Boot program is upgraded for the Boot loader, then the Boot0 partition is erased, then the latest backup Boot program is upgraded for the Boot0, and finally the Boot1 partition is erased, and then the latest backup Boot program is upgraded for the Boot 1.
By the bootstrap program protection design method provided by the invention, the problem that the bootstrap program is empty or the bootstrap program in the Bootloader partition is damaged due to the power failure phenomenon in the upgrading process of the intelligent terminal equipment can be effectively prevented, and the system can still be normally started from the Boot0 or Boot1 partition when the bootstrap program in the Bootloader partition makes mistakes or the partition is empty; if the power failure phenomenon occurs in the upgrading process, the data of the boot program is arranged in at least one partition, so that the system cannot respond to the boot program, and the problem that the boot program cannot be started is solved.
Of course, the present invention may have other embodiments, and based on the embodiments, those skilled in the art can obtain other embodiments without any creative effort, and all of them are within the protection scope of the present invention.
Claims (2)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911166979.9A CN111104173A (en) | 2019-11-25 | 2019-11-25 | Protection design method of bootstrap program |
| PCT/CN2020/114999 WO2021103745A1 (en) | 2019-11-25 | 2020-09-14 | Method for protectively desiging boot program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911166979.9A CN111104173A (en) | 2019-11-25 | 2019-11-25 | Protection design method of bootstrap program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111104173A true CN111104173A (en) | 2020-05-05 |
Family
ID=70421255
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911166979.9A Pending CN111104173A (en) | 2019-11-25 | 2019-11-25 | Protection design method of bootstrap program |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111104173A (en) |
| WO (1) | WO2021103745A1 (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112631625A (en) * | 2020-11-20 | 2021-04-09 | 展讯通信(上海)有限公司 | System upgrading method and device of embedded equipment and embedded equipment |
| WO2021103745A1 (en) * | 2019-11-25 | 2021-06-03 | 晶晨半导体(深圳)有限公司 | Method for protectively desiging boot program |
| CN113741944A (en) * | 2021-08-16 | 2021-12-03 | 南京苏美达智能技术有限公司 | A machine program system with an upgrade function and an upgrade method and application |
| CN115357908A (en) * | 2022-10-19 | 2022-11-18 | 中国人民解放军军事科学院系统工程研究院 | A network device kernel trust measurement and automatic repair method |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102945176A (en) * | 2012-11-09 | 2013-02-27 | 青岛海信移动通信技术股份有限公司 | Method and device for starting and upgrading terminal equipment |
| CN103699421A (en) * | 2014-01-08 | 2014-04-02 | 金三立视频科技(深圳)有限公司 | Method and device for upgrading embedded device system |
| CN110210210A (en) * | 2019-05-27 | 2019-09-06 | 北京中电华大电子设计有限责任公司 | A kind of the logical security design method and physical security design structure of terminal device |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102169442B (en) * | 2011-03-24 | 2014-09-10 | 杭州华三通信技术有限公司 | Method, equipment, device and system for performing system boot by using USB (universal serial bus) device |
| CN107967141B (en) * | 2017-11-27 | 2021-04-13 | 北京小米移动软件有限公司 | Operating system upgrade method, device and terminal |
| CN111104173A (en) * | 2019-11-25 | 2020-05-05 | 晶晨半导体(深圳)有限公司 | Protection design method of bootstrap program |
-
2019
- 2019-11-25 CN CN201911166979.9A patent/CN111104173A/en active Pending
-
2020
- 2020-09-14 WO PCT/CN2020/114999 patent/WO2021103745A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102945176A (en) * | 2012-11-09 | 2013-02-27 | 青岛海信移动通信技术股份有限公司 | Method and device for starting and upgrading terminal equipment |
| CN103699421A (en) * | 2014-01-08 | 2014-04-02 | 金三立视频科技(深圳)有限公司 | Method and device for upgrading embedded device system |
| CN110210210A (en) * | 2019-05-27 | 2019-09-06 | 北京中电华大电子设计有限责任公司 | A kind of the logical security design method and physical security design structure of terminal device |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021103745A1 (en) * | 2019-11-25 | 2021-06-03 | 晶晨半导体(深圳)有限公司 | Method for protectively desiging boot program |
| CN112631625A (en) * | 2020-11-20 | 2021-04-09 | 展讯通信(上海)有限公司 | System upgrading method and device of embedded equipment and embedded equipment |
| CN112631625B (en) * | 2020-11-20 | 2022-10-21 | 展讯通信(上海)有限公司 | System upgrading method and device for embedded equipment and embedded equipment |
| CN113741944A (en) * | 2021-08-16 | 2021-12-03 | 南京苏美达智能技术有限公司 | A machine program system with an upgrade function and an upgrade method and application |
| CN115357908A (en) * | 2022-10-19 | 2022-11-18 | 中国人民解放军军事科学院系统工程研究院 | A network device kernel trust measurement and automatic repair method |
| CN115357908B (en) * | 2022-10-19 | 2022-12-23 | 中国人民解放军军事科学院系统工程研究院 | Network equipment kernel credibility measurement and automatic restoration method |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2021103745A1 (en) | 2021-06-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103299276B (en) | Software Update Process for Embedded Devices | |
| CN111104173A (en) | Protection design method of bootstrap program | |
| US8423991B2 (en) | Embedded network device and firmware upgrading method | |
| US8601255B2 (en) | Approaches for updating bios | |
| CN104572229B (en) | The firmware upgrade method and device for upgrading firmware of embedded system | |
| CN105094927B (en) | Equipment firmware upgrading method and device | |
| CN104572206A (en) | Application program self updating and backup recovery method | |
| CN105912356A (en) | Optical module firmware program online upgrade method supporting version fallback | |
| CN104834547B (en) | A kind of remote upgrade method and system of the read-only root file systems of Squashfs | |
| CN106775610B (en) | Electronic equipment starting method and electronic equipment | |
| CN105808270A (en) | Firmware variable updating method | |
| JPWO2013103023A1 (en) | Information processing apparatus, information processing method, and computer program | |
| CN102165422A (en) | Firmware update device and method | |
| WO2020062887A1 (en) | Firmware upgrading method and system based on flash micro-controller, and flash micro-controller | |
| CN102508686A (en) | Method and system for realizing safe upgrading of system | |
| CN102722394A (en) | Start upgrading method of embedded equipment | |
| CN107566169B (en) | An openwrt-based firmware upgrade method and router | |
| CN104063256A (en) | Partition and firmware upgrading method based on minimum operating system | |
| CN106775674B (en) | Equipment based on universal boot loader and starting method thereof | |
| CN111045712A (en) | Single system upgrading method and system with backup function | |
| CN105607972A (en) | Abnormity remedying method and device | |
| CN106325911A (en) | Method and device for implementing BOOTROM upgrade | |
| CN120179321B (en) | Firmware loading method, device, electronic device and storage medium | |
| CN100476745C (en) | Method for realizing automatic fault tolerance of image file in Linux operating system boot process | |
| CN106528114A (en) | Android firmware application, android firmware and firmware upgrading method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200505 |
|
| RJ01 | Rejection of invention patent application after publication |