CN115878199A - Chip operating system startup method, device, equipment and storage medium - Google Patents
Chip operating system startup method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115878199A CN115878199A CN202211449451.4A CN202211449451A CN115878199A CN 115878199 A CN115878199 A CN 115878199A CN 202211449451 A CN202211449451 A CN 202211449451A CN 115878199 A CN115878199 A CN 115878199A
- Authority
- CN
- China
- Prior art keywords
- chip
- hash value
- startup program
- level storage
- public key
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Storage Device Security (AREA)
Abstract
Description
技术领域technical field
本申请涉及芯片技术领域,尤其涉及一种芯片的操作系统启动方法、装置、设备及存储介质。The present application relates to the field of chip technology, and in particular to a method, device, device and storage medium for starting an operating system of a chip.
背景技术Background technique
嵌入式的系统芯片通常是利用多级程序来启动芯片对应的操作系统,现有技术中在启动芯片对应的操作系统时,多级程序的第一级程序会从一种固定存储介质中下载后级的启动代码,如果下载的驱动设计有问题或因其它原因,无法正常下载后级的启动代码,则会出现芯片启动失败的情况,此外,如果有恶意第三方篡改了保存在固定存储介质的启动代码,若直接运行下载到启动代码,会给整个系统带来巨大的安全隐患。Embedded system chips usually use multi-level programs to start the operating system corresponding to the chip. In the prior art, when starting the operating system corresponding to the chip, the first-level program of the multi-level program will be downloaded from a fixed storage medium. If there is a problem with the downloaded driver design or due to other reasons, the startup code of the later stage cannot be downloaded normally, and the chip will fail to start. In addition, if a malicious third party tampers with the file stored in the fixed storage medium If the startup code is directly run and downloaded to the startup code, it will bring huge security risks to the entire system.
发明内容Contents of the invention
鉴于以上内容,本申请提供一种芯片的操作系统启动方法、装置、设备及存储介质,其目的在于解决现有技术中芯片启动可靠性、安全性及灵活性较低的技术问题。In view of the above, the present application provides a chip operating system startup method, device, equipment and storage medium, the purpose of which is to solve the technical problems of low chip startup reliability, security and flexibility in the prior art.
第一方面,本申请提供一种芯片的操作系统启动方法,该方法包括:In a first aspect, the present application provides a method for starting an operating system of a chip, the method comprising:
根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序;determining the sequence of downloading the startup program of the chip from the multi-level storage path according to the pre-configured voltage values of the pins of the chip;
从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,若在所述多级存储路径中任一级存储路径下载成功,则不再问询剩余所述顺序对应的多级存储路径;Download the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence, if in the multi-level storage path If any one-level storage path is downloaded successfully, the multi-level storage path corresponding to the remaining sequence will not be inquired again;
基于所述公钥及所述签名对所述启动程序进行验证,若验证通过,运行所述启动程序并启动所述芯片的操作系统。The startup program is verified based on the public key and the signature, and if the verification is passed, the startup program is run and the operating system of the chip is started.
第二方面,本申请提供一种芯片的操作系统启动装置,该芯片的操作系统启动装置包括:In a second aspect, the present application provides a device for starting an operating system of a chip, and the device for starting an operating system of the chip includes:
确定模块:用于根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序;Determination module: used to determine the order of downloading the startup program of the chip from the multi-level storage path according to the pre-configured voltage values of the pins of the chip;
下载模块:用于从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,若在所述多级存储路径中任一级存储路径下载成功,则不再问询剩余所述顺序对应的多级存储路径;Download module: used to download the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence, if in the If the download of any one of the multi-level storage paths is successful, the remaining multi-level storage paths corresponding to the sequence will not be inquired again;
启动模块:用于基于所述公钥及所述签名对所述启动程序进行验证,若验证通过,运行所述启动程序并启动所述芯片的操作系统。A startup module: used to verify the startup program based on the public key and the signature, and if the verification is passed, run the startup program and start the operating system of the chip.
第三方面,本申请提供一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
存储器,用于存放计算机程序;memory for storing computer programs;
处理器,用于执行存储器上所存放的程序时,实现第一方面任一项实施例所述的芯片的操作系统启动方法的步骤。The processor is configured to implement the steps of the chip operating system startup method described in any one embodiment of the first aspect when executing the program stored in the memory.
第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面任一项实施例所述的芯片的操作系统启动方法的步骤。In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for starting the operating system of a chip as described in any one embodiment of the first aspect is implemented. step.
本申请实施例提供的上述技术方案与现有技术相比具有如下优点:Compared with the prior art, the above-mentioned technical solutions provided by the embodiments of the present application have the following advantages:
本申请支持从多级存储路径下载启动程序来启动芯片对应的操作系统,只要多级存储路径中任意一级存储路径下载启动程序并启动成功,芯片便可正常工作,避免了现有技术中从一种存储介质中下载失败时就会导致芯片启动失败的情况,提高了芯片启动的可靠性。通过多级存储路径中下载的公钥和签名对下载的启动程序进行验证,当验证通过时才运行启动程序,避免下载的启动程序是恶意程序时仍运行启动程序,提高了系统的安全性。且由于芯片引脚不同的电压值,对应不同的下载芯片启动程序的顺序,因此通过根据预先配置的芯片的引脚的电压值,可以确定出从多级存储路径中下载芯片启动程序的顺序,使得启动程序的下载不局限于某一种存储路径,避免了现有技术中只能从固定的一种存储介质中下载芯片启动程序的情况,提高了芯片启动的灵活性。This application supports downloading the startup program from the multi-level storage path to start the operating system corresponding to the chip. As long as the startup program is downloaded from any one of the multi-level storage paths and the startup is successful, the chip can work normally, avoiding the problem of A situation in which the chip startup fails when the download in the storage medium fails, improves the reliability of the chip startup. The downloaded startup program is verified through the downloaded public key and signature in the multi-level storage path, and the startup program is run only when the verification is passed, so as to avoid running the startup program even when the downloaded startup program is a malicious program, thereby improving the security of the system. And because different voltage values of the chip pins correspond to different sequences of downloading the chip startup program, the order of downloading the chip startup program from the multi-level storage path can be determined according to the pre-configured voltage values of the chip pins, The download of the startup program is not limited to a certain storage path, avoiding the situation in the prior art that the chip startup program can only be downloaded from a fixed storage medium, and improving the flexibility of chip startup.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings without paying creative labor.
图1为本申请芯片的操作系统启动方法较佳实施例的流程图示意图;Fig. 1 is the schematic flow chart diagram of the preferred embodiment of the operating system startup method of the chip of the present application;
图2为本申请芯片的操作系统启动装置较佳实施例的模块示意图;Fig. 2 is the module schematic diagram of the preferred embodiment of the operating system starting device of the chip of the present application;
图3为本申请电子设备较佳实施例的示意图;FIG. 3 is a schematic diagram of a preferred embodiment of the electronic device of the present application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional features and advantages of the present application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions in this application involving "first", "second" and so on are for descriptive purposes only, and should not be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features . Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present application.
本申请提供一种芯片的操作系统启动方法。参照图1所示,为本申请芯片的操作系统启动方法的实施例的方法流程示意图。该方法可以由一个电子设备执行,该电子设备可以由软件和/或硬件实现。芯片的操作系统启动方法包括:The present application provides a method for starting an operating system of a chip. Referring to FIG. 1 , it is a schematic flow chart of an embodiment of a method for starting an operating system of a chip of the present application. The method can be executed by an electronic device, and the electronic device can be realized by software and/or hardware. The operating system startup method of the chip includes:
步骤S10:根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序;Step S10: According to the pre-configured voltage values of the pins of the chip, determine the order of downloading the startup program of the chip from the multi-level storage path;
步骤S20:用于从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,若在所述多级存储路径中任一级存储路径下载成功,则不再问询剩余所述顺序对应的多级存储路径;Step S20: Downloading the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence, if in the If the download of any one of the multi-level storage paths is successful, the remaining multi-level storage paths corresponding to the sequence will not be inquired again;
步骤S30:基于所述公钥及所述签名对所述启动程序进行验证,若验证通过,运行所述启动程序并启动所述芯片的操作系统。Step S30: Verifying the startup program based on the public key and the signature, and if the verification is passed, run the startup program and start the operating system of the chip.
芯片可以是嵌入式的系统级芯片(System on chip,SOC)系统级芯片芯片安装于电子设备中。嵌入式的系统芯片通常是利用多级程序来启动芯片对应的操作系统,例如,多级程序的顺序为Bootrom→Bootloader→OS kernel(操作系统内核),相对于第一级的程序,第二级的Bootloader通常保存在芯片外部的存储介质中,能够方便的对该程序进行烧录和修改。但为了防止芯片掉电以后数据丢失以及确保启动的安全性,通常会把第一级的代码程序固定在芯片内部的一个rom存储器内,这个存储器简称为Bootrom。Bootrom内的代码段固定以后再也无法修改。The chip may be an embedded system-on-chip (System on chip, SOC) chip installed in the electronic device. Embedded system chips usually use multi-level programs to start the operating system corresponding to the chip. For example, the sequence of multi-level programs is Bootrom→Bootloader→OS kernel (operating system kernel). Compared with the first-level program, the second-level The Bootloader is usually stored in the storage medium outside the chip, which can be easily programmed and modified. However, in order to prevent data loss after the chip is powered off and ensure boot security, the first-level code program is usually fixed in a rom memory inside the chip, which is called Bootrom for short. The code segment in the Bootrom cannot be modified after being fixed.
Bootrom内的代码主要的功能是从芯片的外部存储介质中下载后级启动程序来引导芯片启动,如果从外部存储介质中下载后级启动代码的过程中发生异常,会使得芯片启动失败,进而导致无法启动芯片对应的操作系统。若Bootrom代码仅是从一种固定的存储介质中下载后级的启动代码,例如,Bootrom代码根据嵌入式多媒体卡(Embedded MultiMedia Card,emmc)驱动程序从外部的嵌入式多媒体卡中下载后级启动程序Bootloader,若emmc驱动程序有问题导致无法正常下载,就会出现SOC启动失败的情况。The main function of the code in the Bootrom is to download the post-stage boot program from the external storage medium of the chip to boot the chip. The operating system corresponding to the chip cannot be started. If the Bootrom code is only to download the startup code of the back stage from a fixed storage medium, for example, the Bootrom code downloads the backstage startup from the external embedded multimedia card according to the embedded multimedia card (Embedded MultiMedia Card, emmc) driver Program Bootloader, if there is a problem with the emmc driver that cannot be downloaded normally, the SOC will fail to start.
本实施例通过从多级存储路径中下载芯片的启动程序,来进行芯片启动,其中,多级存储路径包括emmc存储器、nandflash存储器及sdcard存储器,只要芯片可以从任意一级存储路径下载成功并成功运行启动程序,芯片都可以正常工作,当所有的存储路径中均下载失败失败才返回错误信息error,从而提高芯片启动的可靠性。可以理解的是,多级存储路径是芯片外部的存储路径。In this embodiment, the chip is started by downloading the startup program of the chip from a multi-level storage path, wherein the multi-level storage path includes emmc memory, nandflash memory and sdcard memory, as long as the chip can be successfully downloaded from any level of storage path Run the startup program, the chip can work normally, and when all the storage paths fail to download, the error message error will be returned, thereby improving the reliability of the chip startup. It can be understood that the multi-level storage path is a storage path outside the chip.
具体地,预先为从多级存储路径中下载启动程序配置不同的顺序,配置芯片的引脚的电压值,使得下载启动程序的顺序与引脚的电压值对应,例如,配置第一种下载顺序为nandflash-emmc-sdcard,对应的引脚1和引脚2都是低电平,配置第二种下载顺序为emmc-nandflash-sdcard,对应的引脚1是低电平,引脚2是高电平,配置第三种下载顺序为sdcard-emmc-nandflash,对应的引脚1是低电平,引脚2是高电平。可以理解的是,若需要切换下载顺序可以通过修改外部的引脚电压来实现,例如,若需要将第一种下载顺序切换为第二种下载顺序,则将引脚2由低电平改成高电平。Specifically, different orders are pre-configured for downloading the startup program from the multi-level storage path, and the voltage values of the pins of the chip are configured so that the order of downloading the startup program corresponds to the voltage value of the pins. For example, the first download order is configured For nandflash-emmc-sdcard, the corresponding pin 1 and pin 2 are both low level, configure the second download sequence as emmc-nandflash-sdcard, the corresponding pin 1 is low level, and pin 2 is high level Level, configure the third download sequence as sdcard-emmc-nandflash, the corresponding pin 1 is low level, and pin 2 is high level. It can be understood that if it is necessary to switch the download sequence, it can be realized by modifying the external pin voltage. For example, if it is necessary to switch the first download sequence to the second download sequence, change pin 2 from low level to high level.
根据预先配置的芯片的引脚的电压值,确定出从多级存储路径中下载芯片的启动程序的顺序,从该顺序对应的多级存储路径下载启动程序、启动程序对应的签名及对启动程序的第一哈希值进行签名的公钥,例如,确定的下载顺序为emmc-nandflash-sdcard,则从该顺序对应的多级存储路径进行下载,其中,多级存储路径中每一级存储路径均存储有启动程序,且每一级存储路径均存储有启动程序对应的签名及公钥,启动程序对应的签名是指对启动程序的第一哈希值执行签名操作得到的签名,公钥是指对启动程序的第一哈希值进行签名的公钥。第一哈希值是指启动程序还未存储至多级存储路径之前,利用哈希算法对启动程序进行哈希计算得到的哈希值,哈希算法可以是MD5算法、SHA-1算法等,在此不做限定。According to the voltage value of the pre-configured pins of the chip, the sequence of downloading the startup program of the chip from the multi-level storage path is determined, and the startup program, the signature corresponding to the startup program, and the startup program are downloaded from the multi-level storage path corresponding to the sequence. For example, if the determined download sequence is emmc-nandflash-sdcard, download from the multi-level storage path corresponding to the sequence, wherein each level of storage path in the multi-level storage path The startup program is stored, and each level of storage path stores the signature and public key corresponding to the startup program. The signature corresponding to the startup program refers to the signature obtained by executing the signature operation on the first hash value of the startup program. The public key is Refers to the public key that signed the first hash of the launcher. The first hash value refers to the hash value obtained by using the hash algorithm to hash the startup program before the startup program is stored in the multi-level storage path. The hash algorithm can be MD5 algorithm, SHA-1 algorithm, etc., in This is not limited.
签名和公钥用于对启动程序的合法性进行验证(即验证下载到的启动程序有无被篡改),如果在多级存储路径中任一级存储路径下载成功,则不再问询下载顺序对应的其余存储路径,例如,下载顺序为emmc-nandflash-sdcard,若在emmc存储器下载成功,则不在问询nandflash存储器和sdcard存储器。The signature and public key are used to verify the legitimacy of the startup program (that is, to verify whether the downloaded startup program has been tampered with). If the download of any one of the multi-level storage paths is successful, the download order will not be asked again For other corresponding storage paths, for example, the download sequence is emmc-nandflash-sdcard. If the download is successful in the emmc storage, the nandflash storage and sdcard storage will not be inquired.
利用公钥及签名对下载的启动程序进行验证,例如,利用哈希算法计算出下载的启动程序的哈希值,利用公钥对签名进行解密,得到解密后的启动程序的哈希值,比较解密得到的哈希值与下载的启动程序的哈希值是否相同,若相同则验证通过,否则验证不通过。若下载的启动程序验证通过,说明启动程序没有被篡改,此时运行启动程序并启动芯片的操作系统。如果验证不通过,说明启动程序被恶意篡改,此时返回错误信息并退出芯片的启动流程。Use the public key and signature to verify the downloaded startup program, for example, use the hash algorithm to calculate the hash value of the downloaded startup program, use the public key to decrypt the signature, and obtain the hash value of the decrypted startup program, compare Whether the hash value obtained by decryption is the same as the hash value of the downloaded startup program, if they are the same, the verification is passed, otherwise the verification is not passed. If the downloaded startup program passes the verification, it means that the startup program has not been tampered with. At this time, run the startup program and start the operating system of the chip. If the verification fails, it means that the startup program has been maliciously tampered with. At this time, an error message is returned and the startup process of the chip is exited.
本申请支持从多级存储路径下载启动程序来启动芯片对应的操作系统,只要多级存储路径中任意一级存储路径下载启动程序并启动成功,芯片便可正常工作,避免了现有技术中从一种存储介质中下载失败时就会导致芯片启动失败的情况,提高了芯片启动的可靠性。提高了芯片启动的可靠性。通过多级存储路径中下载的公钥和签名对下载的启动程序进行验证,当验证通过时才运行启动程序,避免下载的启动程序是恶意程序时仍运行启动程序,提高了系统的安全性,且由于芯片引脚不同的电压值,对应不同的下载芯片启动程序的顺序,因此通过根据预先配置的芯片的引脚的电压值,可以确定出从多级存储路径中下载芯片启动程序的顺序,使得启动程序的下载不局限于某一种存储路径,避免了现有技术中只能固定的从一种存储介质中下载芯片启动程序的情况,提高了芯片启动的灵活性。This application supports downloading the startup program from the multi-level storage path to start the operating system corresponding to the chip. As long as the startup program is downloaded from any one of the multi-level storage paths and the startup is successful, the chip can work normally, avoiding the problem of A situation in which the chip startup fails when the download in the storage medium fails, improves the reliability of the chip startup. Improve the reliability of chip startup. The downloaded startup program is verified by the downloaded public key and signature in the multi-level storage path, and the startup program is run only when the verification is passed, so as to avoid running the startup program even when the downloaded startup program is a malicious program, which improves the security of the system. And because different voltage values of the chip pins correspond to different sequences of downloading the chip startup program, the order of downloading the chip startup program from the multi-level storage path can be determined according to the pre-configured voltage values of the chip pins, The downloading of the startup program is not limited to a certain storage path, avoiding the situation in the prior art that the chip startup program can only be downloaded fixedly from one storage medium, and improving the flexibility of chip startup.
在一个实施例中,在根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序之前,所述方法还包括:In one embodiment, before determining the order of downloading the startup program of the chip from the multi-level storage path according to the pre-configured voltage values of the pins of the chip, the method further includes:
计算所述启动程序的第一哈希值,利用预先生成的密钥对的私钥对所述第一哈希值执行签名操作,得到所述启动程序对应的签名;calculating a first hash value of the startup program, and performing a signature operation on the first hash value using a private key of a pre-generated key pair to obtain a signature corresponding to the startup program;
计算所述密钥对的公钥的初始哈希值,将所述公钥的初始哈希值存储至所述芯片内部存储空间;calculating an initial hash value of the public key of the key pair, and storing the initial hash value of the public key in the internal storage space of the chip;
分别将所述启动程序对应的签名、所述公钥及所述启动程序存储至所述芯片外部的多级存储路径中。The signature corresponding to the startup program, the public key and the startup program are respectively stored in a multi-level storage path outside the chip.
第一哈希值是指启动程序还未存储至多级存储路径之前,利用哈希算法对启动程序进行哈希计算得到的哈希值,密钥对的公钥和私钥可以是利用密钥生成工具生成的,利用私钥对第一哈希值执行签名操作,得到启动程序对应的签名,并计算公钥的初始哈希值,将公钥的初始哈希值存储至芯片内部存储空间中,公钥的初始哈希值用于对后续从多级存储路径中下载的公钥进行验证。之后分别将启动程序对应的签名、公钥及启动程序存储至芯片外部的多级存储路径中,由于多级存储路径中存储启动程序对应的签名和公钥,后续芯片下载启动程序时,可以利用签名和公钥对下载的启动程序进行验证,从而验证多级存储路径中的启动程序有无被恶意第三方篡改。The first hash value refers to the hash value obtained by using the hash algorithm to hash the startup program before the startup program is stored in the multi-level storage path. The public key and private key of the key pair can be generated using a key Generated by the tool, use the private key to perform a signature operation on the first hash value, obtain the signature corresponding to the startup program, calculate the initial hash value of the public key, and store the initial hash value of the public key in the internal storage space of the chip. The initial hash value of the public key is used to verify the public key subsequently downloaded from the multi-level storage path. After that, the signature, public key and startup program corresponding to the startup program are stored in the multi-level storage path outside the chip. Since the signature and public key corresponding to the startup program are stored in the multi-level storage path, when the subsequent chip downloads the startup program, it can use The signature and public key are used to verify the downloaded startup program, thereby verifying whether the startup program in the multi-level storage path has been tampered with by a malicious third party.
在一个实施例中,所述基于所述公钥及所述签名对所述启动程序进行验证,包括:In one embodiment, the verifying the startup program based on the public key and the signature includes:
计算所述公钥的当前哈希值,并获取预先存储在所述芯片内部存储空间的公钥的初始哈希值;calculating the current hash value of the public key, and obtaining the initial hash value of the public key pre-stored in the internal storage space of the chip;
验证所述当前哈希值与所述初始哈希值是否相同;Verifying whether the current hash value is the same as the initial hash value;
若是,基于所述公钥对所述签名进行解密得到所述启动程序的第一哈希值,并计算下载成功的启动程序的第二哈希值;If so, decrypt the signature based on the public key to obtain a first hash value of the boot program, and calculate a second hash value of the boot program that has been successfully downloaded;
验证所述第一哈希值与所述第二哈希值是否相同;verifying that the first hash value is the same as the second hash value;
若是,则验证通过。If yes, the verification is passed.
计算下载到的公钥的当前哈希值,并获取预先存储在芯片内部存储空间的公钥的初始哈希值,验证公钥的当前哈希值与公钥的初始哈希值是否相同,若相同,说明下载的公钥没有被篡改,因此可以用下载的公钥对签名进行解密,根据下载的公钥对签名进行解密得到启动程序的第一哈希值,并计算下载成功的启动程序的第二哈希值,第二哈希值是指下载到的启动程序的哈希值,如果启动程序的第二哈希值与启动程序的第一哈希值相同,说明下载到的启动程序未被篡改,因此启动程序验证通过。通过对公钥进行验证,当公钥验证通过后,在对公钥解密的启动程序进行验证,可以进一步确定启动程序有无被篡改,提高系统的安全性。Calculate the current hash value of the downloaded public key, and obtain the initial hash value of the public key pre-stored in the internal storage space of the chip, and verify whether the current hash value of the public key is the same as the initial hash value of the public key, if The same means that the downloaded public key has not been tampered with, so the downloaded public key can be used to decrypt the signature, and the first hash value of the startup program can be obtained by decrypting the signature according to the downloaded public key, and the hash value of the successfully downloaded startup program can be calculated. The second hash value, the second hash value refers to the hash value of the downloaded startup program, if the second hash value of the startup program is the same as the first hash value of the startup program, it means that the downloaded startup program is not has been tampered with, so the bootloader verification passes. By verifying the public key, after the verification of the public key is passed, verifying the startup program decrypted by the public key can further determine whether the startup program has been tampered with, thereby improving the security of the system.
进一步地,所述验证所述当前哈希值与所述初始哈希值是否相同,还包括:Further, the verifying whether the current hash value is the same as the initial hash value also includes:
若所述当前哈希值与所述初始哈希值不同,返回错误信息并退出所述芯片的启动流程。If the current hash value is different from the initial hash value, return an error message and exit the startup process of the chip.
如果下载到的公钥的当前哈希值与公钥的初始哈希值不同,说明公钥有被窜改,此时返回错误信息并退出芯片的启动流程,提高了系统的安全性。If the current hash value of the downloaded public key is different from the initial hash value of the public key, it means that the public key has been tampered with. At this time, an error message is returned and the startup process of the chip is exited, which improves the security of the system.
进一步地,所述验证所述第一哈希值与所述第二哈希值是否相同,还包括:Further, the verifying whether the first hash value is the same as the second hash value also includes:
若所述第一哈希值与所述第二哈希值不同,返回错误信息并退出所述芯片的启动流程。If the first hash value is different from the second hash value, return an error message and exit the startup process of the chip.
如果启动程序的第二哈希值与启动程序的第一哈希值不同,说明下载到的启动程序是被篡改过的,此时返回错误信息并退出芯片的启动流程。避免运行被恶意篡改的启动程序,提高系统的安全性。If the second hash value of the boot program is different from the first hash value of the boot program, it means that the downloaded boot program has been tampered with. At this time, an error message is returned and the boot process of the chip is exited. Avoid running maliciously tampered startup programs and improve system security.
在一个实施例中,根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序,包括:In one embodiment, according to the pre-configured voltage values of pins of the chip, the order of downloading the startup program of the chip from the multi-level storage path is determined, including:
根据所述芯片的引脚对应的寄存器,确定所述引脚的电压值;Determine the voltage value of the pin according to the register corresponding to the pin of the chip;
根据所述引脚的电压值确定从多级存储路径中下载所述启动程序的顺序。芯片内CPU读取引脚对应的寄存器来确定引脚的电压值,根据引脚的电压值可以确定从多级存储路径中下载启动程序的顺序。可以理解的是,芯片内部是通过控制不同寄存器的内容来控制引脚的电平,从而实现芯片传给外设一个指定的信号。The order of downloading the startup program from the multi-level storage path is determined according to the voltage value of the pin. The on-chip CPU reads the register corresponding to the pin to determine the voltage value of the pin, and the sequence of downloading the startup program from the multi-level storage path can be determined according to the voltage value of the pin. It can be understood that inside the chip, the level of the pin is controlled by controlling the contents of different registers, so that the chip can transmit a specified signal to the peripheral.
在一个实施例中,所述从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,包括:In one embodiment, the downloading the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence includes :
从所述多级存储路径的第一级存储路径下载所述启动程序、所述签名及所述公钥,并判断是否下载成功;Downloading the startup program, the signature, and the public key from the first-level storage path of the multi-level storage path, and judging whether the download is successful;
若否,从所述多级存储路径的第二级存储路径下载所述启动程序、所述签名及所述公钥,并判断是否下载成功;If not, download the startup program, the signature and the public key from the second-level storage path of the multi-level storage path, and determine whether the download is successful;
若否,从所述多级存储路径的第三级存储路径下载所述启动程序、所述签名及所述公钥。If not, download the startup program, the signature, and the public key from a third-level storage path of the multi-level storage path.
例如,若下载顺序为emmc-nandflash-sdcard,即第一级存储路径为emmc,第二级存储路径为nandflash,第三级存储路径为sdcard。从emmc下载启动程序、签名及公钥,并判断从emmc是否成功下载,若从第一级存储路径emmc下载失败,则从第二级存储路径nandflash下载,并判断从nandflash是否下载成功,若从第二级存储路径nandflash下载失败,则从第三级存储路径sdcard下载。可以从多级存储路径依次下载启动程序。For example, if the download sequence is emmc-nandflash-sdcard, that is, the first-level storage path is emmc, the second-level storage path is nandflash, and the third-level storage path is sdcard. Download the startup program, signature and public key from emmc, and judge whether the download from emmc is successful. If the download from the first-level storage path emmc fails, download from the second-level storage path nandflash, and judge whether the download from nandflash is successful. If the second-level storage path nandflash fails to download, it will download from the third-level storage path sdcard. The startup programs can be sequentially downloaded from the multi-level storage path.
进一步地,在从所述多级存储路径的第三级存储路径下载所述启动程序、所述签名及所述公钥之后,所述方法还包括:Further, after downloading the startup program, the signature and the public key from the third-level storage path of the multi-level storage path, the method further includes:
判断所述启动程序、所述签名及所述公钥是否均下载成功;Judging whether the startup program, the signature and the public key are downloaded successfully;
若否,返回错误信息。If not, return an error message.
在从多级存储路径的第三级存储路径执行下载之后,判断所述启动程序、所述签名及所述公钥是否从第三级存储路径sdcard中均下载成功,若下载失败,则返回错误信息,即当所有的存储路径中均下载失败时,才返回错误信息error。可以理解的是,当任意一级存储路径下载成功时,则根据公钥及签名对下载的启动程序进行验证,若验证通过,运行启动程序并启动芯片的操作系统。避免了现有技术中从一种存储介质中下载失败时就会导致芯片启动失败的情况,提高芯片启动的可靠性。After the download is performed from the third-level storage path of the multi-level storage path, it is judged whether the startup program, the signature and the public key are downloaded successfully from the third-level storage path sdcard, and if the download fails, an error is returned information, that is, when the download fails in all storage paths, the error message error is returned. It can be understood that when any one of the primary storage paths is successfully downloaded, the downloaded startup program is verified according to the public key and the signature, and if the verification is passed, the startup program is run and the operating system of the chip is started. This avoids the situation in the prior art that the failure to start the chip will be caused when the download from a storage medium fails, and improves the reliability of the chip start.
进一步地,所述运行所述启动程序并启动所述芯片的操作系统,包括:Further, the running the startup program and starting the operating system of the chip includes:
运行所述启动程序,判断所述启动程序是否运行成功;Running the startup program to determine whether the startup program runs successfully;
当判断所述启动程序运行成功时,运行所述操作系统对应的内核程序并启动所述芯片的操作系统;When it is judged that the startup program runs successfully, run the kernel program corresponding to the operating system and start the operating system of the chip;
当判断所述启动程序运行失败时,返回错误信息。When it is judged that the startup program fails to run, an error message is returned.
当下载的启动程序验证通过后,运行该启动程序并判断启动程序是否运行成功,当启动程序运行成功时,再运行操作系统对应的内核程序并启动芯片的操作系统,当启动程序运行失败时则返回错误信息。After the downloaded startup program is verified, run the startup program and judge whether the startup program runs successfully. When the startup program runs successfully, run the kernel program corresponding to the operating system and start the operating system of the chip. When the startup program fails to run, then Return an error message.
参照图2所示,为本申请芯片的操作系统启动装置100的功能模块示意图。Referring to FIG. 2 , it is a schematic diagram of functional modules of the operating system startup device 100 of the chip of the present application.
本申请所述芯片的操作系统启动装置100可以安装于电子设备中。根据实现的功能,所述芯片的操作系统启动装置100可以包括确定模块110、下载模块120及启动模块130。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The operating system starting device 100 for the chip described in this application can be installed in an electronic device. According to the realized functions, the chip operating system startup device 100 may include a determination module 110 , a download module 120 and a startup module 130 . The module described in this application can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of the electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
确定模块110:用于根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序;Determination module 110: used to determine the sequence of downloading the startup program of the chip from the multi-level storage path according to the pre-configured voltage value of the pin of the chip;
下载模块120:用于从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,若在所述多级存储路径中任一级存储路径下载成功,则不再问询剩余所述顺序对应的多级存储路径;Download module 120: used to download the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence. If any one of the multi-level storage paths is downloaded successfully, the remaining multi-level storage paths corresponding to the sequence will not be inquired again;
启动模块130:用于基于所述公钥及所述签名对所述启动程序进行验证,若验证通过,运行所述启动程序并启动所述芯片的操作系统。The startup module 130: used to verify the startup program based on the public key and the signature, and if the verification is passed, run the startup program and start the operating system of the chip.
在一个实施例中,所述基于所述公钥及所述签名对所述启动程序进行验证,包括:In one embodiment, the verifying the startup program based on the public key and the signature includes:
计算所述公钥的当前哈希值,并获取预先存储在所述芯片内部存储空间的公钥的初始哈希值;calculating the current hash value of the public key, and obtaining the initial hash value of the public key pre-stored in the internal storage space of the chip;
验证所述当前哈希值与所述初始哈希值是否相同;Verifying whether the current hash value is the same as the initial hash value;
若是,基于所述公钥对所述签名进行解密得到所述启动程序的第一哈希值,并计算下载成功的启动程序的第二哈希值;If so, decrypt the signature based on the public key to obtain a first hash value of the boot program, and calculate a second hash value of the boot program that has been successfully downloaded;
验证所述第一哈希值与所述第二哈希值是否相同;verifying that the first hash value is the same as the second hash value;
若是,则验证通过。If yes, the verification is passed.
在一个实施例中,确定模块还用于:In one embodiment, the determination module is also used for:
计算所述启动程序的第一哈希值,利用预先生成的密钥对的私钥对所述第一哈希值执行签名操作,得到所述启动程序对应的签名;calculating a first hash value of the startup program, and performing a signature operation on the first hash value using a private key of a pre-generated key pair to obtain a signature corresponding to the startup program;
计算所述密钥对的公钥的初始哈希值,将所述公钥的初始哈希值存储至所述芯片内部存储空间;calculating an initial hash value of the public key of the key pair, and storing the initial hash value of the public key in the internal storage space of the chip;
分别将所述启动程序对应的签名、所述公钥及所述启动程序存储至所述芯片外部的多级存储路径中。The signature corresponding to the startup program, the public key and the startup program are respectively stored in a multi-level storage path outside the chip.
在一个实施例中,所述从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,包括:In one embodiment, the downloading the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence includes :
从所述多级存储路径的第一级存储路径下载所述启动程序、所述签名及所述公钥,并判断是否下载成功;Downloading the startup program, the signature, and the public key from the first-level storage path of the multi-level storage path, and judging whether the download is successful;
若否,从所述多级存储路径的第二级存储路径下载所述启动程序、所述签名及所述公钥,并判断是否下载成功;If not, download the startup program, the signature and the public key from the second-level storage path of the multi-level storage path, and determine whether the download is successful;
若否,从所述多级存储路径的第三级存储路径下载所述启动程序、所述签名及所述公钥。If not, download the startup program, the signature, and the public key from a third-level storage path of the multi-level storage path.
在一个实施例中,所述验证所述当前哈希值与所述初始哈希值是否相同,还包括:In one embodiment, the verifying whether the current hash value is the same as the initial hash value further includes:
若所述当前哈希值与所述初始哈希值不同,返回错误信息并退出所述芯片的启动流程。If the current hash value is different from the initial hash value, return an error message and exit the startup process of the chip.
在一个实施例中,所述验证所述第一哈希值与所述第二哈希值是否相同,还包括:In one embodiment, the verifying whether the first hash value is the same as the second hash value further includes:
若所述第一哈希值与所述第二哈希值不同,返回错误信息并退出所述芯片的启动流程。If the first hash value is different from the second hash value, return an error message and exit the startup process of the chip.
在一个实施例中,所述多级存储路径包括emmc存储器、nandflash存储器及sdcard存储器。In one embodiment, the multi-level storage paths include emmc memory, nandflash memory and sdcard memory.
参照图3所示,为本申请电子设备1较佳实施例的示意图。Referring to FIG. 3 , it is a schematic diagram of a preferred embodiment of the electronic device 1 of the present application.
该电子设备1包括但不限于:存储器11、处理器12、显示器13及通信接口14。所述电子设备1可以通过通信接口14连接网络。其中,所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi、通话网络等无线或有线网络。The electronic device 1 includes but not limited to: a memory 11 , a processor 12 , a display 13 and a communication interface 14 . The electronic device 1 can be connected to the network through the communication interface 14 . Wherein, the network may be an enterprise intranet (Intranet), Internet (Internet), Global System of Mobile Communication (Global System of Mobile communication, GSM), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), 4G network , 5G network, Bluetooth (Bluetooth), Wi-Fi, call network and other wireless or wired networks.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器11可以是所述电子设备1的内部存储单元,例如该电子设备1的硬盘或内存。在另一些实施例中,所述存储器11也可以是所述电子设备1的外部存储设备,例如该电子设备1配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器11还可以既包括所述电子设备1的内部存储单元也包括其外部存储设备。本实施例中,存储器11通常用于存储安装于所述电子设备1的操作系统和各类计算机程序,例如芯片的操作系统启动程序10的程序代码等。此外,存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc. In some embodiments, the storage 11 may be an internal storage unit of the electronic device 1 , such as a hard disk or a memory of the electronic device 1 . In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in hard disk equipped with the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital ( Secure Digital (SD) card, flash memory card (Flash Card), etc. Certainly, the storage 11 may also include both an internal storage unit of the electronic device 1 and an external storage device thereof. In this embodiment, the memory 11 is generally used to store the operating system and various computer programs installed in the electronic device 1 , such as program codes of the operating system startup program 10 of the chip, and the like. In addition, the memory 11 can also be used to temporarily store various types of data that have been output or will be output.
处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述电子设备1的总体操作,例如执行数据交互或者通信相关的控制和处理等。本实施例中,所述处理器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行芯片的操作系统启动程序10的程序代码等。In some embodiments, the processor 12 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 12 is generally used to control the overall operation of the electronic device 1 , for example, perform data interaction or communication-related control and processing. In this embodiment, the processor 12 is configured to run program codes stored in the memory 11 or process data, such as program codes for running the operating system startup program 10 of the chip, and the like.
显示器13可以称为显示屏或显示单元。在一些实施例中显示器13可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-EmittingDiode,OLED)触摸器等。显示器13用于显示在电子设备1中处理的信息以及用于显示可视化的工作界面。The display 13 may be called a display screen or a display unit. In some embodiments, the display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (Organic Light-Emitting Diode, OLED) touch device, and the like. The display 13 is used for displaying information processed in the electronic device 1 and for displaying a visualized work interface.
通信接口14可选地可以包括标准的有线接口、无线接口(如WI-FI接口),该通信接口14通常用于在所述电子设备1与其它电子设备之间建立通信连接。The communication interface 14 may optionally include a standard wired interface or wireless interface (such as a WI-FI interface), and the communication interface 14 is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
图3仅示出了具有组件11-14以及芯片的操作系统启动程序10的电子设备1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Fig. 3 only shows the electronic device 1 with the components 11-14 and the operating system boot program 10 of the chip, but it should be understood that it is not required to implement all the components shown, and more or less can be implemented instead. components.
在上述实施例中,处理器12执行存储器11中存储的芯片的操作系统启动程序10时可以实现如下步骤:In the above-mentioned embodiment, when the processor 12 executes the operating system startup program 10 of the chip stored in the memory 11, the following steps can be implemented:
根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序;determining the sequence of downloading the startup program of the chip from the multi-level storage path according to the pre-configured voltage values of the pins of the chip;
从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,若在所述多级存储路径中任一级存储路径下载成功,则不再问询剩余所述顺序对应的多级存储路径;Download the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence, if in the multi-level storage path If any one-level storage path is downloaded successfully, the multi-level storage path corresponding to the remaining sequence will not be inquired again;
基于所述公钥及所述签名对所述启动程序进行验证,若验证通过,运行所述启动程序并启动所述芯片的操作系统。The startup program is verified based on the public key and the signature, and if the verification is passed, the startup program is run and the operating system of the chip is started.
所述存储设备可以为电子设备1的存储器11,也可以为与电子设备1通讯连接的其它存储设备。The storage device may be the memory 11 of the electronic device 1 , or other storage devices connected in communication with the electronic device 1 .
关于上述步骤的详细介绍,请参照上述图2关于芯片的操作系统启动装置100实施例的功能模块图以及图1关于芯片的操作系统启动方法实施例的流程图的说明。For the detailed introduction of the above steps, please refer to the above-mentioned description of the functional block diagram of the embodiment of the device 100 for starting the operating system of the chip in FIG. 2 and the description of the flowchart of the embodiment of the method for starting the operating system of the chip in FIG. 1 .
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性的,也可以是易失性的。该计算机可读存储介质可以是硬盘、多媒体卡、SD卡、闪存卡、SMC、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器等等中的任意一种或者几种的任意组合。所述计算机可读存储介质中包括存储数据区和存储程序区,存储程序区存储有芯片的操作系统启动程序10,所述芯片的操作系统启动程序10被处理器执行时实现如下操作:In addition, the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium can be hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD- ROM), USB memory, etc., or any combination of several. The computer-readable storage medium includes a data storage area and a program storage area, and the program storage area stores the operating system startup program 10 of the chip. When the operating system startup program 10 of the chip is executed by the processor, the following operations are realized:
根据预先配置的所述芯片的引脚的电压值,确定从多级存储路径中下载所述芯片的启动程序的顺序;determining the sequence of downloading the startup program of the chip from the multi-level storage path according to the pre-configured voltage values of the pins of the chip;
从所述顺序对应的多级存储路径下载所述启动程序、所述启动程序对应的签名及对所述启动程序的第一哈希值进行签名的公钥,若在所述多级存储路径中任一级存储路径下载成功,则不再问询剩余所述顺序对应的多级存储路径;Download the startup program, the signature corresponding to the startup program, and the public key for signing the first hash value of the startup program from the multi-level storage path corresponding to the sequence, if in the multi-level storage path If any one-level storage path is downloaded successfully, the multi-level storage path corresponding to the remaining sequence will not be inquired again;
基于所述公钥及所述签名对所述启动程序进行验证,若验证通过,运行所述启动程序并启动所述芯片的操作系统。The startup program is verified based on the public key and the signature, and if the verification is passed, the startup program is run and the operating system of the chip is started.
本申请之计算机可读存储介质的具体实施方式与上述芯片的操作系统启动方法的具体实施方式大致相同,在此不再赘述。The specific implementation of the computer-readable storage medium of the present application is substantially the same as the specific implementation of the method for starting the operating system of the above-mentioned chip, and will not be repeated here.
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the serial numbers of the above embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. And herein the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, apparatus, article or method comprising a set of elements includes not only those elements, but also includes the elements not expressly included. other elements listed, or also include elements inherent in the process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional same elements in the process, apparatus, article or method comprising the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件仿真平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,电子装置,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware simulation platform, and of course also by hardware, but in many cases the former is more best implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium as described above (such as ROM/RAM , magnetic disk, optical disk), including several instructions to enable a terminal device (which may be a mobile phone, a computer, an electronic device, or a network device, etc.) to execute the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structures or equivalent process transformations made by using the description of the application and the accompanying drawings are directly or indirectly used in other related technical fields. , are all included in the patent protection scope of the present application in the same way.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211449451.4A CN115878199A (en) | 2022-11-18 | 2022-11-18 | Chip operating system startup method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211449451.4A CN115878199A (en) | 2022-11-18 | 2022-11-18 | Chip operating system startup method, device, equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115878199A true CN115878199A (en) | 2023-03-31 |
Family
ID=85760289
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211449451.4A Pending CN115878199A (en) | 2022-11-18 | 2022-11-18 | Chip operating system startup method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115878199A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117193863A (en) * | 2023-09-08 | 2023-12-08 | 上海合芯数字科技有限公司 | Host boot program startup method, device, system and processor |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104182242A (en) * | 2013-05-28 | 2014-12-03 | 华为技术有限公司 | System booting method and system booting device |
| CN113485764A (en) * | 2021-07-05 | 2021-10-08 | 珠海格力电器股份有限公司 | Embedded system, control method and device thereof and storage medium |
| CN113986383A (en) * | 2021-10-28 | 2022-01-28 | 山东云海国创云计算装备产业创新中心有限公司 | A kind of boot loader startup method and related device |
| CN114625432A (en) * | 2022-03-11 | 2022-06-14 | 深圳市豪恩汽车电子装备股份有限公司 | SOC chip circuit and SOC chip starting path control method |
-
2022
- 2022-11-18 CN CN202211449451.4A patent/CN115878199A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104182242A (en) * | 2013-05-28 | 2014-12-03 | 华为技术有限公司 | System booting method and system booting device |
| CN113485764A (en) * | 2021-07-05 | 2021-10-08 | 珠海格力电器股份有限公司 | Embedded system, control method and device thereof and storage medium |
| CN113986383A (en) * | 2021-10-28 | 2022-01-28 | 山东云海国创云计算装备产业创新中心有限公司 | A kind of boot loader startup method and related device |
| CN114625432A (en) * | 2022-03-11 | 2022-06-14 | 深圳市豪恩汽车电子装备股份有限公司 | SOC chip circuit and SOC chip starting path control method |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117193863A (en) * | 2023-09-08 | 2023-12-08 | 上海合芯数字科技有限公司 | Host boot program startup method, device, system and processor |
| CN117193863B (en) * | 2023-09-08 | 2024-05-24 | 上海合芯数字科技有限公司 | Method, device, system and processor for starting host bootstrap program |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111984962B (en) | Firmware security verification method and device | |
| EP3851989B1 (en) | Electronic device for updating firmware based on user authentication and an operating method thereof | |
| CN106452783B (en) | Computer system and method for secure execution | |
| CN103329095B (en) | Authenticate a hypervisor with encoded information | |
| CN103914658B (en) | Safe starting method of terminal equipment, and terminal equipment | |
| CN103729597B (en) | System starts method of calibration, system starts calibration equipment and terminal | |
| US9881162B2 (en) | System and method for auto-enrolling option ROMS in a UEFI secure boot database | |
| TWI534610B (en) | Method, medium and computing device for secure option rom control | |
| CN106104561B (en) | Method and apparatus for allowing use of test keys for BIOS installation | |
| TW201516733A (en) | System and method for verifying changes to UEFI authenticated variables | |
| CN110874467B (en) | Information processing method, device, system, processor, and storage medium | |
| JP2015022521A (en) | Secure boot method, built-in apparatus, secure boot device and secure boot program | |
| CN112685338B (en) | Semiconductor device including secure patchable ROM and patching method thereof | |
| CN115329321B (en) | A firmware boot method, chip, and computing device | |
| KR20230082388A (en) | Apparatus for verifying bootloader of ecu and method thereof | |
| CN114995894A (en) | Starting control method of operating system, terminal equipment and readable storage medium | |
| CN110020528A (en) | A kind of BMC starting method, apparatus and electronic equipment and storage medium | |
| CN115878199A (en) | Chip operating system startup method, device, equipment and storage medium | |
| CN106569907B (en) | A system startup file checking and compiling method | |
| CN116776317A (en) | System validity verification method and device and electronic equipment | |
| CN114721693B (en) | Microprocessor, BIOS firmware updating method, computer equipment and storage medium | |
| CN112861137A (en) | Secure firmware | |
| CN114091023A (en) | Executable file checking method, device, equipment and storage medium | |
| CN114143197A (en) | OTA (over the air) upgrading method, device and equipment of Internet of things equipment and readable storage medium | |
| CN112631629A (en) | Control method, system, computer device and storage medium for offline package version |
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 |