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
Priority to PCT/CN2020/114999 priority patent/WO2021103745A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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 OR 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 OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

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

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

* Cited by examiner, † Cited by third party
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 南京苏美达智能技术有限公司 Machine program system with upgrading function, upgrading method and application
CN115357908A (en) * 2022-10-19 2022-11-18 中国人民解放军军事科学院***工程研究院 Network equipment kernel credibility measurement and automatic restoration method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945176A (en) * 2012-11-09 2013-02-27 青岛海信移动通信技术股份有限公司 Terminal equipment booting and updating method and 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)

* 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
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945176A (en) * 2012-11-09 2013-02-27 青岛海信移动通信技术股份有限公司 Terminal equipment booting and updating method and 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)

* 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
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 南京苏美达智能技术有限公司 Machine program system with upgrading function, upgrading method and application
CN115357908A (en) * 2022-10-19 2022-11-18 中国人民解放军军事科学院***工程研究院 Network equipment kernel credibility measurement and automatic restoration 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
CN111104173A (en) Protection design method of bootstrap program
CN103299276B (en) The software upgrading process of embedded equipment
CN109032632B (en) FOTA upgrading method, wireless communication terminal and storage medium
CN104572206A (en) Application program self updating and backup recovery method
CN102722394A (en) Start upgrading method of embedded equipment
CN109324927A (en) A kind of virtual machine backup method and system based on distributed memory system
CN103455354A (en) Method and equipment for preventing hardware update from failing
CN102508686A (en) Method and system for realizing safe upgrading of system
CN104834547A (en) Remote upgrade method and system of Squashfs read-only root file system
CN104915226A (en) Network device software starting method, device and network device
CN101639785A (en) Method and device for software updating
CN110231949A (en) System upgrading method and device, electronic equipment and storage medium
CN112783537A (en) Embedded linux operating system upgrading method and system based on MTD storage equipment
CN107608705A (en) A kind of wireless WIFI video equipments and its firmware upgrade method
CN102541595A (en) Method and device for upgrading intelligent device and intelligent device
CN104077167A (en) Boot loading method and device based on NAND FLASH
CN104331318A (en) Embedded type dual system and working method thereof
CN107566169A (en) A kind of firmware upgrade method and router based on openwrt
CN106775674B (en) Equipment based on universal boot loader and starting method thereof
CN106033362A (en) Method and device for processing flash memory partition
CN104063256A (en) Partition and firmware upgrading method based on minimum operating system
CN111045712A (en) Single system upgrading method and system with backup function
CN106156626B (en) Method and device for safely upgrading system
CN104951348A (en) Interruptible recovery upgrading method and device
CN106933604B (en) System upgrading 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