CN116661875B - Method for starting terminal equipment and electronic equipment - Google Patents

Method for starting terminal equipment and electronic equipment Download PDF

Info

Publication number
CN116661875B
CN116661875B CN202211461003.6A CN202211461003A CN116661875B CN 116661875 B CN116661875 B CN 116661875B CN 202211461003 A CN202211461003 A CN 202211461003A CN 116661875 B CN116661875 B CN 116661875B
Authority
CN
China
Prior art keywords
control unit
image file
memory chip
terminal equipment
file
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
CN202211461003.6A
Other languages
Chinese (zh)
Other versions
CN116661875A (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211461003.6A priority Critical patent/CN116661875B/en
Publication of CN116661875A publication Critical patent/CN116661875A/en
Application granted granted Critical
Publication of CN116661875B publication Critical patent/CN116661875B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a method for realizing starting of terminal equipment and electronic equipment, wherein the method comprises the following steps: acquiring the binding condition of a control unit in terminal equipment; according to the binding condition of the control unit, loading a first image file or a second image file in a system file of an operating system of the terminal equipment stored in a storage chip in the terminal equipment so as to enable the terminal equipment to be started normally; the first mirror image file is used for triggering the control unit to write an authentication key into a memory chip in the terminal equipment, and triggering the control unit to set an initialization identifier, wherein the initialization identifier is the same as an initialization identifier of a register in the control unit; the second image file is used for writing an authentication key into a memory chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier. Therefore, the normal starting of the terminal equipment after the storage chip and/or the control unit are replaced is realized, and the waste of resources is prevented.

Description

Method for starting terminal equipment and electronic equipment
Technical Field
The application belongs to the technical field of terminals, and particularly relates to a method for starting terminal equipment and electronic equipment.
Background
At present, the normal starting of the terminal equipment is required to rely on that a control unit (such as central processing unit, CPU) in the terminal equipment and a memory chip in the terminal equipment are in a fault-free state, and the control unit and the memory chip are in an electric connection or bidirectional binding relation. The bidirectional binding relationship refers to that the control unit writes the authentication key into the memory chip, and the control unit sets the initialization identifier.
However, the control unit and/or the memory chip may malfunction. After the control unit or the memory chip is replaced, the above relationship between the control unit and the memory chip will not exist, which results in that the terminal device cannot be started normally.
Disclosure of Invention
The application provides a method for realizing starting of terminal equipment and electronic equipment, which ensure the normal starting of the terminal equipment and avoid the waste of resources as far as possible.
In a first aspect, the present application provides a method for implementing starting of a terminal device, including:
acquiring a binding condition of a control unit in the terminal equipment, wherein the binding condition is used for indicating whether the control unit initializes a memory chip or not;
according to the binding condition of the control unit, loading a first image file or a second image file in a system file of an operating system of the terminal equipment stored in a storage chip in the terminal equipment so as to enable the terminal equipment to be started normally;
The first mirror image file is used for triggering the control unit to write an authentication key into a storage chip in the terminal equipment, and the triggering control unit sets an initialization identifier which is the same as the initialization identifier of a register in the control unit;
the second image file is used for writing an authentication key into a memory chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
The method can acquire the binding condition of the control unit in the terminal equipment, determine whether the control unit initializes the memory chip, and prepare data for loading the first image file or the second image file in the system file.
Based on this, when the binding condition of the control unit initializes the memory chip for the control unit, the first image file may be loaded in the system file of the operating system of the terminal device stored by the memory chip in the terminal device. The first image file may trigger the control unit to write the authentication key to the memory chip, and trigger the control unit to set an initialization identifier to a register in the control unit, so that the memory chip stores the authentication key, and the register in the control unit has the initialization identifier.
Therefore, when the terminal equipment needs to be started, the control unit reads and runs the system file of the operating system stored in the storage chip, and the terminal equipment can be started normally after the storage chip is successfully accessed according to the two-way binding relation between the control unit and the storage chip.
In addition, when the binding condition of the control unit is that the control unit does not initialize the memory chip, the second image file can be loaded in the system file of the operating system of the terminal device stored by the memory chip in the terminal device. And the second mirror image file shielding control unit writes the authentication key into the storage chip, and the shielding control unit sets an initialization identifier to a register in the control unit, so that the authentication key does not exist in the storage chip, and the initialization identifier does not exist in the register in the control unit.
Therefore, when the terminal equipment needs to be started, the control unit reads and runs the system file of the operating system stored in the storage chip according to the relation of the electrical connection between the control unit and the storage chip, and the terminal equipment can be started normally.
With reference to the first aspect, in some implementations of the first aspect, loading the first image file or the second image file in a system file of an operating system of the terminal device stored in a storage chip in the terminal device includes:
Judging whether the control unit has an initialization identifier according to the binding condition of the control unit, wherein the initialization identifier is used for indicating the control unit to initialize the memory chip;
when the control unit has an initialization mark, loading a first mirror image file in a system file;
and when the control unit does not have the initialization mark, loading a second image file in the system file.
In the method, when the control unit has the initializing identifier, the first image file is loaded in the system file, so that the first image file triggers the control unit to write the authentication key into the memory chip, and triggers the control unit to set the initializing identifier to a register in the control unit.
In addition, when the control unit does not have the initialization identification, the second image file is loaded in the system file, so that the second image file shields the control unit from writing the authentication key into the memory chip, and the shielding control unit sets the initialization identification to a register in the control unit.
With reference to the first aspect, in some implementations of the first aspect, acquiring a binding situation of a control unit in a terminal device includes:
receiving a system log sent by terminal equipment, wherein the system log records the running condition of a system file;
Analyzing the system log, and acquiring a fuse value of a register in the control unit from the analyzed system log;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
In the method, the system log of the terminal equipment can be obtained, and the fuse value of the register in the control unit can be obtained from the system log of the terminal equipment. The device is facilitated to be able to determine whether the control unit has initialized the memory chip based on fuse values of registers in the control unit.
With reference to the first aspect, in some implementations of the first aspect, acquiring a binding situation of a control unit in a terminal device includes:
sending a state acquisition instruction to terminal equipment;
receiving a fuse value of a register in a control unit sent by terminal equipment, wherein the fuse value is sent after receiving a state acquisition instruction;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
In the method, the instruction receiving module corresponding to the state receiving instruction is stored in the terminal equipment in advance, so that the terminal equipment can send the fuse value of the register in the control unit to the equipment for sending the state receiving instruction after receiving the state receiving instruction. The device is facilitated to be able to determine whether the control unit has initialized the memory chip based on fuse values of registers in the control unit.
With reference to the first aspect, in some implementations of the first aspect, loading the first image file in a system file of an operating system of the terminal device stored in the storage chip includes:
when the third image file does not exist in the system file, writing the first image file in the system file;
when a third image file exists in the system file, replacing the third image file with the first image file;
the third image file is used for triggering the control unit to write the authentication key into the memory chip in the terminal equipment, and the triggering control unit sets the initialization identifier.
When the first image file is loaded, the system file stored in the storage chip may or may not have the third image file. When the third image file does not exist in the system file, the first image file can be directly written in the system file, and when the third image file exists in the system file, the third image file can be replaced by the first image file.
With reference to the first aspect, in some implementations of the first aspect, loading the second image file in a system file of an operating system of the terminal device stored in the storage chip includes:
writing a second image file into the system file when the fourth image file does not exist in the system file;
when a fourth image file exists in the system file, replacing the fourth image file with the second image file;
the fourth image file is used for shielding the control unit from writing an authentication key into a memory chip in the terminal equipment, and the shielding control unit sets an initialization identifier.
Similarly, when the second image file is loaded, the fourth image file may or may not exist in the system file stored in the storage chip. When the fourth image file does not exist in the system file, the second image file can be directly written in the system file, and when the fourth image file exists in the system file, the fourth image file can be replaced by the second image file.
With reference to the first aspect, in certain implementations of the first aspect, the storage chip includes a replay protection memory block secure partition and a read-only partition;
the replay protection memory block secure partition is used for storing the authentication key; read-only partitioning is used to store system files.
When the memory chip and the control unit have a bidirectional binding relationship, an authentication key exists, and the memory chip can store the authentication key in the replay protection memory block secure partition. When the user has stored the user's secure data on the terminal device, the memory chip may also store the user's secure data in the playback-protected memory block secure partition.
When the memory chip and the control unit have no two-way binding relation, the authentication key and the secret data of the user do not exist, and the replay protection memory block safe partition can be a blank area.
In a second aspect, the present application provides a device for implementing terminal equipment start-up, where the device for implementing terminal equipment start-up is configured to perform the method for implementing terminal equipment start-up in any one of the first aspect and any one of possible designs of the first aspect.
Specifically, the device for realizing the starting of the terminal equipment comprises an acquisition module and a loading module.
The acquisition module is used for acquiring the binding condition of the control unit in the terminal equipment, wherein the binding condition is used for indicating whether the control unit initializes the memory chip or not;
the loading module is used for loading the first image file or the second image file in the system file of the operating system of the terminal equipment stored in the storage chip in the terminal equipment according to the binding condition of the control unit so as to enable the terminal equipment to be started normally;
The first mirror image file is used for triggering the control unit to write an authentication key into a storage chip in the terminal equipment, and the triggering control unit sets an initialization identifier which is the same as the initialization identifier of a register in the control unit;
the second image file is used for writing an authentication key into a memory chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
With reference to the second aspect, in certain implementations of the second aspect, the loading module is specifically configured to:
judging whether the control unit has an initialization identifier according to the binding condition of the control unit, wherein the initialization identifier is used for indicating the control unit to initialize the memory chip;
when the control unit has an initialization mark, loading a first mirror image file in a system file;
and when the control unit does not have the initialization mark, loading a second image file in the system file.
With reference to the second aspect, in certain implementations of the second aspect, the acquiring module is specifically configured to:
receiving a system log sent by terminal equipment, wherein the system log records the running condition of a system file;
analyzing the system log, and acquiring a fuse value of a register in the control unit from the analyzed system log;
When the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
With reference to the second aspect, in certain implementations of the second aspect, the acquiring module is specifically configured to: comprising the following steps:
sending a state acquisition instruction to terminal equipment;
receiving a fuse value of a register in a control unit sent by terminal equipment, wherein the fuse value is sent after receiving a state acquisition instruction;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
With reference to the second aspect, in certain implementations of the second aspect, the loading module is specifically configured to:
when the third image file does not exist in the system file, writing the first image file in the system file;
when a third image file exists in the system file, replacing the third image file with the first image file;
the third image file is used for triggering the control unit to write the authentication key into the memory chip in the terminal equipment, and the triggering control unit sets the initialization identifier.
With reference to the second aspect, in certain implementations of the second aspect, the loading module is specifically configured to:
writing a second image file into the system file when the fourth image file does not exist in the system file;
when a fourth image file exists in the system file, replacing the third image file with the second image file;
the fourth image file is used for writing an authentication key into a storage chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
With reference to the second aspect, in certain implementations of the second aspect, the storage chip includes a replay protection memory block secure partition and a read-only partition;
the replay protection memory block secure partition is used for storing the authentication key; read-only partitioning is used to store system files.
In a third aspect, the present application provides an electronic device comprising a processor; the computer code or instructions in the memory, when executed by the processor, cause the electronic device to perform the method of implementing terminal device booting in the first aspect and any of the possible designs of the first aspect.
In a fourth aspect, the present application provides an electronic device comprising one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the method of enabling terminal device booting in the first aspect and any of the possible designs of the first aspect.
In a fifth aspect, the present application provides a chip system comprising a processor for invoking and running a computer program from a memory, such that an electronic device on which the chip system is installed performs the method of implementing terminal device activation in any of the possible designs of the first aspect and the first aspect.
In a sixth aspect, the present application provides a computer readable storage medium comprising a computer program which, when run on an electronic device, causes the electronic device to perform the method of enabling terminal device booting in the first aspect and any one of the possible designs of the first aspect.
In a seventh aspect, the present application provides a computer program product for causing a computer to perform the method of enabling a terminal device to be booted in the first aspect and any one of the possible designs of the first aspect when the computer program product is run on the computer.
It will be appreciated that the advantages of the second to seventh aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic starting diagram of a terminal device according to an embodiment of the present application;
fig. 2 is a schematic starting diagram of a terminal device according to an embodiment of the present application;
fig. 3 is a schematic starting diagram of a terminal device according to an embodiment of the present application;
fig. 4 is a schematic starting diagram of a terminal device according to an embodiment of the present application;
fig. 5 is a schematic starting diagram of a terminal device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a flowchart of a method for implementing starting of a terminal device according to an embodiment of the present application;
fig. 9 is a schematic starting diagram of a terminal device according to an embodiment of the present application;
fig. 10 is a flowchart of a method for implementing starting of a terminal device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a device for implementing starting of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" means two or more than two.
The terms "first," "second," "third," and the like, are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", or a third "may explicitly or implicitly include one or more such feature.
It should be understood that the case where the terminal system is normally started up depending on the control unit (e.g., central processing unit, CPU) and the memory chip in the terminal device can be classified into the following two cases:
in case 1, the control unit is electrically connected to a memory chip, and the memory chip stores a system file of an operating system, where the system file of the operating system is used to provide a software code for starting the terminal device.
When the terminal equipment needs to be started, the control unit reads and runs the system file of the operating system stored in the memory chip, and the terminal equipment can be started normally.
And 2, the control unit is electrically connected with a storage chip, and the storage chip stores a system file of an operating system, wherein the system file of the operating system is used for providing a software code for starting the terminal equipment. An image file is stored in a system file of the operating system, and after the image file is stored, the control unit and a replay protection memory block (replay protected memory block, RPMB) of the storage chip can be triggered to form a bi-directional binding relationship, namely, the control unit writes an authentication key into the RPMB of the storage chip, and the control unit sets an initialization identifier in a register of the control unit.
The authentication key is used for checking whether the written data or the read data of the RPMB safe partition of the memory chip is tampered or not.
When the terminal equipment needs to be started, the control unit reads and runs the system file of the operating system stored in the storage chip, and can successfully access the RPMB of the storage chip according to the bidirectional binding relation between the control unit and the RPMB of the storage chip, so that the terminal equipment can be started normally.
For case 1, the control unit and the RPMB of the memory chip do not have the above-mentioned two-way binding relationship, the control unit does not have an initialization identifier, and the memory chip does not store an authentication key.
Therefore, the control unit fails, the states of the two replaced devices are shown in fig. 1, the replaced control unit has no initialization mark, the authentication key is not stored in the memory chip, and the terminal equipment can be started normally.
The storage chip fails, the states of the two replaced devices are shown in fig. 2, the control unit has no initialization mark, the replaced storage chip does not store an authentication key, and the terminal equipment can be started normally.
For case 2, after the control unit fails, the failed control unit cannot operate normally, and then the failed control unit may not successfully access the RPMB of the memory chip, so that the terminal device cannot be started normally.
Similarly, after the storage chip fails, the control unit cannot successfully access the RPMB of the storage chip, so that the terminal device cannot be started normally.
Therefore, the control unit fails, the states of the two replaced devices are shown in fig. 3, the replaced control unit and the RPMB of the memory chip have no bidirectional binding relation, the replaced control unit has no initialization mark, and the memory chip stores an authentication key. Then, the replaced control unit cannot successfully access the RPMB of the memory chip, so that the terminal device cannot be started normally.
Similarly, the storage chip fails, the states of the two replaced devices are shown in fig. 4, the RPMB of the replaced storage chip and the control unit have no bidirectional binding relation, the control unit has an initialization mark, and the replaced storage chip does not store an authentication key. Then, the control unit cannot successfully access the RPMB of the memory chip, resulting in that the terminal device cannot be started normally.
Based on the above description, the control unit fails or the storage chip fails, and the states of the two devices after both the control unit and the storage chip are replaced are shown in fig. 5, the RPMB of the control unit and the RPMB of the storage chip do not have the above-mentioned two-way binding relationship, the control unit does not have the initializing identifier, the storage chip does not store the authentication key, and the terminal device can be started normally.
For the case shown in fig. 5, any one of the control unit and the memory chip fails, two devices need to be replaced at the same time, and the terminal device can be started normally, so that resources are wasted greatly.
In summary, when two conditions exist in the control unit and the memory chip, the terminal device can be started normally, namely:
the control unit and the RPMB of the memory chip do not have the relation of the two-way binding, and when the terminal equipment needs to be started, the control unit can enable the terminal equipment to be started normally based on the system file of the operating system stored in the memory chip.
When the terminal equipment needs to be started, the control unit can be based on the system file of the operating system stored in the storage chip and the relation of the bidirectional binding between the control unit and the RPMB of the storage chip, so that the terminal equipment can be started normally.
It should be understood that when the system file is stored in the storage chip, the image file may be stored in the storage chip together with the system file, and triggers the control unit to write the authentication key into the RPMB of the storage chip in the terminal device, and triggers the control unit to set the initialization identifier, so that a bidirectional binding relationship is established between the RPMB of the storage chip and the control unit.
That is, when the terminal device leaves the factory in the hand of the user, there is already a bi-directional binding relationship between the RPMB of the memory chip and the control unit. When the terminal equipment needs to be started, the control unit is required to read and run the system file of the operating system stored in the storage chip, and the control unit is required to successfully access the RPMB of the storage chip according to the bidirectional binding relation between the control unit and the RPMB of the storage chip, so that the terminal equipment can be started normally.
For terminal devices shipped to the hands of the user, there is already a bi-directional binding relationship between the RPMB of the memory chip and the control unit, and the terminal device is able to store the secret data of the user based on such a relationship.
In addition, for the terminal device which is not delivered to the hands of the user and is in the production stage, the terminal device does not need to store the secret data of the user based on the bidirectional binding relationship, and the control unit of the terminal device and the RPMB of the storage chip can not establish the bidirectional binding relationship.
The application can provide a method for realizing starting of terminal equipment, a device for realizing starting of the terminal equipment, electronic equipment, a chip system, a computer readable storage medium and a computer program product, wherein after a failed storage chip is considered to be replaced, the replaced storage chip and a control unit are not in a bidirectional binding relationship. Therefore, the relation can be re-established, so that the terminal equipment is normally started based on the system files in the memory chip and the relation of bidirectional binding between the memory chip and the control unit.
In addition, after the faulty control unit is replaced, there is no correspondence between the replaced control unit and the memory chip or the replaced memory chip. Therefore, the control unit and the memory chip have no relation, so that the terminal equipment is started normally based on the system file in the memory chip.
Therefore, under the condition of replacing the memory chip or the control unit, the terminal equipment can be started normally, and the waste of resources is avoided as much as possible.
The terminal device in the present application may be a device including a control unit and a memory chip.
In addition, the terminal equipment can be equipment of a manufacturer in the production process, and can also be equipment of a user in the maintenance process from a return factory to a maintenance manufacturer.
For example, the terminal device may be a cell phone, tablet computer, wearable device, in-vehicle device, notebook computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (personal digital assistant, PDA), etc.
The method for realizing starting of the terminal equipment can be applied to the electronic equipment.
For example, the electronic device may be a tablet, notebook, ultra-mobile personal computer (UMPC), netbook, server, cell phone, personal digital assistant (personal digital assistant, PDA), or the like.
In addition, the electronic equipment can be equipment used for detecting the terminal equipment by a manufacturer, and also can be equipment used for detecting the terminal equipment by a maintenance manufacturer.
For convenience of explanation, in fig. 6, the electronic device 100 is taken as a personal computer PC, and the terminal device is taken as a mobile phone. The structure of the terminal device 200 may be the same as that of the electronic device 100.
As shown in fig. 6, in some embodiments, the electronic device 100 may include a processor 101, a communication module 102, and the like.
The processor 101 may include one or more processing units, for example: the processor 101 may include an application processor (application processor, AP), a modem processor, a graphics processor, an image signal processor (image signal processor, ISP), a controller, a memory, a video stream codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors 101.
The controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 101 for storing instructions and data.
In some embodiments, the memory in the processor 101 is a cache memory. The memory may hold instructions or data that has just been used or recycled by the processor 101. If the processor 101 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 101 is reduced, thus improving the efficiency of the system.
In some embodiments, the processor 101 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface 304, among others.
The communication module 102 may include an antenna 1, an antenna 2, a mobile communication module, and/or a wireless communication module.
As shown in fig. 6, in some embodiments, the electronic device 100 may further include an external memory interface 105, an internal memory 104, a usb interface 106, a charge management module 107, a power management module 108, a battery 109, and a sensor module 103, among others.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The charge management module 107 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger.
In some wired charging embodiments, the charge management module 107 may receive a charging input of a wired charger through the USB interface 106.
In some wireless charging embodiments, the charge management module 107 may receive wireless charging input through a wireless charging coil of the electronic device 100. The battery 109 is charged by the charging management module 107, and the electronic device 100 may be powered by the power management module 108.
The power management module 108 is used for connecting the battery 109, and the charging management module 107 and the processor 101. The power management module 108 receives input from the battery 109 and/or the charge management module 107 and provides power to the processor 101, the internal memory 104, the external memory, the communication module 102, and the like. The power management module 108 may also be configured to monitor battery capacity, battery cycle times, battery health (leakage, impedance), and other parameters.
In other embodiments, the power management module 108 may also be disposed in the processor 101.
In other embodiments, the power management module 108 and the charge management module 107 may be disposed in the same device.
The external memory interface 105 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 101 through an external memory interface 105 to implement data storage functions. For example, files such as music, video streams, etc. are stored in an external memory card.
The internal memory 104 may be used to store computer-executable program code that includes instructions. The processor 101 executes instructions stored in the internal memory 104 to thereby perform various functional applications and data processing of the electronic device 100. The internal memory 104 may include a stored program area and a stored data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash memory (universal flash storage, UFS), and the like.
The sensor module 103 in the electronic device 100 may include components such as image sensors, touch sensors, pressure sensors, gyroscopic sensors, barometric pressure sensors, magnetic sensors, acceleration sensors, distance sensors, proximity sensors, ambient light sensors, fingerprint sensors, temperature sensors, bone conduction sensors, etc. to enable sensing and/or acquisition of different signals.
Optionally, the electronic device 100 may also include peripheral devices such as a mouse, keys, indicator lights, keyboard, speakers, microphone, etc.
The keys include a start key, a volume key, etc. The keys may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The indicator may be an indicator light, which may be used to indicate a change in state of charge and charge, or may be used to indicate a message, missed call, notification, etc.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100.
In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Fig. 7 is a schematic diagram of an electronic device according to an embodiment of the present application. When the method for implementing terminal device startup provided in the embodiment of the present application is applied to the electronic device 100 shown in fig. 6, software in the electronic device 100 may be divided into an application layer 201, a hardware abstraction layer (Hardware Abstraction Layer, HAL) 202, and a driver layer 203 as shown in fig. 3.
The application layer 201 may have a plurality of applications installed therein, and may include a camera application (camera application) for implementing a photographing function. The camera application program refers to a computer program running on an operating system and capable of executing a photographing task. When the format of the camera application is android application package (Android application package, APK) format, the camera application may run on the android operating system. In the embodiment of the present application, the camera application may be an application having a photographing function. For example, the function is an application program for sharing short video, and if the application program has a shooting function, the application program can be used as a camera application program in the embodiment of the application.
The hardware abstraction layer 202 is software located between the operating system kernel and the hardware circuitry, and is typically used to abstract the hardware to implement the interaction of the operating system with the hardware circuitry at the logic level. In an embodiment of the present application, the hardware abstraction layer 202 may include a camera hardware abstraction layer (camera Hardware Abstraction Layer, camera HAL) that enables a camera application to interact with an image sensor at a logical layer.
The driver layer 203 may have a plurality of drivers for driving hardware operations installed therein.
It should be noted that, the application layer 201, the hardware abstraction layer 202, and the driver layer 203 may also include other contents, which are not specifically limited herein.
The electronic device 100 and the terminal device 200 may communicate through a USB data line, bluetooth, wiFi, or the like.
Based on the above description of the scenario, in the following, the method for implementing starting of the terminal device provided in the embodiment of the present application is described in detail by taking the electronic device as an example and combining with the attached drawings and the application scenario.
Referring to fig. 8, fig. 8 is a flowchart illustrating a method for implementing terminal device startup according to an embodiment of the present application.
As shown in fig. 8, the method for implementing terminal device startup provided in the present application may include:
s101, acquiring the binding condition of a control unit in the terminal equipment.
The binding condition is used to indicate whether the control unit initializes the memory chip.
As can be seen, the binding situation of the control unit in the terminal device acquired by the electronic device may include: the control unit initializes the memory chip, or the control unit does not initialize the memory chip.
In some embodiments, the control unit initializes the memory chip, and the electronic device may determine that an initialization flag already exists for a register in the control unit.
Thus, the electronic device can determine that the control unit in the terminal device is not replaced and the memory chip is replaced.
In other embodiments, the control unit does not initialize the memory chip, and the electronic device may determine that the register in the control unit does not have an initialization flag.
Thus, the electronic device may determine that the control unit has been replaced, that the memory chip has not been replaced, or that it has been replaced.
S102, according to the binding condition of the control unit, loading the first image file or the second image file in the system file of the operating system of the terminal equipment stored in the storage chip in the terminal equipment so as to enable the terminal equipment to be started normally.
The first image file is used for triggering the control unit to write an authentication key into a storage chip in the terminal equipment, and the triggering control unit sets an initialization identifier which is the same as the initialization identifier of a register in the control unit.
The second image file is used for writing an authentication key into a memory chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
The authentication key is used for initializing the memory chip by the control unit, and the initialization identifier is used for identifying that the memory chip is initialized by the control unit.
The control unit writes the authentication key into the memory chip, so that the control unit initializes the memory chip, namely the memory chip is unidirectionally bound with the control unit. After the control unit writes the authentication key into the memory chip, the control unit can set an initialization identifier to a register of the control unit, so that the control unit is identified to initialize the memory chip, namely, the control unit is unidirectionally bound with the memory chip.
In addition, the control unit initializes the memory chip, so that the control unit obtains the authority to access the memory chip. The control unit has an initialization identifier, so that the control unit only has the right to access the memory chip, namely, the control unit and the memory chip form a bi-directional binding relationship.
If the control unit has an initialization identifier, the control unit indicates that the control unit has initialized the memory chip, and the control unit does not initialize the memory chip any more. After the electronic device loads the first image file in the system file of the operating system of the terminal device stored in the storage chip, the control unit is allowed to initialize the storage chip again, and the control unit can initialize the storage chip again.
In some embodiments, the control unit initializes the memory chip, and the electronic device may load the first image file in a system file of an operating system of the terminal device stored in the memory chip in the terminal device.
Therefore, the first image file can trigger the control unit to write the authentication key into the storage chip in the terminal device, and trigger the control unit to set the initialization identifier, so that the control unit and the storage chip establish a bidirectional binding relationship.
When the terminal equipment needs to be started, the control unit can read and run the system files of the operating system stored in the storage chip, and the terminal equipment is started normally according to the bidirectional binding relation between the control unit and the storage chip.
Based on the above description, when the electronic device determines that the control unit initializes the memory chip, there are two cases where the memory chip in the terminal device has been replaced, or neither the memory chip in the terminal device nor the control unit has been replaced (the image file stored in the memory chip has triggered the control unit to write the authentication key to the memory chip, and the trigger over-control unit sets the initialization flag).
Thus, when the memory chip of the terminal device has been replaced, the electronic device can load the first image file in the system file of the operating system of the terminal device stored in the replaced memory chip. The first image file triggers the control unit to write the authentication key into the replaced storage chip, and triggers the control unit to set an initialization identifier, so that after the control unit and the replaced storage chip establish a bidirectional binding relationship, the two device states are as shown in fig. 9, the replaced storage chip and the control unit have a bidirectional binding relationship, the control unit has the initialization identifier, and the authentication key is stored in the replaced storage chip.
When the terminal equipment needs to be started, the control unit can read and run the system files of the operating system stored in the replaced storage chip, and the terminal equipment is started normally according to the bidirectional binding relation between the control unit and the replaced storage chip.
Or when the memory chip and the control unit of the terminal device are not replaced, the electronic device can load the first image file in the system file of the operating system of the terminal device stored in the memory chip. The memory chip and the control unit are not replaced, a bidirectional binding relation exists between the memory chip and the control unit, the control unit has an initialization identifier, and the authentication key is stored in the memory chip.
When the terminal equipment needs to be started, the control unit can read and run the system files of the operating system stored in the storage chip, and the terminal equipment is started normally according to the bidirectional binding relation between the control unit and the storage chip.
In other embodiments, the control unit does not initialize the memory chip, and the electronic device may load the second image file in a system file of an operating system of the terminal device stored in the memory chip in the terminal device.
Therefore, the second image file can mask the control unit to write the authentication key into the memory chip in the terminal device, and the mask control unit sets the initialization identifier, so that the control unit and the memory chip do not establish a bidirectional binding relationship.
When the terminal equipment needs to be started, the control unit can read and run the system file of the operating system stored in the storage chip according to the relation of the electrical connection between the control unit and the storage chip, so that the terminal equipment is started normally.
Based on the above description, when the electronic device determines that the control unit does not initialize the memory chip, there are two cases where both the memory chip and the control unit in the terminal device are replaced, or neither the memory chip nor the control unit in the terminal device is replaced (the image file stored in the memory chip is masked by the control unit to write an authentication key to the memory chip, and the masking control unit sets an initialization flag).
Thus, when the memory chip and the control unit in the terminal device have been replaced, the electronic device can load the second image file in the system file of the operating system of the terminal device stored in the memory chip. The second mirror image file shielding control unit writes the authentication key into the storage chip, and the shielding control unit sets the initialization identifier, so that the two-way binding relationship between the control unit and the storage chip is not established, the two-way binding relationship between the storage chip and the control unit is not established, the control unit does not have the initialization identifier, and the authentication key is not stored in the storage chip, as shown in fig. 5.
When the terminal equipment needs to be started, the control unit can read and run the system file of the operating system stored in the storage chip, so that the terminal equipment is started normally.
Or when the memory chip and the control unit in the terminal device are not replaced, the electronic device can load the second image file in the system file of the operating system of the terminal device stored in the memory chip. The memory chip and the control unit are not replaced, a two-way binding relation does not exist between the memory chip and the control unit, the control unit does not have an initialization mark, and the authentication key is not stored in the memory chip.
When the terminal equipment needs to be started, the control unit can read and run the system file of the operating system stored in the storage chip, so that the terminal equipment is started normally.
It should be understood that the terminal device stores the secret data (e.g., fingerprint, password, etc.) of the user, it is necessary to rely on the existence of a bi-directional binding relationship between the memory chip and the control unit, so that the control unit can securely store the secret data of the user into the memory chip based on the bi-directional binding relationship between the memory chip and the control unit, and the control unit can securely read the secret data of the user from the memory chip based on the bi-directional binding relationship between the memory chip and the control unit.
That is, for a terminal device that needs to be shipped to the user's hand, it is necessary to store confidential data of the user. Therefore, the image file loaded by the electronic device in the system file is the first image file, the control unit needs to write the authentication key into the storage chip, and the control unit needs to set the initialization identifier, so that a bidirectional binding relationship is established between the storage chip of the terminal device and the control unit.
For the terminal device, when the terminal device is started, the terminal device can be started normally only by relying on the bi-directional binding relation between the control unit and the memory chip.
In addition, the terminal device in the production phase does not need to store the secret data of the user. Therefore, the image file loaded by the electronic equipment in the system file is the second image file, so that the control unit does not need to write an authentication key into the storage chip, the control unit does not need to set an initialization mark, and the storage chip of the terminal equipment and the control unit can not have a bidirectional binding relation.
When the terminal equipment is started, the terminal equipment can be started normally without depending on the bi-directional binding relation between the control unit and the memory chip.
In addition, the memory chip includes a replay protected memory block secure partition and a read-only partition. The replay protection memory block secure partition is used for storing the authentication key and the secret data of the user; read-only partitioning is used to store system files.
In some embodiments, after the electronic device loads the first image file in the system file, the storage chip has an authentication key, and the storage chip may store the authentication key in the playback-protection memory block RPMB secure partition, and when the terminal device stores the user's secret data, the storage chip may further store the user's secret data in the RPMB secure partition.
In some embodiments, after the electronic device loads the second image file in the system file, there is no authentication key in the memory chip, and there is no confidential data of the user, and the memory chip may be a blank area.
The interface of the terminal device to the RPMB secure partition of the memory chip to store data may then be a gray interface. The user cannot perform an operation at the interface. The specific implementation of the interface is not limited in this application.
According to the method for realizing starting of the terminal equipment, the electronic equipment can acquire the binding condition of the control unit in the terminal equipment, and the electronic equipment determines to load the first image file or the second image file in the system file of the terminal equipment stored in the storage chip and prepares data.
Based on the above, when the binding condition of the control unit is that the control unit initializes the storage chip, the electronic device can load the first image file in the system file of the operating system of the terminal device stored in the storage chip, so that the control unit and the storage chip can conveniently establish a bidirectional binding relationship, an authentication key written in by the control unit is stored in the storage chip, and an initialization identifier sent by the storage unit is stored in a register in the control unit. Therefore, when the terminal equipment needs to be started, the control unit can enable the terminal equipment to be started normally based on the system file of the operating system stored in the storage chip and the two-way binding relation between the control unit and the storage chip.
Therefore, after the storage chip in the terminal equipment is failed and replaced, the first image file is loaded in the storage chip, so that the terminal equipment can be started normally, the failed storage chip and the control unit which is not failed are not required to be replaced completely, and the waste of resources is avoided as much as possible.
In addition, when the binding condition of the control unit is that the control unit does not initialize the storage chip, the electronic device can load a second image file in the system file of the operating system of the terminal device stored in the storage chip, so that the control unit and the storage chip do not establish a bidirectional binding relationship, the control unit does not write an authentication key into the storage chip, and the control unit does not set an initialization identifier. Therefore, when the terminal equipment needs to be started, the control unit can enable the terminal equipment to be started normally based on the system file of the operating system stored in the storage chip.
Based on the description of S101 in fig. 8, the electronic device may acquire the binding condition of the control unit in the terminal device in various manners.
For example, the electronic device may acquire the fuse value of the register in the control unit according to the system log of the terminal device, or acquire the binding condition of the control unit according to the fuse value of the register in the control unit sent by the terminal device according to the state acquisition instruction.
The specific implementation process of the binding condition of the control unit in the terminal device is described in detail below.
Mode 1:
receiving a system log sent by terminal equipment;
analyzing the system log, and acquiring a fuse value of a register in the control unit from the analyzed system log;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
The system log records the running condition of the system file.
It can be seen that the electronic device can retrieve the system log of the terminal device from the terminal device, so that the electronic device can parse the system log and obtain the fuse value of the register in the control unit from the parsed data.
Mode 2:
sending a state acquisition instruction to terminal equipment;
receiving a fuse value of a register in a control unit sent by terminal equipment, wherein the fuse value is sent after receiving a state acquisition instruction;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
And when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
It can be seen that the electronic device is capable of sending a status acquisition instruction to the terminal device, such that the terminal device sends the fuse value of the register in the control unit to the electronic device according to the status acquisition instruction, such that the electronic device obtains the fuse value of the register in the control unit.
Based on the above description, the electronic device may acquire the fuse value of the register in the control unit in two ways, and acquire the binding condition of the control unit in the terminal device according to the fuse value of the register in the control unit.
It will be appreciated that the fuse values of registers in the control unit are different for the control unit that initialized the memory chip than for the control unit that did not. Thus, the electronic device can determine whether the control unit has initialized the memory chip by the fuse value of the register in the control unit.
For example, if the control unit has not initialized the memory chip, the fuse value of the register in the control unit is 0. If the control unit initializes the memory chip, the fuse value of the register in the control unit is 1.
In some embodiments, the electronic device may determine that the fuse bit of the register in the control unit has an initialization flag and that the control unit initializes the memory chip.
Then, the following case exists:
the memory chip in the terminal device has been replaced, or the memory chip and the control unit of the terminal device have not been replaced (the image file stored in the memory chip has triggered the control unit to write the authentication key into the memory chip, and the trigger control unit sets the initialization flag).
In other embodiments, the fuse value is less than the threshold, the electronic device may determine that the fuse bit of the register in the control unit does not have an initialization flag, and that the control unit has not initialized the memory chip.
Then, the following case exists:
the memory chip and the control unit in the terminal device are replaced or not replaced (the image file stored in the memory chip is shielded, the control unit writes the authentication key into the memory chip, and the shielded control unit sets the initialization identifier).
The terminal equipment is assumed to be a mobile phone, the electronic equipment is a PC, and the control unit is a CPU.
If the fuse value is greater than or equal to the threshold value, the PC may determine that the CPU has initialized the memory chip.
Correspondingly, if the CPU initializes the memory chip, there are two cases, that is, the memory chip in the mobile phone has been replaced, or the memory chip and the control unit in the mobile phone have not been replaced (the image file stored in the memory chip has triggered the control unit to write the authentication key into the memory chip, and triggers the control unit to set the initialization identifier).
If the fuse value is less than the threshold value, the PC may determine that the CPU has not initialized the memory chip.
Correspondingly, if the CPU does not initialize the memory chip, there are two cases that the memory chip and the control unit in the mobile phone have been replaced (the memory chip and the control unit have not been used, the control unit has not written the authentication key into the memory chip and the control unit has not set the initialization identifier), or the memory chip and the control unit have not been replaced (the memory chip and the control unit have been used, but the control unit has not written the authentication key into the memory chip and the control unit has not set the initialization identifier).
It should be noted that, the CPU does not initialize the memory chip, and there is another case that the control unit in the mobile phone has been replaced, the memory chip has not been replaced (the control unit has not been used, the control unit has not written the authentication key into the memory chip, and the control unit has not set the initialization flag, and the control unit before the memory chip has been replaced writes the authentication key).
For the above case, it is to be understood that rpmb of the memory chip is a write-once area. The control unit has been replaced, the control unit does not have an initialisation identity, whereby:
if the memory chip is not replaced (original initialized device), the authentication key is written in the memory chip, after the first image file is loaded in the system file of the terminal device stored in the memory chip, the control unit is not triggered to write the authentication key into the memory chip any more because rpmb of the memory chip is a write-once area, the two-way binding relation between the control unit and the memory chip cannot be established, and the terminal device cannot be started normally.
Similarly, if the storage chip is not replaced (original initialized device), the authentication key is written in the storage chip, after the second image file is loaded in the system file of the terminal device stored in the storage chip, the second image file can mask the control unit to write the authentication key into the storage chip, the control unit and the storage chip cannot establish a bidirectional binding relationship, and the terminal device cannot be started normally.
In the application, the electronic device can determine whether the control unit is bound to the memory chip through the fuse value of the register in the control unit, so that the electronic device determines to load the first image file or the second image file in the system file of the terminal device stored in the memory chip, and prepares data.
Based on the description of S102 in fig. 8, the electronic device may load the first image file or the second image file in the system file of the operating system of the terminal device stored in the memory chip in the terminal device according to whether the control unit has the initialization identifier.
The specific implementation process of loading the first image file or the second image file in the present application is described in detail below.
Judging whether the control unit has an initialization mark according to the binding condition of the control unit;
When the control unit has an initialization mark, loading a first mirror image file in a system file;
and when the control unit does not have the initialization mark, loading a second image file in the system file.
The initialization identifier is used for indicating the control unit to initialize the memory chip.
Based on the description of S101 in fig. 8, the electronic device may determine that the binding condition of the control unit initializes the memory chip for the control unit, or that the control unit does not initialize the memory chip.
In some embodiments, the electronic device may determine that the control unit has an initialization flag when the binding of the control unit initializes the memory chip for the control unit.
That is, when the control unit has the initialization flag, the electronic device may determine that the memory chip in the terminal device has been replaced, or that neither the memory chip in the terminal device nor the control unit has been replaced (the image file stored in the memory chip has triggered the control unit to write the authentication key to the memory chip, and triggers the control unit to set the initialization flag).
Thus, the electronic device can load the first image file in the system file.
Therefore, the first image file can trigger the control unit to write the authentication key into the memory chip in the terminal equipment, and trigger the control unit to set the initialization mark, so that the memory chip and the control unit can establish a bidirectional binding relation.
Since the control unit already has an initialization flag, the initialization flag sent by the memory chip to the control unit is the same as the initialization flag of the register in the control unit.
Based on the above, when the terminal equipment needs to be started, the control unit can read and run the system file of the operating system stored in the storage chip, and can successfully access the storage chip according to the two-way binding relation between the control unit and the storage chip, so that the terminal equipment is started normally.
Therefore, after the storage chip fails, only the storage chip can be replaced, and the electronic equipment loads the first image file in the storage chip, so that the terminal equipment can be started normally, and the waste of resources is avoided as much as possible.
Based on the above description, when the electronic device loads the first image file in the system file of the operating system of the terminal device stored in the storage chip, there are two cases:
in case 1, the third image file does not exist in the system file.
For case 1, when the third image file does not exist in the system file, the electronic device may directly write the first image file in the system file.
Since the memory chip is a replaced memory chip, the memory chip is a blank chip, and the third image file may not exist in the stored system file, then the electronic device may directly write the first image file in the system file.
And 2, a third image file exists in the system file.
For case 2, when the third image file exists in the system file, the electronic device may replace the third image file with the first image file.
Since the memory chip is an unrechanged memory chip, and the third image file exists in the system file stored by the memory chip, the electronic device can replace the third image file with the first image file.
It should be understood that the storage chip and the control unit in the terminal device are not replaced, and the third image file exists in the system file stored in the storage chip. After the third image file is replaced by the first image file, the first image file has the capability of triggering the control unit to write the authentication key into the storage chip in the terminal equipment and triggering the control unit to set the initialization identifier, but because the storage chip has the authentication key, the control unit has the initialization identifier, the control unit and the storage chip have the bidirectional binding relationship, and the first image file can not trigger the control unit to write the authentication key into the storage chip in the terminal equipment any more and not trigger the control unit to set the initialization identifier any more.
The third image file is used for triggering the control unit to write the authentication key into the memory chip in the terminal equipment, and the triggering control unit sets the initialization identifier.
In other embodiments, the electronic device may determine that the control unit does not have an initialization flag when the binding of the control unit is that the control unit has not initialized the memory chip.
That is, when the control unit does not have the initialization flag, the electronic device may determine that both the memory chip and the control unit have been replaced, or that both the memory chip and the control unit have not been replaced (the image file stored in the memory chip is masked by the control unit writing the authentication key to the memory chip, and the masking control unit sets the initialization flag).
Thus, the electronic device can determine that the authentication key written by the control unit is not stored in the memory chip, and the control unit does not set the initialization identifier, and then the electronic device can load the second image file in the system file.
Therefore, the second image file can mask the control unit to write the authentication key into the memory chip in the terminal device, and the mask control unit sets the initialization identifier, so that the memory chip and the control unit do not establish a bidirectional binding relationship.
Based on the above, when the terminal device needs to be started, the control unit can read and run the system file of the operating system stored in the memory chip, so that the terminal device is started normally.
In addition, when the electronic device loads the second image file in the system file of the operating system of the terminal device stored in the storage chip, there are two cases:
in case 1, the fourth image file does not exist in the system file.
For case 1, when the fourth image file does not exist in the system file, the electronic device may directly write the second image file in the system file.
Because the storage chip and the control unit in the terminal equipment are replaced, the fourth image file does not exist in the system file stored by the storage chip, and then the electronic equipment can directly write the second image file in the system file.
And 2, a fourth image file exists in the system file.
For case 2, when the fourth image file exists in the system file, the electronic device may replace the fourth image file with the second image file.
Because the storage chip and the control unit in the terminal equipment are not replaced, but the control unit does not write the authentication key into the storage chip, and the control unit does not set the initialization mark, the fourth image file exists in the system file stored by the storage chip, and then the electronic equipment can replace the fourth image file with the second image file.
The fourth image file is used for writing an authentication key into a storage chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
In the application, when the control unit has an initialization identifier, the electronic device loads a first image file in the system file, so that a bidirectional binding relation is established between the control unit and the storage chip, an authentication key written by the control unit is stored in the storage chip, and the initialization identifier sent by the storage unit is stored in a register in the control unit. Therefore, when the terminal equipment needs to be started, the control unit can read and run the system file of the operating system stored in the storage chip, and successfully access the storage chip according to the two-way binding relation between the control unit and the storage chip, so that the terminal equipment is started normally.
In addition, when the control unit does not have the initializing identification, the electronic device loads the second image file in the system file, so that the control unit and the storage chip do not establish a bidirectional binding relation, the control unit does not write the authentication key into the storage chip, and the control unit does not set the initializing identification. Therefore, when the terminal equipment needs to be started, the control unit can read and run the system file of the operating system stored in the storage chip according to the relation of the electrical connection between the control unit and the storage chip, so that the terminal equipment is started normally.
Based on the foregoing description, in one particular embodiment, the following is assumed:
1. the terminal equipment is a mobile phone;
2. the electronic equipment is a PC;
3. the control unit is a CPU;
4. the PC acquires the fuse value of the register of the CPU in the mobile phone through the state acquisition instruction.
Based on the above assumption, as shown in fig. 10, the PC may execute the method for implementing terminal device startup provided in the present application:
and step 11, the PC sends a state acquisition instruction to the mobile phone.
And step 12, the PC receives the fuse value of the register of the CPU sent by the mobile phone.
The fuse value is sent after receiving the state acquisition instruction.
And step 13, the PC judges whether the CPU has an initialization mark according to the fuse value.
The initialization identifier is used for indicating that the CPU initializes the memory chip.
When the fuse value is greater than or equal to the threshold value, it is determined that the binding condition of the CPU is that the CPU initializes the memory chip, that is, the CPU has an initialization identifier, and the PC executes step 14.
When the fuse value is smaller than the threshold value, determining that the binding condition of the CPU is that the CPU does not initialize the memory chip, namely, the CPU does not have an initialization mark, and executing step 15 by the PC.
And 14, when the CPU has an initialization mark, the PC loads the image file 1 in the system file so as to enable the mobile phone to be started normally.
The image file 1 may refer to the description of the first image file in S102 in fig. 8, which is not described herein.
And 15, when the CPU does not have the initialization mark, the PC loads the image file 2 in the system file so as to enable the mobile phone to be started normally.
The image file 2 may refer to the description of the second image file in S102 in fig. 8, which is not described herein.
In summary, the PC may determine whether an initialization flag exists for the CPU in the handset. When the initialization mark exists in the CPU, the image file 1 is loaded in the system file, so that the CPU can conveniently write the authentication key into the RPMB in the memory chip, and the CPU sets the initialization mark in the register of the CPU, so that the CPU and the RPMB of the memory chip establish a bidirectional binding relationship. Therefore, when the mobile phone needs to be started, the CPU can read and run the system file of the operating system stored in the storage chip, and successfully access the RPMB of the storage chip according to the bi-directional binding relation between the control unit and the RPMB of the storage chip, so that the mobile phone is started normally.
In addition, when the CPU does not have an initialization mark, the PC loads the image file 2 in the system file, so that the CPU does not write an authentication key into the RPMB of the memory chip, and the CPU does not set the initialization mark to a register of the CPU, so that a bidirectional binding relation is not established between the CPU and the RPMB of the memory chip. Therefore, when the mobile phone needs to be started, the CPU can read and run the system file of the operating system stored in the storage chip according to the relation of the electric connection between the CPU and the storage chip, so that the mobile phone can be started normally.
Based on the foregoing description, in one particular embodiment, the following is assumed:
1. the terminal equipment is a mobile phone;
2. the electronic equipment is a PC;
3. the control unit is a CPU;
4. the PC acquires the fuse value of the register of the CPU in the mobile phone through the state acquisition instruction.
Based on the above assumption, the PC may execute the method for implementing terminal device startup provided in the present application:
step 21, the PC receives the system log sent by the mobile phone.
The system log records the running condition of the system file.
And 22, analyzing the system log by the PC, and acquiring the fuse value of a register in the CPU from the analyzed system log.
And step 23, the PC judges whether the CPU has an initialization mark according to the fuse value.
And step 24, when the CPU has an initialization mark, the PC loads the image file 1 in the system file so as to enable the mobile phone to be started normally.
And step 25, when the CPU does not have the initialization mark, the PC loads the image file 2 in the system file so as to enable the mobile phone to be started normally.
Step 23, step 24, and step 25 are similar to the implementation manners of step 13, step 14, and step 15 in the embodiment shown in fig. 11, respectively, and are not repeated herein.
The application also provides a device for realizing starting of the terminal equipment.
Next, a device for implementing starting of a terminal device according to an embodiment of the present application will be described in detail with reference to fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of an apparatus for implementing terminal device startup according to an embodiment of the present application.
As shown in fig. 11, the device 200 for implementing terminal device startup may exist independently, may also be integrated in other devices, may implement intercommunication with the above-mentioned electronic device, and is configured to implement operations corresponding to the electronic device in any of the above-mentioned method embodiments, where the device 200 for implementing terminal device startup in the present application may include: an acquisition module 201, and a loading module 202.
An obtaining module 201, configured to obtain a binding condition of a control unit in a terminal device, where the binding condition is used to indicate whether the control unit initializes a memory chip;
the loading module 202 is configured to load a first image file or a second image file in a system file of an operating system of the terminal device stored in a storage chip in the terminal device according to a binding condition of the control unit, so that the terminal device is started normally;
the first mirror image file is used for triggering the control unit to write an authentication key into a storage chip in the terminal equipment, and the triggering control unit sets an initialization identifier which is the same as the initialization identifier of a register in the control unit;
The second image file is used for writing an authentication key into a memory chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
In some embodiments, the loading module 202 is specifically configured to:
judging whether the control unit has an initialization identifier according to the binding condition of the control unit, wherein the initialization identifier is used for indicating the control unit to initialize the memory chip;
when the control unit has an initialization mark, loading a first mirror image file in a system file;
and when the control unit does not have the initialization mark, loading a second image file in the system file.
In some embodiments, the obtaining module 202 is specifically configured to:
receiving a system log sent by terminal equipment, wherein the system log records the running condition of a system file;
analyzing the system log, and acquiring a fuse value of a register in the control unit from the analyzed system log;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
In some embodiments, the obtaining module 201 is specifically configured to: comprising the following steps:
Sending a state acquisition instruction to terminal equipment;
receiving a fuse value of a register in a control unit sent by terminal equipment, wherein the fuse value is sent after receiving a state acquisition instruction;
when the fuse value is greater than or equal to the threshold value, determining the binding condition of the control unit as that the control unit initializes the memory chip;
and when the fuse value is smaller than the threshold value, determining the binding condition of the control unit as that the control unit does not initialize the memory chip.
In some embodiments, the loading module 202 is specifically configured to:
when the third image file does not exist in the system file, writing the first image file in the system file;
when a third image file exists in the system file, replacing the third image file with the first image file;
the third image file is used for triggering the control unit to write the authentication key into the memory chip in the terminal equipment, and triggering the control unit to set an initialization identifier, wherein the initialization identifier is different from the initialization identifier of the register in the control unit.
In some embodiments, the loading module 202 is specifically configured to:
writing a second image file into the system file when the fourth image file does not exist in the system file;
when a fourth image file exists in the system file, replacing the third image file with the second image file;
The fourth image file is used for writing an authentication key into a storage chip in the terminal equipment by the shielding control unit, and the shielding control unit sets an initialization identifier.
In some embodiments, the memory chip includes a replay protected memory block secure partition and a read-only partition;
the replay protection memory block secure partition is used for storing the authentication key; read-only partitioning is used to store system files.
Illustratively, the present application provides an electronic device comprising a processor; the computer code or instructions in the memory, when executed by the processor, cause the electronic device to perform the method of implementing terminal device booting in the previous embodiments.
Illustratively, the present application provides an electronic device comprising one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the method of enabling terminal device booting in the previous embodiments.
It will be appreciated that the electronic device, in order to achieve the above-described functions, includes corresponding hardware and/or software modules that perform the respective functions. The steps of an algorithm for each example described in connection with the embodiments disclosed herein may be embodied in hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation is not to be considered as outside the scope of this application.
The present embodiment may divide the functional modules of the electronic device according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules described above may be implemented in hardware. It should be noted that, in this embodiment, the division of the modules is schematic, only one logic function is divided, and another division manner may be implemented in actual implementation.
In the case of dividing each functional module by corresponding each function, the electronic device referred to in the above embodiment may further include: a receiving module, and a determining module. Wherein the receiving module, and the determining module, cooperate to support the electronic device to perform the steps described above, and/or other processes for the techniques described herein.
It should be noted that, all relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
The electronic device provided in this embodiment is configured to execute the method for implementing terminal device startup, so that the same effect as that of the implementing method can be achieved.
Illustratively, the present application provides a chip system, which includes a processor for calling and running a computer program from a memory, so that an electronic device mounted with the chip system performs the method for implementing terminal device booting in the foregoing embodiment.
The present application provides a computer readable storage medium having code or instructions stored therein, which when executed on an electronic device, cause the electronic device to perform the method for implementing terminal device booting in the foregoing embodiment.
Illustratively, the present application provides a computer program product for causing an electronic device to implement the method of enabling a terminal device to boot in the previous embodiments when the computer program product is run on a computer.
The electronic device, the computer readable storage medium, the computer program product, or the chip system provided in this embodiment are used to execute the corresponding method provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding method provided above, and will not be described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes. The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method for implementing starting of a terminal device, comprising:
acquiring a binding condition of a control unit in terminal equipment, wherein the binding condition is used for indicating whether the control unit initializes a memory chip or not;
when the binding condition of the control unit indicates that the control unit initializes a memory chip in the terminal equipment, loading a first image file in a system file of an operating system of the terminal equipment, which is stored by the memory chip in the terminal equipment, so that the terminal equipment is started normally;
when the binding condition of the control unit indicates that the control unit does not initialize a memory chip in the terminal equipment, loading a second image file in the system file so as to enable the terminal equipment to be started normally; the first mirror file is used for triggering the control unit to write an authentication key into a memory chip in the terminal equipment, and triggering the control unit to set an initialization identifier, wherein the initialization identifier is the same as an initialization identifier of a register in the control unit;
the second image file is used for shielding the control unit from writing an authentication key into a memory chip in the terminal equipment, and shielding the control unit from setting an initialization identifier.
2. The method according to claim 1, wherein after the obtaining of the binding situation of the control unit in the terminal device, the method further comprises:
judging whether the control unit has an initialization identifier according to the binding condition of the control unit;
when the binding condition of the control unit indicates that the control unit initializes a storage chip in the terminal device, loading a first image file in a system file of an operating system of the terminal device stored in the storage chip in the terminal device, including:
loading the first image file in the system file when the control unit has an initialization identifier;
and loading a second image file in the system file when the binding condition of the control unit indicates that the control unit does not initialize the memory chip in the terminal device, wherein the loading comprises the following steps:
and when the control unit does not have the initialization mark, loading the second image file in the system file.
3. The method according to claim 1 or 2, wherein the obtaining the binding situation of the control unit in the terminal device comprises:
Receiving a system log sent by the terminal equipment, wherein the system log records the running condition of the system file;
analyzing the system log, and acquiring a fuse value of a register in the control unit from the analyzed system log;
when the fuse value is greater than or equal to a threshold value, determining that the control unit has initialized a memory chip according to the binding condition of the control unit;
and when the fuse value is smaller than a threshold value, determining that the control unit is bound as the control unit does not initialize a memory chip.
4. The method according to claim 1 or 2, wherein the obtaining the binding situation of the control unit in the terminal device comprises:
sending a state acquisition instruction to the terminal equipment;
receiving a fuse value of a register in the control unit, which is sent by the terminal equipment, wherein the fuse value is sent after receiving the state acquisition instruction;
when the fuse value is greater than or equal to a threshold value, determining that the control unit has initialized a memory chip according to the binding condition of the control unit;
and when the fuse value is smaller than a threshold value, determining that the control unit is bound as the control unit does not initialize a memory chip.
5. The method according to any one of claims 1-4, wherein loading the first image file in the system file of the operating system of the terminal device stored in the storage chip includes:
writing the first image file in the system file when the third image file does not exist in the system file;
when a third image file exists in the system file, replacing the third image file with the first image file;
the third image file is used for triggering the control unit to write an authentication key into a storage chip in the terminal equipment and triggering the control unit to set an initialization identifier.
6. The method according to any one of claims 1-5, wherein loading the second image file in the system file of the operating system of the terminal device stored in the storage chip includes:
writing the second image file in the system file when the fourth image file does not exist in the system file;
when a fourth image file exists in the system file, replacing the fourth image file with the second image file;
The fourth image file is used for shielding the control unit from writing an authentication key into a memory chip in the terminal equipment, and shielding the control unit from setting an initialization identifier.
7. The method of any of claims 1-6, wherein the memory chip includes a replay protected memory block secure partition and a read-only partition;
the replay protection memory block secure partition is used for storing an authentication key; the read-only partition is used for storing the system file.
8. A terminal device start-up device, characterized in that it comprises means for executing the method of implementing a terminal device start-up according to any of claims 1-7.
9. An electronic device, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the method of implementing terminal device booting as claimed in any of claims 1-7.
10. A chip system comprising a processor for calling and running a computer program from a memory, such that an electronic device on which the chip system is installed performs the method of enabling terminal device booting according to any of claims 1-7.
11. A computer readable storage medium comprising a computer program, characterized in that the computer program, when run on an electronic device, causes the electronic device to perform the method of implementing terminal device booting according to any of claims 1-7.
CN202211461003.6A 2022-11-17 2022-11-17 Method for starting terminal equipment and electronic equipment Active CN116661875B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211461003.6A CN116661875B (en) 2022-11-17 2022-11-17 Method for starting terminal equipment and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211461003.6A CN116661875B (en) 2022-11-17 2022-11-17 Method for starting terminal equipment and electronic equipment

Publications (2)

Publication Number Publication Date
CN116661875A CN116661875A (en) 2023-08-29
CN116661875B true CN116661875B (en) 2024-04-05

Family

ID=87714150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211461003.6A Active CN116661875B (en) 2022-11-17 2022-11-17 Method for starting terminal equipment and electronic equipment

Country Status (1)

Country Link
CN (1) CN116661875B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469557A (en) * 1993-03-05 1995-11-21 Microchip Technology Incorporated Code protection in microcontroller with EEPROM fuses
CN101944072A (en) * 2010-09-01 2011-01-12 中兴通讯股份有限公司 Method and equipment for configuring starting mode of terminal equipment
CN108269605A (en) * 2016-12-30 2018-07-10 谷歌有限责任公司 Safety device status devices and method and life cycle management
CN114385251A (en) * 2021-12-17 2022-04-22 苏州浪潮智能科技有限公司 Operating system booting method, system, terminal and storage medium based on memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469557A (en) * 1993-03-05 1995-11-21 Microchip Technology Incorporated Code protection in microcontroller with EEPROM fuses
CN101944072A (en) * 2010-09-01 2011-01-12 中兴通讯股份有限公司 Method and equipment for configuring starting mode of terminal equipment
CN108269605A (en) * 2016-12-30 2018-07-10 谷歌有限责任公司 Safety device status devices and method and life cycle management
CN114385251A (en) * 2021-12-17 2022-04-22 苏州浪潮智能科技有限公司 Operating system booting method, system, terminal and storage medium based on memory

Also Published As

Publication number Publication date
CN116661875A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
WO2015031847A1 (en) Distributed dynamic memory management unit (mmu)-based secure inter-processor communication
KR102387657B1 (en) Method for connecting external device throught usb interface and electronic device therefor
US11379458B2 (en) Electronic device and data management method thereof
US11604656B2 (en) Method and apparatus for managing application
CN115879088A (en) Authority checking method and electronic equipment
CN116661875B (en) Method for starting terminal equipment and electronic equipment
CN116467015B (en) Mirror image generation method, system start verification method and related equipment
CN111381996B (en) Memory exception handling method and device
KR20190115377A (en) Electronic device for sharing a key of external electronic device and method for the same
CN117150478A (en) Trust root, chip and data verification method based on system on chip
KR102516940B1 (en) Electronic device for performing a booting and method of operating the same
US20210064770A1 (en) Electronic device for controlling access to device resource and operation method thereof
CN116661678B (en) Data dump method and electronic equipment
CN112534409A (en) Electronic device and operation method thereof
US20240015156A1 (en) Electronic device for controlling access to device resource and operation method thereof
CN116107411B (en) Starting-up method and related device
CN116049809B (en) Drive calling method and device
CN116257486A (en) Access request processing method and related equipment
CN117435141A (en) Memory activation method, electronic equipment and storage medium
CN115563628B (en) Variable reading and writing method and variable reading and writing device
CN116701238A (en) Drive file processing method and related device
CN117130825A (en) Method for preventing abnormal operation of electronic equipment and electronic equipment
CN116954708A (en) System mirror image data processing method, device, equipment and medium
CN117687963A (en) Log storage method and device for small system, electronic equipment and storage medium
CN116340910A (en) File access permission configuration method and electronic equipment

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