[go: up one dir, main page]

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
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
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 OR 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 OR 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 OR CALCULATING; 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.一种引导程序的保护设计方法,其特征在于,包括:1. a protection design method of boot program, is characterized in that, comprises: 在存储器件逻辑分区的Bootloader分区存储有一份引导程序,在存储器件的固有分区Boot0和Boot1中也分别存储与Bootloader分区中的引导程序一样的引导程序,并且设定引导程序在分区中的备份启动顺序为:首先是Bootloader,其次是Boot0,最后是Boot1;A bootloader is stored in the Bootloader partition of the logical partition of the storage device, and the same bootloader as the bootloader in the Bootloader partition is also stored in the inherent partitions Boot0 and Boot1 of the storage device, and the backup of the bootloader in the partition is set. The order is: Bootloader first, Boot0 second, and Boot1 last; 在启动Bootloader分区的数据的时候,先检测其完整性,如果完整,则引导程序从Bootloader分区中装载;如果不完整,则迅速启动备份方案中的Boot0分区数据;When starting the data of the Bootloader partition, first check its integrity, if it is complete, the bootloader will be loaded from the Bootloader partition; if it is not complete, quickly start the Boot0 partition data in the backup scheme; 在启动Boot0分区的数据的时候,先检测其完整性,如果完整,则引导程序从Boot0分区中装载,如果不完整,则迅速启动备份方案中的Boot1分区数据;When starting the data of the Boot0 partition, first check its integrity, if it is complete, the boot program will be loaded from the Boot0 partition, if it is not complete, then quickly start the Boot1 partition data in the backup scheme; 在启动在启动Boot1分区的数据的时候,先检测其完整性,如果完整,则引导程序从Boot1分区中装载。When starting the data of the Boot1 partition, check its integrity first, and if it is complete, the boot program will be loaded from the Boot1 partition. 2.根据权利要求1所述的引导程序的保护设计方法,其特征在于,包括:2. The protection design method of boot program according to claim 1, is characterized in that, comprises: 在线升级的过程中,在完成升级Boot分区、System分区、Data分区之前,先不对Bootloader分区进行擦除;During the online upgrade process, do not erase the Bootloader partition before completing the upgrade of the Boot partition, System partition, and Data partition; 待Boot分区、System分区、Data分区升级完毕后,先擦出Bootloader分区然后对Bootloader升级最新的引导程序,接着擦除Boot0分区然后对Boot0升级最新的备份引导程序,最后擦除Boot1分区然后对Boot1升级最新的备份引导程序。After the Boot partition, System partition, and Data partition are upgraded, first wipe out the Bootloader partition and then update the latest bootloader for Bootloader, then wipe the Boot0 partition and then update the latest backup bootloader for Boot0, and finally wipe the Boot1 partition and then update the Boot1 Update the latest backup bootloader.
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 南京苏美达智能技术有限公司 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)

* Cited by examiner, † Cited by third party
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)

* 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 upgrade method, 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 青岛海信移动通信技术股份有限公司 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)

* 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 南京苏美达智能技术有限公司 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