A trusted boot method of a dual-storage system

By separating the storage media and verifying them step by step in a dual-storage system, the problems of single point of failure, poor security isolation, and short flash memory life in existing secure boot schemes are solved, achieving higher system boot reliability and security.

CN123139271APending Publication Date: 2026-11-20GUANGDONG TELEPOWER TELECOM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610485525.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-14
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing secure boot solutions suffer from single-point-of-failure risks due to the use of a single storage medium, poor security isolation, short flash memory lifespan, and inability to update keys.

Method used

The trusted boot method employs a dual-storage system. By physically separating the boot code and system data and storing them on different media, the second-level boot program is verified using the chip's built-in read-only memory. During the first boot, a public key hash value is written to a one-time programmable storage area to verify the third-level boot program and the system kernel level by level. Finally, the system kernel verifies the root file system based on the device mapping verification mechanism.

Benefits of technology

It achieves physical isolation of multiple storage media, avoids the risk of single point of failure, extends flash memory life, improves the security and reliability of the system boot process, and supports key rotation and secure isolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123139271A_ABST
    Figure CN123139271A_ABST
Patent Text Reader

Abstract

The application provides a trusted starting method of a dual-storage system, which comprises that a chip built-in read-only memory loads and verifies a secondary boot program from a first storage medium, the secondary boot program writes a public key hash value into a one-time programmable storage area to solidify a trust root at the first start, loads and verifies a tertiary boot program from a second storage medium, the tertiary boot program loads and verifies a system kernel from a third storage medium, finally, the system kernel performs integrity check on a root file system in a fourth storage medium based on a device mapping check mechanism, and loads the checked root file system into a system memory to run. The application avoids the single point failure risk through the physical isolation of the multiple storage media, realizes the power failure safety and the flash memory life extension, and combines the tamper-proof characteristics of the one-time programmable storage area and the step-by-step signature verification mechanism, so that the safety and reliability of the system starting process are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a trusted boot method for a dual-storage system. Background Technology

[0002] Secure Boot is a widely adopted security mechanism designed to ensure the integrity and authenticity of components at each stage of the system startup process. This mechanism uses a public-private key system to sign and verify the code at each stage of the startup process, effectively preventing unauthorized code or malicious software from being executed during system startup. Specifically, the trust chain of Secure Boot begins with the root key stored in the one-time programmable memory (OTP or eFuse) embedded within the chip. The chip's built-in ROM code then verifies the signatures of subsequent boot programs (such as the primary boot program SPL and the secondary boot program U-Boot), ultimately completing the integrity verification of the operating system kernel and root file system.

[0003] In existing chain-based secure boot schemes, the implementation logic typically includes the following aspects: First, the hardware root of trust is embedded in the chip's OTP or eFuse, with the root public key or its hash value written at the factory, which cannot be changed subsequently; Second, asymmetric encryption algorithms (such as RSA-2048 or RSA-4096) are used to sign and verify the signatures of components at each level. During the signing process, the hash value of the component image is encrypted using a private key, and during verification, it is decrypted and compared using the public key embedded in the previous level component; Finally, a trust chain is formed from the ROM code to the operating system kernel, with a typical path being: Romcode → SPL → U-Boot → Kernel → Root File System. Failure of verification at any level will cause the boot process to terminate.

[0004] However, the existing secure boot solutions still have some shortcomings. Firstly, existing solutions typically store all boot components, including the bootloader, kernel, and root file system, in the same storage medium (such as eMMC). This single-storage-medium structure presents a significant single point of failure risk; if the medium is physically damaged, the entire system will fail to boot. Furthermore, since the boot code is not physically isolated from system data, an attacker who breaches this storage area can threaten the entire boot chain, resulting in poor security isolation. Secondly, in scenarios with frequent writes to the storage medium (especially TLC or QLC type flash memory), system updates or log recording operations accelerate the wear and tear of the storage medium, further impacting system reliability. Additionally, since system upgrades may involve operations on the boot partition, any upgrade anomalies or power outages can easily corrupt the boot code, rendering the device unusable. Moreover, in existing solutions, the root key, once written to OTP or eFuse, cannot be updated, making it difficult to support key rotation or replacement of expired keys, thus limiting the system's ability to evolve security over long-term operation. It is evident that while existing chain-based secure boot technology ensures the integrity of the boot process to a certain extent, its single storage medium and over-reliance on the same hardware root result in significant deficiencies in reliability, security, lifespan management, and maintainability. Summary of the Invention

[0005] In view of the above problems, the present invention is proposed to provide a trusted boot method for a dual-storage system that overcomes or at least partially solves the above problems.

[0006] This invention discloses a trusted boot method for a dual-storage system, the method comprising: In response to system power-on, the chip's built-in read-only memory loads and verifies the secondary boot program from the first storage medium; The secondary bootloader loads and verifies the tertiary bootloader from the second storage medium, and writes the public key hash value into the one-time programmable storage area of ​​the chip during the first boot, or verifies the signature of the tertiary bootloader using the public key already written into the one-time programmable storage area during non-first boots; The three-level bootloader loads and verifies the system kernel from the third storage medium; The system kernel performs integrity verification on the root file system stored in the fourth storage medium based on the device mapping verification mechanism, and loads the root file system that passes the verification into the system memory for operation; wherein, the first storage medium, the second storage medium, the third storage medium, and the fourth storage medium are physically independent storage devices.

[0007] Optionally, the chip's built-in read-only memory loads and verifies the secondary boot program from the first storage medium, including: Read the hash value of the public key used to verify the secondary bootloader, stored in the one-time programmable storage area; Read the secondary boot firmware from the first storage medium; Extract the public key from the read secondary bootloader firmware and calculate its hash value, then compare the calculated public key hash value with the public key hash value read from the one-time programmable storage area; If the comparison matches, the public key is used to decrypt the digital signature of the secondary bootstrap program, the hash value of the secondary bootstrap program is calculated, and the decrypted hash value of the secondary bootstrap program is compared with the calculated hash value of the secondary bootstrap program. If the comparison matches, the secondary bootloader is deemed to have passed verification and is executed.

[0008] Optionally, the secondary bootloader loads and verifies the tertiary bootloader from the second storage medium, and writes the public key hash value into the chip's one-time programmable storage area upon first boot, including: The secondary bootloader parses the device tree file it carries and extracts the public key hash value from it; Detect whether the extracted public key hash value has been burned into the one-time programmable storage area; If the detection result is that the key has not been burned, the extracted public key hash value will be written into the one-time programmable storage area.

[0009] Optionally, the third-level bootloader loads and verifies the system kernel from a third storage medium, including: Load and verify the security image, which is used to establish a hardware isolation environment between the secure world and the insecure world; The security image sequentially verifies and loads the trusted execution environment operating system and the kernel loading code of the three-level bootloader according to the chain trust transfer rule. The kernel loading code of the three-level bootloader scans and detects the access status of the third storage medium, and loads a kernel image file of a unified image format from the third storage medium; Verify the public key and signature of the kernel image file, and if the verification is successful, jump to the system kernel for execution.

[0010] Optionally, the kernel loading code of the third-level bootloader scans and detects the access status of the third storage medium, and loads a kernel image file of a unified image format from the third storage medium, including: The system periodically checks for the connection of a third storage medium. When a third storage medium is detected to be connected, the environment variables of the third storage medium are obtained, and the type and sequence number of the storage medium to be started are set according to the environment variables. Read the kernel image file in the specified partition of the third storage medium that is pre-set with a unified image format.

[0011] Optionally, the system kernel performs integrity verification on the root file system stored in the fourth storage medium based on a device mapping verification mechanism, and loads the verified root file system into system memory for execution, including: The system kernel parses and initializes the memory disk, and extracts the root hash value of the root file system from the initialized memory disk; Using a device mapping verification mechanism, the root file system partition in the fourth storage medium is verified block by block based on the root hash value, and a corresponding virtual block device is created. Mount the virtual block device to the designated mount point; The mounted root file system is copied entirely into system memory, and the system root directory is switched to the root file system in memory.

[0012] Optionally, a device mapping verification mechanism is used to perform block-by-block verification of the root file system partition in the fourth storage medium based on the root hash value, and a corresponding virtual block device is created, including: The root file system partition is divided into multiple data blocks according to a preset block size; Calculate the hash value for each data block to form a hash mapping table; The root hash value is compared with the root hash of the hash map table to verify the integrity of the hash map table. After the hash mapping table is verified, a virtual block device based on the device mapping verification mechanism is created, so that the virtual block device can verify the hash value of the accessed data block in real time during read and write access.

[0013] Optionally, the method further includes: When the read-only memory fails to verify the secondary bootloader, the secondary bootloader fails to verify the tertiary bootloader, the tertiary bootloader fails to verify the system kernel, or the system kernel fails to verify the root file system, the system automatically enters masked read-only memory mode and waits for an external host to download firmware through the debugging interface for recovery.

[0014] Optionally, the method further includes: Allocate a specified amount of storage space from the system memory, configure the storage space as a temporary file system format for storing log files and temporary files generated during system operation, and periodically save the log files to the data partition of the fourth storage medium.

[0015] Optionally, after the secondary bootloader writes the public key hash value into the chip's one-time programmable memory area during the first boot, it further includes: The secondary bootloader performs a circuit breaker operation on the one-time programmable storage area, making the public key hash value in the one-time programmable storage area unchangeable.

[0016] This invention has the following advantages: This invention constructs a chain-like verification mechanism based on a hardware root of trust by physically separating the boot code and system data and storing them on different media. Specifically, the chip's built-in read-only memory loads and verifies the secondary boot program from the first storage medium. Upon first boot, the secondary boot program writes the public key hash value into a one-time programmable storage area to solidify the root of trust and loads and verifies the tertiary boot program from the second storage medium. The tertiary boot program loads and verifies the system kernel from the third storage medium. Finally, the system kernel performs integrity verification on the root file system in the fourth storage medium based on a device mapping verification mechanism and loads the verified root file system into system memory for execution. This invention avoids single-point-of-failure risks through physical isolation of multiple storage media, achieving power-loss safety and extended flash memory lifespan. Combined with the immutability of the one-time programmable storage area and the step-by-step signature verification mechanism, it significantly improves the security and reliability of the system boot process. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the hardware configuration of the present invention; Figure 2 This is a flowchart of the overall trusted link verification process of the present invention; Figure 3 This is a flowchart of the Bootrom verification SPL process of the present invention; Figure 4 This is a flowchart of the signature firmware generation process of the present invention; Figure 5 This is a diagram showing the relationship between SD card partitions and DM hash values ​​according to the present invention; Figure 6 This is the DM-V verification flowchart of the present invention. Detailed Implementation

[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] 1. Reference Figure 1 The hardware configuration of this invention can be as follows: (1) The core components of the PCBA are a SoC controller paired with external DDR, SPI NOR and SD.

[0020] The SoC connects to the Spinor via a four-wire FSPI interface, connects to the DDR via an LPDDR5 interface, uses LPDDR5 chips for better performance, and connects to the SD card via an SDMMC interface.

[0021] DDR uses LPDDR5 chips with a capacity of 16GB, a 32-bit width, a maximum operating frequency of 3200MHz, and an actual speed of 6400Mbps.

[0022] The SPINOR has a minimum capacity of only 64Mbit, a clock frequency of 133MHz, and a four-wire read rate of up to 532Mbit / s.

[0023] The SD card uses SDR104 mode with a speed of up to 150MHz.

[0024] (2) External DDR is used for code execution and data interaction processing.

[0025] (3) SPI NOR is used as a boot system.

[0026] (4) SD is used as storage space for system firmware and user data.

[0027] The system is divided into three partitions: a boot partition, a rootfs partition, and a data partition. The boot partition is allocated 128MB, the rootfs partition 6144MB, and the remaining space is allocated to the data partition. Regular users have only read permissions, while administrator users have read, write, and execute permissions.

[0028] Chained trusted boot process BootRom → SPL (Secondary Bootloader) → U-Boot → Kernel → Root File System The SOC internally includes an OTP (One-Time Programmable) storage medium that can store one or two keys. The OTP can be programmed by the SPL and is an irreversible programming method with a circuit breaker mechanism. The RSA key is stored in u-boot.dtb, then packaged into the u-boot.bin binary file and simultaneously saved to the SPL. The SPL supports writing key hashes, so when the firmware is programmed at the factory, the SPL writes the RSA key to the OTP space during machine startup for verifying the signature of the first-level boot code, BootROM. The signing and encryption / decryption support SHA256, RSA2048 standards, and the pkcs-v2.1 (the official standard specification for RSA cryptography) padding scheme.

[0029] 2. Trusted link verification process, refer to Figure 2 (1) Bootrom-level verification like Figure 3 This is the process of Bootrom verifying the loader; the verification method for other firmware is similar.

[0030] A signed firmware includes Firmware (OBM Code) + Digital Signature + Public key Both the Digital Signature and the Public Key are added by the signing tool.

[0031] In terms of storage, the signed firmware is stored on various storage media, such as Flash and SD card, while the Public Key Hash is stored on the chip's OTP. (See reference...) Figure 4 The flowchart for generating signed firmware.

[0032] During startup, the public key in the firmware is verified by Hash in OTP, and then the digital signature is verified by the public key, thus achieving the effect of binding the chip with the signature code.

[0033] BootROM has built-in OTP read logic. First, it verifies the validity of the public key hash value stored in the OTP. Then, it reads the OBM Code sequentially from Nor Flash, Nand Flash, eMMC, and SD / MMC (if multiple storage media exist, they are selected in priority order). It calculates the SHA256 hash value of the OBM Code and compares it with the public key hash value stored in the OTP. If they don't match, the boot process aborts and enters MASKROM mode. If they match, it further uses the public key to decrypt the digital signature, decrypts it using RSA2048 to obtain the original hash value, and compares the decrypted hash value with the calculated hash value. If they don't match, the boot process aborts and enters MASKROM mode. If they match, the verification is successful, the OBM Code is loaded and executed, and the boot process continues. It obtains the ID BLOCK (containing DDR initialization code + SPL) from the flash media. It first uses the OTP public key hash value to verify if the ID_BLOCK can run. If it can run, it then undergoes multiple levels of conventional verification, involving magic number verification, version and length verification, hash verification, hardware parameter verification, and other dimensions. (See reference...) Figure 3 .

[0034] Entering Maskrom mode involves the DRAM not being initialized, relying on the chip's internal SRAM, limiting the size of a single firmware download (usually ≤4KB), responding only to low-level db commands, and waiting for the host to download the firmware via USB.

[0035] (2) SPL verifies uboot The public key hash value is stored in the u-boot-spl.dtb file. When packaged into the image and flashed for the first boot, the public key hash value is flashed into the OTP during the SPL stage. Once flashed, it cannot be changed. For subsequent boots, the public key hash value is calculated directly using the RSA-2048 / 4096 + SHA-256 verification algorithm during the SPL stage, and the uboot image signature is verified. If the verification passes, u-boot is loaded, and control is transferred to u-boot. If the verification fails, the boot process is aborted, and the image enters MASKROM mode.

[0036] (3) u-boot verifies kernel During this stage, the DDR reads the uboot firmware from the SPI FLASH, initializes the remaining critical DISPLAY / IO / UART / PMIC controllers, and loads and verifies the security image (BL31 / BL32 / BL33).

[0037] The process of loading and verifying the security image (BL31 / BL32 / BL33) during the U-Boot phase follows the ARM TrustedFirmware (ATF) secure boot specification.

[0038] SPL transfers control to BL31, and then BL31 initializes the secure world, that is, sets up the Secure Monitor (exception vector, register isolation). Enable ARM TrustZone hardware isolation mechanism.

[0039] BL31 refers to the EL3 Runtime Firmware, which is responsible for switching between Secure World and Non-Secure World. BL32 is typically an OP-TEE (Open Portable Trusted Execution Environment) used for loading Secure World. BL33 is the U-BOOT operating phase. BL31 verifies BL32 / BL33 using Chain of Trust (CoT) for step-by-step verification. 1) Parse the image header to obtain the hash value and signature. 2) Verify the signature using a pre-built public key certificate (fuse or embedded in firmware). 3) Calculate the mirror hash and compare it with the hash in the certificate. Finally, the system performs a cyclic scan to check for an inserted SD card, with a scan cycle of 100ms. During this scan, it continuously retrieves the u-boot's MMC device environment variables. If a match is found, the boot environment is set to the currently loaded MMC device type and sequence number. The SD card's boot partition uses a standard partition to store the fit image, instead of writing it into the binary image (which is invisible). This approach offers advantages such as greater transparency, security, and faster image updates. The load or ext2load command is used to read the fit image from the specified partition and path on the SD card. The format and header information of the kernel image on the SD card are then verified. If verification fails, a message indicating SD card loading failure is displayed, requiring the insertion of a working SD card. The boot process is then terminated and enters Maskrom mode. If verification succeeds, the process jumps to loading the kernel and setting the storage type environment variables.

[0040] (4) Kernel verifies rootfs, refer to Figure 5 First, load the kernel image (zImage / Image), then load the device tree dtb redirection, and finally load the ramdisk.

[0041] Kernel loading and function initialization During this stage, based on the contents of the DTB and the kernel driver, and by parsing the boot parameters passed by U-Boot, all SoC-related functions and peripheral functions are initialized.

[0042] ramdisk startup and verification section: ① Check if the SD card device is recognized, / dev / mmcblkN ② Based on the partitioning of the SD card, determine whether a rootfs partition exists. ③ If the above conditions are met, ④ DMV verification process, refer to Figure 6 1) Principles and Configuration a. System partitions are generally large, and calculating hash verification for the entire partition is time-consuming. To save boot time, the Device-Mapper feature needs to be enabled in the Kernel. The Kernel should be configured as follows: CONFIG_BLK_DEV_DM=y CONFIG_DM_CRYPT=y CONFIG_BLK_DEV_CRYPTOLOOP=y CONFIG_DM_VERITY=y b. The combination of Device-Mapper technology and Crypt enables rapid verification or encryption / decryption of large firmware files. c. After the target rootfs is built, veritysetup is used to calculate the system image to generate a Hash-Map and a Root-Hash. The Hash-Map is directly attached to the end of the system image, while the Root-Hash is packaged into the Ramdisk of boot.img.

[0043] 2) Verification process a. The Device-Mapper-Verity mechanism performs 4K segmentation on the verification firmware, calculates the hash of each 4K data slice, iterates through multiple layers, and generates a corresponding Hash-Map and Root-Hash. b. Root-Hash first verifies the Hash-Map to ensure its correctness, then creates and mounts the virtual partition using Device-Mapper-Verity. When using the partition, the kernel performs a separate hash check on the 4K partition where I / O is accessed in real time and compares it with the Hash-Map. If the check fails, an I / O error is returned, similar to a file system corruption issue.

[0044] ⑤ After the hash comparison is successful, allocate 4GB of RAM space and set it to tmpfs read-only format. Copy the rootfs partition from the SD card to the RAM space, and use the switch_root command to start / sbin / init in RAM to jump to the target system.

[0045] (5) The SD card is mounted to the system and used as the customer data space. For the read-only rootfs, the rootfs is mounted to the RAM space.

[0046] The present invention has the following technical effects: A. Operational stability Physical isolation: The system runs in RAM, and hot-swapping of SD cards / EMMC, power failure, and vibration have no effect.

[0047] Read-only rootfs: The root partition is not writable, so there is no risk of write amplification or file system corruption during system operation.

[0048] Power loss safety: Sudden power outages only result in the loss of volatile data, without damaging the file system. B. Extend flash memory lifespan SD card (TLC) lifespan ≈ 1000 full write / erase cycles → directly extends lifespan by 5~10 times.

[0049] Logs and temporary files will be moved to tmpfs, and logs will be saved to SD storage space periodically. C. Improve read and write speed DDR's sequential and random read / write speeds are tens of times faster than flash memory. D. Improve security Physical read-only: The system partition is in RAM, and external media can be physically locked and written protected.

[0050] Trusted Startup Chain: BootROM → SPI NOR (SPL / U-Boot) → Boot → RAM rootfs → Verify signature verification → Run.

[0051] No persistent malicious files: reboot restores the original image, minimizing the attack surface.

[0052] OTP serves as a hardware root of trust, enabling tamper-proof key storage.

[0053] The traditional boot.img is split into standard partitions (boot, rootfs, data, etc.), making the partition files more visual and secure, while also facilitating maintenance and upgrades.

[0054] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0055] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0056] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0057] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A trusted boot method for a dual-storage system, characterized in that, The method includes: In response to system power-on, the chip's built-in read-only memory loads and verifies the secondary boot program from the first storage medium; The secondary bootloader loads and verifies the tertiary bootloader from the second storage medium, and writes the public key hash value into the one-time programmable storage area of ​​the chip during the first boot, or verifies the signature of the tertiary bootloader using the public key already written into the one-time programmable storage area during non-first boots; The three-level bootloader loads and verifies the system kernel from the third storage medium; The system kernel performs integrity verification on the root file system stored in the fourth storage medium based on the device mapping verification mechanism, and loads the root file system that passes the verification into the system memory for operation; wherein, the first storage medium, the second storage medium, the third storage medium, and the fourth storage medium are physically independent storage devices.

2. The method according to claim 1, characterized in that, The chip's built-in read-only memory loads and verifies the secondary boot program from the first storage medium, including: Read the hash value of the public key used to verify the secondary bootloader, stored in the one-time programmable storage area; Read the secondary boot firmware from the first storage medium; Extract the public key from the read secondary bootloader firmware and calculate its hash value, then compare the calculated public key hash value with the public key hash value read from the one-time programmable storage area; If the comparison matches, the public key is used to decrypt the digital signature of the secondary bootstrap program, the hash value of the secondary bootstrap program is calculated, and the decrypted hash value of the secondary bootstrap program is compared with the calculated hash value of the secondary bootstrap program. If the comparison matches, the secondary bootloader is deemed to have passed verification and is executed.

3. The method according to claim 1, characterized in that, The secondary bootloader loads and verifies the tertiary bootloader from the second storage medium, and writes the public key hash value into the chip's one-time programmable storage area upon first boot, including: The secondary bootloader parses the device tree file it carries and extracts the public key hash value from it; Detect whether the extracted public key hash value has been burned into the one-time programmable storage area; If the detection result is that the key has not been burned, the extracted public key hash value will be written into the one-time programmable storage area.

4. The method according to claim 1, characterized in that, The third-level bootloader loads and verifies the system kernel from a third storage medium, including: Load and verify the security image, which is used to establish a hardware isolation environment between the secure world and the insecure world; The security image sequentially verifies and loads the trusted execution environment operating system and the kernel loading code of the three-level bootloader according to the chain trust transfer rule. The kernel loading code of the three-level bootloader scans and detects the access status of the third storage medium, and loads a kernel image file of a unified image format from the third storage medium; Verify the public key and signature of the kernel image file, and if the verification is successful, jump to the system kernel for execution.

5. The method according to claim 4, characterized in that, The kernel loading code of the third-level bootloader scans and detects the access status of the third storage medium, and loads a kernel image file of a unified image format from the third storage medium, including: The system periodically checks for the connection of a third storage medium. When a third storage medium is detected to be connected, the environment variables of the third storage medium are obtained, and the type and sequence number of the storage medium to be started are set according to the environment variables. Read the kernel image file in the specified partition of the third storage medium that is pre-set with a unified image format.

6. The method according to claim 1, characterized in that, The system kernel, based on a device mapping verification mechanism, performs integrity verification on the root file system stored in the fourth storage medium, and loads the verified root file system into system memory for execution, including: The system kernel parses and initializes the memory disk, and extracts the root hash value of the root file system from the initialized memory disk; Using a device mapping verification mechanism, the root file system partition in the fourth storage medium is verified block by block based on the root hash value, and a corresponding virtual block device is created. Mount the virtual block device to the designated mount point; The mounted root file system is copied entirely into system memory, and the system root directory is switched to the root file system in memory.

7. The method according to claim 6, characterized in that, Using a device mapping verification mechanism, the root file system partition in the fourth storage medium is verified block by block based on the root hash value, and a corresponding virtual block device is created, including: The root file system partition is divided into multiple data blocks according to a preset block size; Calculate the hash value for each data block to form a hash mapping table; The root hash value is compared with the root hash of the hash map table to verify the integrity of the hash map table. After the hash mapping table is verified, a virtual block device based on the device mapping verification mechanism is created, so that the virtual block device can verify the hash value of the accessed data block in real time during read and write access.

8. The method according to claim 1, characterized in that, The method further includes: When the read-only memory fails to verify the secondary bootloader, the secondary bootloader fails to verify the tertiary bootloader, the tertiary bootloader fails to verify the system kernel, or the system kernel fails to verify the root file system, the system automatically enters masked read-only memory mode and waits for an external host to download firmware through the debugging interface for recovery.

9. The method according to claim 1, characterized in that, The method further includes: Allocate a specified amount of storage space from the system memory, configure the storage space as a temporary file system format for storing log files and temporary files generated during system operation, and periodically save the log files to the data partition of the fourth storage medium.

10. The method according to claim 1, characterized in that, After the secondary bootloader writes the public key hash value into the chip's one-time programmable memory area during the first boot, it also includes: The secondary bootloader performs a circuit breaker operation on the one-time programmable storage area, making the public key hash value in the one-time programmable storage area unchangeable.