CN106775674B - Equipment based on universal boot loader and starting method thereof - Google Patents

Equipment based on universal boot loader and starting method thereof Download PDF

Info

Publication number
CN106775674B
CN106775674B CN201611085432.2A CN201611085432A CN106775674B CN 106775674 B CN106775674 B CN 106775674B CN 201611085432 A CN201611085432 A CN 201611085432A CN 106775674 B CN106775674 B CN 106775674B
Authority
CN
China
Prior art keywords
boot
boot file
file
storage area
starting
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
Application number
CN201611085432.2A
Other languages
Chinese (zh)
Other versions
CN106775674A (en
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.)
Semptian Co ltd
Original Assignee
Semptian 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 Semptian Co ltd filed Critical Semptian Co ltd
Priority to CN201611085432.2A priority Critical patent/CN106775674B/en
Publication of CN106775674A publication Critical patent/CN106775674A/en
Application granted granted Critical
Publication of CN106775674B publication Critical patent/CN106775674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/1417Boot up procedures

Abstract

The invention discloses equipment based on a universal boot loader and a starting method thereof. The starting method of the equipment based on the universal boot loader comprises the following steps: when detecting that a preset operation of starting the universal Boot loader U-Boot is performed, operating a first U-Boot file stored in a first storage area; reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete; when the second U-Boot file is complete, starting the equipment through the second U-Boot file; when the second U-Boot file is incomplete, copying the first U-Boot file to a second storage area, and replacing the second U-Boot file; and starting the equipment through the replaced second U-Boot file. By the method, the problem that the equipment cannot be started due to the failure of the U-Boot upgrade can be solved.

Description

Equipment based on universal boot loader and starting method thereof
Technical Field
The invention belongs to the field of communication, and particularly relates to equipment based on a universal boot loader and a starting method thereof.
Background
The Universal Boot Loader (U-Boot) is the most widely used Boot Loader at present, supports the Boot of most mainstream 32-bit hardware platforms and mainstream operating systems, has rich instructions and peripheral drivers, and can meet the requirements of most of such systems. Because the U-Boot contains some hardware drivers, sometimes the U-Boot drivers of the products need to be upgraded, or the U-Boot is found to have program errors BUG in the later period, and the upgrading process is needed to enhance the stability of the system.
In the prior art, a U-Boot loading method generally upgrades a backup U-Boot in single Flash. However, when the U-Boot in the device is upgraded, if the U-Boot is not upgraded, the device cannot be normally started.
Disclosure of Invention
The invention provides a device based on a universal Boot loader and a starting method thereof, which can avoid the problem that the device cannot be started due to the failure of the upgrade of a U-Boot.
In order to solve the above problem, a first aspect of the present invention provides a method for booting a device based on a generic bootstrap loader, where the method for booting the device based on the generic bootstrap loader includes:
when detecting that a preset operation of starting the universal Boot loader U-Boot is performed, operating a first U-Boot file stored in a first storage area;
reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete;
when the second U-Boot file is complete, starting the equipment through the second U-Boot file;
when the second U-Boot file is incomplete, copying the first U-Boot file to the second storage area, and replacing the second U-Boot file;
and starting the equipment through the replaced second U-Boot file.
In order to solve the above problem, the present invention provides, in a second aspect, a generic bootloader-based device, including:
the operation module is used for operating a first U-Boot file stored in a first storage area when the preset operation of starting the universal Boot loader U-Boot is detected;
the reading module is used for reading a second U-Boot file stored in a second storage area and judging whether the second U-Boot file is complete or not;
the first starting module is used for starting the equipment through the second U-Boot file when the second U-Boot file is complete;
the updating module is used for copying the first U-Boot file to the second storage area and replacing the second U-Boot file when the second U-Boot file is incomplete;
and the second starting module is used for starting the equipment through the replaced second U-Boot file.
According to the scheme, the device based on the U-Boot backs up the first U-Boot file through the first storage area, when the upgrade failure of the second U-Boot file stored in the second storage area is confirmed, the first U-Boot file is copied to the second storage area and replaces the second U-Boot file, and the device is started through the replaced second U-Boot file, so that the normal starting of the device is guaranteed. The first U-Boot file in the first storage area is not supported to be changed, so that the first U-Boot file cannot be damaged by any software operation after delivery, the safety of the first U-Boot file is ensured, the normal starting of the U-Boot is ensured, the normal starting of the equipment is further ensured, the success rate of starting the equipment is improved, and the problem that the equipment cannot be started due to the failure of upgrading of the U-Boot is avoided.
Drawings
FIG. 1 is a flowchart of an embodiment of a boot method for a generic bootloader-based device according to the present invention;
FIG. 2 is a flowchart of another embodiment of a boot method for a generic bootloader-based device according to the present invention;
FIG. 3 is a schematic structural diagram of an embodiment of a device based on a generic bootloader according to the present invention;
fig. 4 is a schematic structural diagram of another embodiment of the device based on the generic bootloader according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for booting a generic bootloader-based device according to an embodiment of the present invention. The execution subject in this example is a generic bootloader-based device, which includes: the system comprises a Central Processing Unit (CPU) and a memory for storing a Universal Boot Loader (U-Boot), wherein the CPU and the memory can be connected through a Bootbus bus. The memory can be nand Flash or nor Flash. The number of the memories for storing the U-Boot can be one or two. When one memory for storing the U-Boot is used, storing a first U-Boot file and a second U-Boot file in different storage areas of the same memory; when the number of the memories for storing the U-boots is two, the first U-Boot file and the second U-Boot file are respectively stored in two different memories.
The method for starting the device based on the universal boot loader in the embodiment comprises the following steps:
s101: and when the preset operation of starting the universal Boot loader U-Boot is detected, running a first U-Boot file stored in a first storage area.
For example, when a device based on the U-Boot detects a power-on operation or a restart operation, a first U-Boot file pre-stored in a first storage area is acquired, and the first U-Boot file stored in the first storage area is operated.
The preset operation for starting the universal Boot loader U-Boot includes, but is not limited to, a power-on operation or a restart operation, and may also be other preset operations.
When the device based on the U-Boot comprises two memories, and the first storage area and the second storage area belong to different memories, the device based on the U-Boot can select the first storage area by controlling the first chip selection signal, and select the second storage area by controlling the second chip selection signal.
When the device based on the U-Boot comprises a memory, and the first storage area and the second storage area belong to different storage address partitions of the memory respectively, the first storage area or the second storage area is selected by controlling an address selector.
S102: and reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete.
And running the code of the initial stage of the first U-Boot file by the U-Boot-based equipment, reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete.
The method for judging whether the second U-Boot file is complete may be to compare the content contained in the second U-Boot file with a pre-stored U-Boot reference file for verification to judge whether the content contained in the second U-Boot file is completely the same as the content contained in the U-Boot reference file for verification, and when it is confirmed that the two are completely the same, identify that the second U-Boot file is complete; and when only the two files are partially identical or completely different, identifying that the second U-Boot file is incomplete. And the version information of the pre-stored U-Boot reference file for verification corresponds to the version information of the second U-Boot file.
When the second U-Boot file is complete, executing step S103;
and when the second U-Boot file is not complete, executing the steps S104 to S105.
S103: and when the second U-Boot file is complete, starting the equipment through the second U-Boot file.
And when the device based on the U-Boot confirms that the second U-Boot file is complete, confirming that the upgrade of the U-Boot which is closest to the starting time is successful.
And the device based on the U-Boot only upgrades the second U-Boot file stored in the second storage area. The first storage area is used for backing up U-Boot files.
S104: and when the second U-Boot file is incomplete, copying the first U-Boot file to the second storage area, and replacing the second U-Boot file.
And when the device based on the U-Boot confirms that the second U-Boot file is incomplete, identifying that the U-Boot upgrade which is closest to the starting time of this time fails.
The device based on the U-Boot copies the first U-Boot file from the first storage area, stores the copied first U-Boot file into the second storage area, and replaces the original second U-Boot file with the copied first U-Boot file to form a new second U-Boot file.
S105: and starting the equipment through the replaced second U-Boot file.
And after the copied first U-Boot file is replaced by the original second U-Boot file, the device based on the U-Boot starts the device through the replaced second U-Boot file.
According to the scheme, the device based on the U-Boot backs up the first U-Boot file through the first storage area, when the upgrade failure of the second U-Boot file stored in the second storage area is confirmed, the first U-Boot file is copied to the second storage area and replaces the second U-Boot file, and the device is started through the replaced second U-Boot file, so that the normal starting of the device is guaranteed. The first U-Boot file in the first storage area is not supported to be changed, so that the first U-Boot file cannot be damaged by any software operation after delivery, the safety of the first U-Boot file is ensured, the normal starting of the U-Boot is ensured, the normal starting of the equipment is further ensured, the success rate of starting the equipment is improved, and the problem that the equipment cannot be started due to the failure of upgrading of the U-Boot is avoided.
Referring to fig. 2, fig. 2 is a flowchart illustrating another embodiment of a boot method for a generic bootloader-based device according to the present invention. The execution subject in this example is a generic bootloader-based device, which includes: the system comprises a Central Processing Unit (CPU) and a memory for storing a Universal Boot Loader (U-Boot), wherein the CPU and the memory can be connected through a Bootbus bus. The memory can be nand Flash or nor Flash. The number of the memories for storing the U-Boot can be one or two. When one memory for storing the U-Boot is used, storing a first U-Boot file and a second U-Boot file in different storage areas of the same memory; when the number of the memories for storing the U-boots is two, the first U-Boot file and the second U-Boot file are respectively stored in two different memories.
The method for starting the device based on the universal boot loader in the embodiment comprises the following steps:
s201: and when the preset operation of starting the universal Boot loader U-Boot is detected, running a first U-Boot file stored in a first storage area.
For example, when a device based on the U-Boot detects a power-on operation or a restart operation, a first U-Boot file pre-stored in a first storage area is acquired, and the first U-Boot file stored in the first storage area is operated.
The preset operation for starting the universal Boot loader U-Boot includes, but is not limited to, a power-on operation or a restart operation, and may also be other preset operations.
When the device based on the U-Boot comprises two memories, and the first storage area and the second storage area belong to different memories, the device based on the U-Boot can select the first storage area by controlling the first chip selection signal, and select the second storage area by controlling the second chip selection signal.
When the device based on the U-Boot comprises a memory, and the first storage area and the second storage area belong to different storage address partitions of the memory respectively, the first storage area or the second storage area is selected by controlling an address selector.
Optionally, after step S201, the method for starting the device based on the generic bootstrap loader may further include: when the first U-Boot file is incomplete, starting equipment through the second U-Boot file; and when the equipment is started, prompting a user that the equipment is abnormal.
For example, when a device based on the U-Boot obtains a first U-Boot file pre-stored in a first storage area, the device compares the first U-Boot file stored in the first storage area with an original first U-Boot file, determines whether the first U-Boot file is complete, reads a second U-Boot file stored in a second storage area when the first U-Boot file is confirmed to be incomplete, and starts the device through the second U-Boot file. And prompting the user that the equipment is abnormal when the equipment based on the U-Boot is started through completion. When the second U-Boot file is complete, the device based on the U-Boot can complete the starting; otherwise, the normal start cannot be performed.
And the device based on the U-Boot executes the step S202 when the first U-Boot file is confirmed to be complete.
S202: and reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete.
And running the code of the initial stage of the first U-Boot file by the U-Boot-based equipment, reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete.
The method for judging whether the second U-Boot file is complete may be to compare the content contained in the second U-Boot file with a pre-stored U-Boot reference file for verification to judge whether the content contained in the second U-Boot file is completely the same as the content contained in the U-Boot reference file for verification, and when it is confirmed that the two are completely the same, identify that the second U-Boot file is complete; and when only the two files are partially identical or completely different, identifying that the second U-Boot file is incomplete. And the version information of the pre-stored U-Boot reference file for verification corresponds to the version information of the second U-Boot file.
When the second U-Boot file is complete, executing step S203;
and when the second U-Boot file is not complete, executing the steps S204 to S205 or step S209.
S203: and when the second U-Boot file is complete, starting the equipment through the second U-Boot file.
And when the device based on the U-Boot confirms that the second U-Boot file is complete, confirming that the upgrade of the U-Boot which is closest to the starting time is successful.
And the device based on the U-Boot only upgrades the second U-Boot file stored in the second storage area. The first storage area is used for backing up U-Boot files.
When the device based on the U-Boot is started through a second U-Boot stored in a second storage area, starting a CPU watchdog program to detect whether the device is jammed in the starting process.
When the Device based on the U-Boot detects that the phenomenon of jamming occurs in the starting process, a Complex Programmable Logic Device (CPLD) connected with the CPU triggers a reset instruction.
When a stuck phenomenon or a failed start occurs during the start-up process, executing step S206; when the seizure phenomenon does not occur during the startup process, steps S207 to S208 are performed. The failed start may be a stuck state in the start process or a repeated restart in the start process.
S204: and when the second U-Boot file is incomplete, copying the first U-Boot file to the second storage area, and replacing the second U-Boot file.
And when the device based on the U-Boot confirms that the second U-Boot file is incomplete, identifying that the U-Boot upgrade which is closest to the starting time of this time fails.
The device based on the U-Boot copies the first U-Boot file from the first storage area, stores the copied first U-Boot file into the second storage area, and replaces the original second U-Boot file with the copied first U-Boot file to form a new second U-Boot file.
S205: and starting the equipment through the replaced second U-Boot file.
And after the copied first U-Boot file is replaced by the original second U-Boot file, the device based on the U-Boot starts the device through the replaced second U-Boot file.
For example, when the device based on the U-Boot is started through a second U-Boot stored in a second storage area, a CPU watchdog program is started to detect whether the device is jammed in the starting process.
When the Device based on the U-Boot detects that the phenomenon of jamming occurs in the starting process, a Complex Programmable Logic Device (CPLD) connected with the CPU triggers a reset instruction.
When a stuck phenomenon or a failed start occurs during the start-up process, executing step S206; the failed start may be a stuck state in the start process or a repeated restart in the start process.
When the seizure phenomenon does not occur during the startup process, steps S207 to S208 are performed.
S206: and when a reset instruction is detected or a preset operation for restarting the U-Boot is detected, executing the first U-Boot file which is operated and stored in the first storage area.
When the device based on the U-Boot detects a reset instruction or detects a preset operation triggering the restart of the U-Boot, the device based on the U-Boot is identified to be jammed in the starting process, and the step S201 is returned to restart the device.
Triggering the preset operation of restarting the U-Boot, wherein the preset operation can be that the equipment fails to successfully start the equipment system through a second U-Boot file within preset time; it may also be interrupted during the start-up of the device. The preset time may be 2 minutes, but is not limited thereto, and may be specifically set according to actual needs, and is not limited herein.
S207: and when the equipment finishes starting, judging whether the version information of the second U-Boot file is the same as that of the first U-Boot file.
And after the device based on the U-Boot is normally started, judging whether the version information of the second U-Boot file is the same as that of the first U-Boot file.
And when the version information of the second U-Boot file is different from the version information of the first U-Boot file, no processing is performed, and the device based on the U-Boot normally works.
And when the version information of the second U-Boot file is the same as the version information of the first U-Boot file, performing step S208.
S208: and when the version information of the second U-Boot file is the same as that of the first U-Boot file, prompting a user to upgrade the second U-Boot file again.
And the device based on the U-Boot identifies that the latest U-Boot upgrade before the current start fails when confirming that the version information of the second U-Boot file is the same as the version information of the first U-Boot file, and prompts a user to upgrade the second U-Boot file stored in the second storage area again.
At the moment, the user needs to upgrade the second U-Boot file stored in the second storage area again, and when the user upgrades the second U-Boot file manually, only new U-Boot software is allowed to be upgraded to the second storage area.
S209: and when the second U-Boot file is incomplete and the second storage area is abnormal, starting the equipment through the first U-Boot file.
And when the device based on the U-Boot judges that a second U-Boot file stored in a second storage area is incomplete, detecting whether the second storage area is abnormal or detecting whether the second storage area is damaged.
And when the device based on the U-Boot confirms that the second U-Boot file is incomplete and the second storage area is abnormal/damaged, starting the device through the first U-Boot file stored in the first storage area.
According to the scheme, the device based on the U-Boot backs up the first U-Boot file through the first storage area, when the upgrade failure of the second U-Boot file stored in the second storage area is confirmed, the first U-Boot file is copied to the second storage area and replaces the second U-Boot file, and the device is started through the replaced second U-Boot file, so that the normal starting of the device is guaranteed. The first U-Boot file in the first storage area is not supported to be changed, so that the first U-Boot file cannot be damaged by any software operation after delivery, the safety of the first U-Boot file is ensured, the normal starting of the U-Boot is ensured, the normal starting of the equipment is further ensured, the success rate of starting the equipment is improved, and the problem that the equipment cannot be started due to the failure of upgrading of the U-Boot is avoided.
When the second U-Boot file is incomplete and the second storage area is abnormal/damaged, the device based on the U-Boot is started through the first U-Boot file stored in the first storage area, and the problem that the device cannot be started due to damage of the storage area storing the U-Boot can be solved.
When the first U-Boot file is incomplete, starting the equipment through a second U-Boot file; when the second U-Boot file is incomplete and the first U-Boot file is complete, copying the first U-Boot file to a second storage area, and starting the copied U-Boot file; the first storage area and the second storage area can be monitored mutually, and if one storage area is damaged, the U-Boot file of the other storage area is replaced for starting.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an apparatus based on a generic bootloader according to an embodiment of the present invention. For details, please refer to fig. 1 and the related description in the embodiment corresponding to fig. 1, which are not repeated herein. The generic bootloader-based device of the present embodiment includes a running module 310, a reading module 320, a first starting module 330, an updating module 340, and a second starting module 350.
The running module 310 is configured to run a first U-Boot file stored in a first storage area when detecting a preset operation of starting the universal Boot loader U-Boot.
For example, the running module 310 runs a first U-Boot file stored in a first storage area when detecting a preset operation of starting the universal Boot loader U-Boot.
The reading module 320 is configured to read a second U-Boot file stored in a second storage area, and determine whether the second U-Boot file is complete.
For example, the reading module 320 reads a second U-Boot file stored in a second storage area, and determines whether the second U-Boot file is complete. The reading module 320 sends the determination result to the first starting module 330 and the updating module 340.
The first starting module 330 is configured to receive the determination result sent by the reading module 320, and start the device through the second U-Boot file when the second U-Boot file is complete.
For example, the first Boot module 330 receives the determination result sent by the reading module 320, and when the determination result is that the second U-Boot file is complete, the device is booted through the second U-Boot file.
The updating module 340 is configured to receive the determination result sent by the reading module 320, copy the first U-Boot file to the second storage area when the second U-Boot file is incomplete, and replace the second U-Boot file.
For example, the updating module 340 receives the determination result sent by the reading module 320, and copies the first U-Boot file to the second storage area and replaces the second U-Boot file when the determination result is that the second U-Boot file is not complete.
The update module 340 sends notification information to the second Boot module 350 after replacing the second U-Boot file.
The second Boot module 350 is configured to receive the notification information sent by the update module 340, and Boot the device through the replaced second U-Boot file.
For example, the second Boot module 350 receives the notification information sent by the update module 340, and boots the device through the replaced second U-Boot file.
According to the scheme, the device based on the U-Boot backs up the first U-Boot file through the first storage area, when the upgrade failure of the second U-Boot file stored in the second storage area is confirmed, the first U-Boot file is copied to the second storage area and replaces the second U-Boot file, and the device is started through the replaced second U-Boot file, so that the normal starting of the device is guaranteed. The first U-Boot file in the first storage area is not supported to be changed, so that the first U-Boot file cannot be damaged by any software operation after delivery, the safety of the first U-Boot file is ensured, the normal starting of the U-Boot is ensured, the normal starting of the equipment is further ensured, the success rate of starting the equipment is improved, and the problem that the equipment cannot be started due to the failure of upgrading of the U-Boot is avoided.
Referring to fig. 4, fig. 4 is a schematic structural diagram of another embodiment of a device based on a generic bootloader according to the present invention. For details, please refer to fig. 2 and the related description in the embodiment corresponding to fig. 2, which are not repeated herein. The device based on the generic bootloader of this embodiment includes an operation module 401, a reading module 402, a first starting module 403, an updating module 404, a second starting module 405, a determining module 406, a first prompting module 407, a third starting module 408, a second prompting module 409, a fourth starting module 410, and a restarting module 411.
The running module 401 is configured to run a first U-Boot file stored in a first storage area when detecting a preset operation of starting the universal Boot loader U-Boot.
The reading module 402 is configured to read a second U-Boot file stored in a second storage area, and determine whether the second U-Boot file is complete. The reading module 402 sends the determination result to the first starting module 403, the updating module 404 and the fourth starting module 410.
The first starting module 403 is configured to receive the determination result sent by the reading module 402, and start the device through the second U-Boot file when the determination result is that the second U-Boot file is complete.
The updating module 404 is configured to receive the determination result sent by the reading module 402, copy the first U-Boot file to the second storage area when the determination result is that the second U-Boot file is not complete, and replace the second U-Boot file.
The second Boot module 405 is configured to Boot the device through the replaced second U-Boot file.
The determining module 406 is configured to determine whether the version information of the second U-Boot file is the same as the version information of the first U-Boot file when the device is started. The judgment module 406 sends the judgment result to the first prompting module 407.
The first prompting module 407 is configured to receive the determination result sent by the determining module 406, and prompt the user to upgrade the second U-Boot file again when the version information of the second U-Boot file is the same as the version information of the first U-Boot file.
The third starting module 408 is configured to start the device through the second U-Boot file when the first U-Boot file is incomplete.
The second prompting module 409 is used for prompting the user that the equipment is abnormal when the equipment is started.
The fourth starting module 410 is configured to receive the determination result sent by the reading module 402, and start the device through the first U-Boot file when the second U-Boot file is incomplete and the second storage area is abnormal.
Further, the restart module 411 is configured to run the first U-Boot file stored in the first storage area when a reset instruction is detected or a preset operation that triggers restarting of the U-Boot is detected.
For example, when detecting a reset instruction or detecting a preset operation triggering the restart of the U-Boot, the restart module 411 runs a first U-Boot file stored in the first storage area. When the first U-Boot file is run, the restart module 411 sends notification information to the read module 402 to notify the read module 402 to read a second U-Boot file stored in a second storage area, and determines whether the second U-Boot file is complete.
According to the scheme, the device based on the U-Boot backs up the first U-Boot file through the first storage area, when the upgrade failure of the second U-Boot file stored in the second storage area is confirmed, the first U-Boot file is copied to the second storage area and replaces the second U-Boot file, and the device is started through the replaced second U-Boot file, so that the normal starting of the device is guaranteed. The first U-Boot file in the first storage area is not supported to be changed, so that the first U-Boot file cannot be damaged by any software operation after delivery, the safety of the first U-Boot file is ensured, the normal starting of the U-Boot is ensured, the normal starting of the equipment is further ensured, the success rate of starting the equipment is improved, and the problem that the equipment cannot be started due to the failure of upgrading of the U-Boot is avoided.
When the second U-Boot file is incomplete and the second storage area is abnormal/damaged, the device based on the U-Boot is started through the first U-Boot file stored in the first storage area, and the problem that the device cannot be started due to damage of the storage area storing the U-Boot can be solved.
When the first U-Boot file is incomplete, starting the equipment through a second U-Boot file; when the second U-Boot file is incomplete and the first U-Boot file is complete, copying the first U-Boot file to a second storage area, and starting the copied U-Boot file; the first storage area and the second storage area can be monitored mutually, and if one storage area is damaged, the U-Boot file of the other storage area is replaced for starting.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method for starting a device based on a universal boot loader is characterized by comprising the following steps:
when the preset operation of starting the universal Boot loader U-Boot is detected, running a first U-Boot file which is stored in a first storage area and does not support modification;
reading a second U-Boot file stored in a second storage area, and judging whether the second U-Boot file is complete;
when the second U-Boot file is complete, starting the equipment through the second U-Boot file;
when the second U-Boot file is incomplete, copying the first U-Boot file to the second storage area, and replacing the second U-Boot file;
and starting the equipment through the replaced second U-Boot file.
2. The method for booting a generic bootstrap loader-based device according to claim 1, wherein after the device is booted by the second U-Boot file when the second U-Boot file is complete, or after the device is booted by the replaced second U-Boot file, the method further comprises:
and when a reset instruction is detected or a preset operation for restarting the U-Boot is detected, executing the first U-Boot file which is operated and stored in the first storage area.
3. A method for booting a generic bootstrap loader-based device according to claim 1 or 2, characterized in that, when the second U-Boot file is complete, after the device is booted by the second U-Boot file, or after the device is booted by the replaced second U-Boot file, the method further comprises:
when the equipment finishes starting, judging whether the version information of the second U-Boot file is the same as that of the first U-Boot file;
and when the version information of the second U-Boot file is the same as that of the first U-Boot file, prompting a user to upgrade the second U-Boot file again.
4. The method according to claim 1, wherein after the running of the first U-Boot file stored in the first storage area, the reading of the second U-Boot file stored in the second storage area is performed, and before the second U-Boot file is determined to be complete, the method further comprises:
when the first U-Boot file is incomplete, starting equipment through the second U-Boot file;
and when the equipment is started, prompting a user that the equipment is abnormal.
5. The method for booting a generic bootstrap loader based device according to claim 1, characterized in that said method further comprises:
and when the second U-Boot file is incomplete and the second storage area is abnormal, starting the equipment through the first U-Boot file.
6. A generic bootloader based device, the device comprising:
the device comprises an operation module, a first storage area and a second storage area, wherein the operation module is used for operating a first U-Boot file which is stored in the first storage area and does not support modification when the preset operation of starting the universal Boot loader U-Boot is detected;
the reading module is used for reading a second U-Boot file stored in a second storage area and judging whether the second U-Boot file is complete or not;
the first starting module is used for starting the equipment through the second U-Boot file when the second U-Boot file is complete;
the updating module is used for copying the first U-Boot file to the second storage area and replacing the second U-Boot file when the second U-Boot file is incomplete;
and the second starting module is used for starting the equipment through the replaced second U-Boot file.
7. The apparatus of claim 6, further comprising:
and the restarting module is used for running a first U-Boot file stored in the first storage area when a reset instruction is detected or a preset operation for triggering the restarting of the U-Boot is detected.
8. The apparatus of claim 6 or 7, further comprising:
the judging module is used for judging whether the version information of the second U-Boot file is the same as that of the first U-Boot file or not when the equipment is started;
and the first prompting module is used for prompting a user to upgrade the second U-Boot file again when the version information of the second U-Boot file is the same as that of the first U-Boot file.
9. The apparatus of claim 6, further comprising:
the third starting module is used for starting equipment through the second U-Boot file when the first U-Boot file is incomplete;
and the second prompting module is used for prompting the user that the equipment is abnormal when the equipment is started.
10. The apparatus of claim 6, further comprising:
and the fourth starting module is used for starting the equipment through the first U-Boot file when the second U-Boot file is incomplete and the second storage area is abnormal.
CN201611085432.2A 2016-11-29 2016-11-29 Equipment based on universal boot loader and starting method thereof Active CN106775674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611085432.2A CN106775674B (en) 2016-11-29 2016-11-29 Equipment based on universal boot loader and starting method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611085432.2A CN106775674B (en) 2016-11-29 2016-11-29 Equipment based on universal boot loader and starting method thereof

Publications (2)

Publication Number Publication Date
CN106775674A CN106775674A (en) 2017-05-31
CN106775674B true CN106775674B (en) 2020-06-05

Family

ID=58913866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611085432.2A Active CN106775674B (en) 2016-11-29 2016-11-29 Equipment based on universal boot loader and starting method thereof

Country Status (1)

Country Link
CN (1) CN106775674B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595981B (en) * 2018-05-09 2021-07-20 深圳市桑格尔科技股份有限公司 Method for encrypting android system
CN109491716B (en) * 2018-10-19 2021-11-16 北京行易道科技有限公司 Starting method and device, program storage method and device
CN110308939A (en) * 2019-07-01 2019-10-08 联想(北京)有限公司 Information processing method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576828A (en) * 2009-06-01 2009-11-11 中兴通讯股份有限公司 Software version upgrading method, device and server
CN102253846A (en) * 2010-05-21 2011-11-23 康佳集团股份有限公司 Method for upgrading embedded system software
CN102945176A (en) * 2012-11-09 2013-02-27 青岛海信移动通信技术股份有限公司 Terminal equipment booting and updating method and equipment
CN103186390A (en) * 2011-12-29 2013-07-03 中国移动通信集团公司 Home gateway and software upgrading method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7711941B2 (en) * 2006-12-19 2010-05-04 Lsi Corporation Method and apparatus for booting independent operating systems in a multi-processor core integrated circuit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576828A (en) * 2009-06-01 2009-11-11 中兴通讯股份有限公司 Software version upgrading method, device and server
CN102253846A (en) * 2010-05-21 2011-11-23 康佳集团股份有限公司 Method for upgrading embedded system software
CN103186390A (en) * 2011-12-29 2013-07-03 中国移动通信集团公司 Home gateway and software upgrading method thereof
CN102945176A (en) * 2012-11-09 2013-02-27 青岛海信移动通信技术股份有限公司 Terminal equipment booting and updating method and equipment

Also Published As

Publication number Publication date
CN106775674A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US8181007B2 (en) Electronic device and method for secure operating system update in embedded system
JP2015008005A (en) Secure recovery apparatus and method
CN106775674B (en) Equipment based on universal boot loader and starting method thereof
KR20110055841A (en) Recovery method of system and apparatus for supplying the same
JP5575338B2 (en) Information processing apparatus, information processing method, and computer program
CN103970564A (en) Automatic repairing and upgrading method of embedded operating system and embedded operating system with automatic repairing and upgrading functions
CN106020861A (en) FOTA upgrading method and system for smart watch
WO2018024198A1 (en) Application upgrade method and system for set-top box, and set-top box
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN106775610B (en) Electronic equipment starting method and electronic equipment
CN106156626B (en) Method and device for safely upgrading system
US20110173428A1 (en) Computer system, method for booting a computer system, and method for replacing a component
CN104572181A (en) Method and device for starting backup bootstrap program
CN110908722B (en) Method and device applied to starting of operating system, electronic equipment and storage medium
WO2016206514A1 (en) Startup processing method and device
CN106325912B (en) The starting method and device of embedded OS
KR101420026B1 (en) A method, apparatus and computer program for loading files during a boot-up process
CN106611124B (en) Computer installation and its starting-up method
CN105988831B (en) System starting method and device and electronic equipment
CN113254048B (en) Method, device and equipment for updating boot program and computer readable medium
KR20070101724A (en) Apparatus and method for booting duplication in network system
EP3798831A1 (en) Resilient upgradable boot loader with power reset
TW202131170A (en) Firmware corruption recovery
CN107273128B (en) Electronic equipment starting method and device
JP6072521B2 (en) Computer start system, computer start program, computer, and computer start 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
GR01 Patent grant
GR01 Patent grant