CN111104173A - Protection design method of bootstrap program - Google Patents

Protection design method of bootstrap program Download PDF

Info

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
boot
data
program
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
Application number
CN201911166979.9A
Other languages
Chinese (zh)
Inventor
徐李超
何晓帆
赵守福
余威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingchen Semiconductor Shenzhen Co ltd
Original Assignee
Jingchen Semiconductor Shenzhen Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Jingchen Semiconductor Shenzhen Co ltd filed Critical Jingchen Semiconductor Shenzhen Co ltd
Priority to CN201911166979.9A priority Critical patent/CN111104173A/en
Publication of CN111104173A publication Critical patent/CN111104173A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

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

Protection design method of bootstrap program
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)

1. A protection design method of a bootstrap program is characterized by comprising 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.
2. The boot program protection design method according to claim 1, comprising:
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.
CN201911166979.9A 2019-11-25 2019-11-25 Protection design method of bootstrap program Pending CN111104173A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911166979.9A CN111104173A (en) 2019-11-25 2019-11-25 Protection design method of bootstrap program

Applications Claiming Priority (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

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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021103745A1 (en) * 2019-11-25 2021-06-03 晶晨半导体(深圳)有限公司 Method for protectively desiging boot program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
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
CN106227568A (en) * 2012-11-09 2016-12-14 青岛海信移动通信技术股份有限公司 Terminal unit start, upgrade method and equipment
CN103699421B (en) * 2014-01-08 2017-07-11 深圳金三立视频科技股份有限公司 Embedded device method for upgrading system and its device
CN107967141B (en) * 2017-11-27 2021-04-13 北京小米移动软件有限公司 Operating system upgrading method and device and terminal
CN111104173A (en) * 2019-11-25 2020-05-05 晶晨半导体(深圳)有限公司 Protection design method of bootstrap program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021103745A1 (en) * 2019-11-25 2021-06-03 晶晨半导体(深圳)有限公司 Method for protectively desiging boot program

Also Published As

Publication number Publication date
WO2021103745A1 (en) 2021-06-03

Similar Documents

Publication Publication Date Title
CN103299276B (en) The software upgrading process of embedded equipment
CN104572206A (en) Application program self updating and backup recovery method
CN102722394B (en) Start upgrading method of embedded equipment
US8423991B2 (en) Embedded network device and firmware upgrading method
CN104915226A (en) Network device software starting method, device and network device
CN101639785A (en) Method and device for software updating
CN102508686A (en) Method and system for realizing safe upgrading of system
CN102541595A (en) Method and device for upgrading intelligent device and intelligent device
CN106033362A (en) Method and device for processing flash memory partition
CN111104173A (en) Protection design method of bootstrap program
CN107608705A (en) A kind of wireless WIFI video equipments and its firmware upgrade method
CN108874582A (en) A kind of system recovery method, device and terminal
CN104063256A (en) Partition and firmware upgrading method based on minimum operating system
CN104331318A (en) Embedded type dual system and working method thereof
CN104834547A (en) Remote upgrade method and system of Squashfs read-only root file system
CN109324927A (en) A kind of virtual machine backup method and system based on distributed memory system
CN106775674B (en) Equipment based on universal boot loader and starting method thereof
US8032788B2 (en) System and method for managing the restarting of automatic control equipment
CN104951348A (en) Interruptible recovery upgrading method and device
CN106156626B (en) Method and device for safely upgrading system
CN101872306B (en) Embedded system for realizing software updating and software backup and implementation method thereof
CN106933604B (en) System upgrading method and device
CN104750617A (en) Electronic device and data-management method thereof
CN111651174A (en) Method and system for remotely upgrading MCU (microprogrammed control Unit) program
CN105825126A (en) File protecting method and device

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