Heterogeneous embedded platform bare computer program running method based on equipment information bootstrap
By building a heterogeneous device information bootstrapping mechanism in an embedded bare-metal environment, the problem of poor compatibility of bare-metal programs on heterogeneous platforms is solved, automatic hardware platform adaptation and security verification are realized, improving operating efficiency and compatibility, and reducing development costs and migration cycle.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-01
AI Technical Summary
Bare-metal programs have poor compatibility on heterogeneous embedded platforms, resulting in high development costs, long migration cycles, and a lack of effective hardware device self-identification mechanisms and security verification, leading to low operating efficiency.
By constructing an adaptive dynamic loading mechanism for heterogeneous device information bootstrapping, identification verification, and drivers in an embedded bare-metal environment without operating system and file system support, the mechanism utilizes hardware device information bootstrapping to achieve automatic adaptation and driver loading of heterogeneous hardware platforms. This includes pre-setting hardware device bootstrapping information, bootstrapping information verification, and fingerprint information generation, ensuring the reliability and security of driver loading.
It enables automatic adaptation of bare-metal programs to heterogeneous hardware platforms, shortens the iteration cycle, improves cross-platform compatibility and security, reduces resource consumption, and meets the requirements of high-performance and low-power embedded environments.
Smart Images

Figure CN121957697A_ABST
Abstract
Description
A method for executing bare-metal programs on heterogeneous embedded platforms based on device information bootstrapping. Technical Field
[0001] This invention belongs to the technical field of embedded computers, and particularly relates to a method for running bare-metal programs on heterogeneous embedded platforms based on device information bootstrapping. Background Technology
[0002] In the field of embedded program development, traditional bare-metal programs typically use static binding to couple with specific hardware platforms. This results in poor compatibility of bare-metal programs on heterogeneous hardware platforms, requiring extensive code refactoring and driver adaptation during migration. This development model significantly increases development costs and product iteration cycles in the face of increasingly diverse hardware platforms.
[0003] In existing technologies, the "plug-and-play" functionality for cross-vendor devices mainly relies on the hardware abstraction layer provided by the operating system or on dynamic library loading based on the file system. However, in resource-constrained embedded bare-metal environments, dynamic library loading and reliance on the hardware abstraction layer provided by the operating system are difficult to implement due to excessive memory consumption and processing overhead. Specifically, in bare-metal environments, there is a lack of effective hardware device self-identification mechanisms, which prevents bare-metal programs from dynamically adapting to hardware devices from different manufacturers. Furthermore, there is a lack of verification, and the driver loading process requires a security verification mechanism to avoid system stability risks caused by hardware information tampering. The development model requires developing an adapter program separately for each hardware platform, resulting in redundant development, resource waste, and extended development cycles.
[0004] Overall, bare-metal programs have low computation or running efficiency on heterogeneous embedded platforms.
[0005] In view of this, the present invention is hereby proposed. Summary of the Invention
[0006] This invention provides a method for running bare-metal programs on heterogeneous embedded platforms based on device information bootstrapping, solving the technical problem of low computational or operational efficiency of bare-metal programs on heterogeneous embedded platforms in existing methods. The technical solution of this invention has many beneficial effects, as described below: A method for running bare-metal programs on heterogeneous embedded platforms based on device information bootstrapping, comprising: Step 1: The developer of the bare-metal program presets hardware device bootstrapping information content and write address. Presetting the hardware device bootstrapping information content and write address allows the developer of the heterogeneous hardware platform to provide the bare-metal program with compatible local device information; Step 2: Developers of multiple heterogeneous hardware platforms load the bare-metal program through their respective first-stage bootstrap programs. The first-stage bootstrap program is used to complete the CPU initialization and PL logic and bare-metal program loading after the heterogeneous hardware platform is powered on; each heterogeneous hardware platform's first-stage bootstrap program needs to complete device information bootstrapping before the bare-metal program is loaded; the completion of bootstrapping provides the bare-metal program with a way to identify the currently running heterogeneous hardware platform; Step 3: At the start of execution, the bare-metal program boots the device information from the preset hardware device bootstrap information... Step 4: The bare-metal program verifies the bootstrap information of the heterogeneous platform, calculates the checksum, and compares it with the checksum field of the bootstrap information. Based on the comparison result, it generates fingerprint information of the heterogeneous hardware platform. If the checksum matches, the bare-metal program parses and extracts the vendor identifier and version number of the bootstrap information, and generates fingerprint information of the heterogeneous hardware platform based on the vendor identifier and version number. The fingerprint information is used to identify the uniqueness of the heterogeneous hardware platform and its version, enabling the bare-metal program to match the driver code of the heterogeneous platform based on the fingerprint information. If the checksum does not match, it reports a verification failure and exits the bare-metal program. Step 5: The bare-metal program matches the driver code of the heterogeneous platform based on the fingerprint information and executes the driver code to complete the initialization sequence of the current heterogeneous platform. Step 6: After the bare-metal program completes driver loading and hardware initialization, it continues to execute the functional logic of the bare-metal program.
[0007] Compared with existing technologies, the technical solution provided by this invention has the following beneficial effects: By constructing an adaptive dynamic loading mechanism for heterogeneous device information bootstrapping, identification verification, and drivers in an embedded bare-metal environment without operating system and file system support, such as enabling bare-metal programs to identify hardware devices from different manufacturers through hardware device information bootstrapping; ensuring the reliability and security of driver loading through the bootstrap information verification mechanism; and solving the cost problem caused by developing different bare-metal programs for heterogeneous hardware platforms through the method of dynamically loading drivers based on hardware device bootstrap information, greatly shortening the product iteration cycle, and achieving automatic adaptation of bare-metal programs to heterogeneous hardware platforms produced by different manufacturers and rapid deployment of bare-metal programs on heterogeneous hardware platforms. Specifically... The benefits are as follows: In a bare-metal environment without an operating system and file system, dynamic driver loading is achieved through a hardware information bootstrapping mechanism, breaking through the limitations of static binding between hardware platforms and bare-metal programs in traditional cases. This solves the software adaptation problem of heterogeneous hardware platforms and improves the cross-platform compatibility of embedded systems. A lightweight driver loader is designed that does not require loading an operating system and file system. While ensuring real-time performance and resource utilization, it achieves dynamic binding of cross-platform drivers, effectively reducing hardware resource consumption and meeting the high-performance and low-power requirements of bare-metal programs in embedded environments. Through automatic collection and verification technology of device bootstrapping information, the integrity and reliability of hardware information are ensured, providing a reliable foundation for driver loading in a bare-metal environment and improving the security of program operation. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 is a flowchart of the method of the present invention; Figure 2 is a schematic diagram of the working principle of the present invention. Detailed Implementation
[0010] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0011] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this invention, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0012] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0013] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that aspects can be practiced without these specific details. To enable those skilled in the art to better understand the invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of that feature. In the description of the invention, unless otherwise stated, "a plurality of" means two or more.
[0014] As shown in Figures 1 and 2, the method for running a bare-metal program on a heterogeneous embedded platform based on device information bootstrapping constructs an adaptive dynamic loading mechanism for heterogeneous device information bootstrapping, identification verification, and drivers in an embedded bare-metal environment without operating system and file system support. This enables the bare-metal program to automatically adapt to heterogeneous hardware platforms from different manufacturers. The method includes: Step 1: The bare-metal program developer presets the hardware device bootstrapping information content and write address. Presetting the hardware device bootstrapping information content and write address allows the heterogeneous hardware platform developer to provide the bare-metal program with compatible... Local device information (such as vendor ID, version number, checksum, etc.), that is, the bare-metal program developer and the developers of multiple heterogeneous hardware platforms pre-define the hardware device bootstrap information content and write address. For example, for three heterogeneous hardware platforms based on the ZYNQ7020 chip from different manufacturers, the agreed-upon device bootstrap information structure content is {vendor ID, version number, checksum}, and the agreed-upon device bootstrap information is written to the available memory address 0x2000_0000, or to the agreed-upon address 0x7F_0000 of the non-volatile flash memory device. The length is the number of bytes occupied by the structure; Step 2: Developers of multiple heterogeneous hardware platforms load the bare-metal program through their respective first-stage bootloaders. The first-stage bootloader is used to complete the CPU initialization and PL logic and bare-metal program loading after the heterogeneous hardware platform is powered on; The first-stage bootloader of each heterogeneous hardware platform needs to complete the bootstrapping of device information before loading the bare-metal program. For example, the bootstrapping information structure of a running embedded heterogeneous platform is written to the agreed memory address 00x2000_0000 or non-volatile memory address 0x7F_0000. The device bootstrapping information structure, for example, vendor ID: 0x01, version number: 0x02, checksum: 0x03, provides a way for the bare-metal program to identify the currently running heterogeneous hardware platform through the completion of the bootstrapping; Step 3: When the bare-metal program starts running, it writes the preset hardware device bootstrapping information to the... The address reads device information of the heterogeneous platform. For example, it reads the bootstrap information structure from the preset memory address 0x2000_0000 or the non-volatile memory address 0x7F_0000 to identify the heterogeneous platform information currently being run by the program. Step 4: The bare-metal program verifies the bootstrap information content of the heterogeneous platform, calculates the "checksum" and compares it with the "checksum" field of the bootstrap information. Based on the comparison result, it generates fingerprint information of the heterogeneous hardware platform. Specifically, if the checksum matches, the bare-metal program parses and extracts the vendor identifier 0x01 and version number 0x02 of the bootstrap information, and generates fingerprint information of the heterogeneous hardware platform based on the vendor identifier 0x01 and version number 0x02. The fingerprint information is used to identify the uniqueness of the heterogeneous hardware platform and its version, enabling the bare-metal program to match the driver code of the heterogeneous platform based on the fingerprint information. If the checksum does not match, it reports a verification failure and exits the bare-metal program.
[0015] In a bare-metal environment without an operating system / file system and where dynamic linking is not possible, automatic collection of device information is achieved. The integrity and reliability of hardware information are ensured through device information verification. While ensuring system real-time performance and resource utilization, the software adaptation and standardization challenges of heterogeneous hardware platforms are effectively solved.
[0016] Step 5: The bare-metal program matches the driver code of the heterogeneous platform based on the fingerprint information, executes the driver code to complete the initialization sequence of the current heterogeneous platform, for example, loads the driver module corresponding to the vendor identifier 0x01 and version number 0x02 from the preloaded driver code, and calls the corresponding driver to complete the initialization sequence of the current heterogeneous platform; Step 6: After the bare-metal program completes driver loading and hardware initialization, it continues to execute the functional logic of the bare-metal program.
[0017] This method breaks through the traditional limitations of bare-metal programs being tied to specific hardware, enabling plug-and-play functionality across different vendors' devices. By bootstrapping hardware device information, the bare-metal program can identify hardware devices from different vendors; a bootstrap information verification mechanism ensures the reliability and security of driver loading; and by dynamically loading drivers based on hardware device bootstrap information, the method addresses the cost issues associated with developing different bare-metal programs for heterogeneous hardware platforms, significantly shortening product iteration cycles. This method is applicable to bare-metal program usage scenarios in embedded environments with diverse hardware platforms and limited resources. It enables rapid deployment of bare-metal programs on heterogeneous hardware platforms, automatic collection and verification of device information on heterogeneous platforms in bare-metal environments without operating systems / file systems, and the creation of a lightweight driver loader. It achieves dynamic binding of drivers across heterogeneous platforms. Furthermore, in bare-metal environments without operating systems / file systems where dynamic linking is not possible, this method achieves automatic collection of device information, ensures the integrity and reliability of hardware information through device information verification, and designs a lightweight driver loader to achieve cross-platform dynamic driver binding. While ensuring system real-time performance and resource utilization, it solves the software adaptation and standardization challenges of heterogeneous hardware platforms, providing technical support for the rapid deployment and cross-platform migration of embedded bare-metal programs.
[0018] The product provided by this invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the invention claims.
Claims
1. A method for running bare-metal programs on a heterogeneous embedded platform based on device information bootstrapping, characterized in that, The method for running bare-metal programs on heterogeneous embedded platforms The process includes the following steps: Step 1: The bare-metal program developer presets the hardware device bootstrap information and write address. This preset information is used by developers of heterogeneous hardware platforms to provide the bare-metal program with compatible local device information. Step 2: Developers of multiple heterogeneous hardware platforms load the bare-metal program through their respective first-stage bootloaders. These first-stage bootloaders are used to complete the CPU initialization and PL logic loading, as well as the loading of the bare-metal program, after the heterogeneous hardware platform is powered on. Each heterogeneous hardware platform's first-stage bootloader must complete the device information bootstrap before the bare-metal program is loaded. The bootstrapping process provides a way for bare-metal programs to identify the currently running heterogeneous hardware platform. Step 3: When the bare-metal program starts running, it reads the device information of the heterogeneous platform from the preset hardware device bootstrap information write address to identify the heterogeneous platform information on which the current program is running; Step 4: The bare-metal program verifies the bootstrap information of the heterogeneous platform, calculates the checksum, compares it with the checksum field of the bootstrap information, and generates the fingerprint information of the heterogeneous hardware platform based on the comparison result. If the checksum matches, the bare-metal program parses and extracts the vendor identifier and version number of the bootstrap information, and generates fingerprint information of the heterogeneous hardware platform based on the vendor identifier and version number. The fingerprint information is used to identify the uniqueness of the heterogeneous hardware platform and its version, so that the bare-metal program can match the driver code of the heterogeneous platform based on the fingerprint information. If the checksum is inconsistent, a checksum failure is reported and the bare-metal program exits; Step 5: The bare-metal program matches the driver code of the heterogeneous platform based on the fingerprint information and executes the driver code to complete the initialization sequence of the current heterogeneous platform; Step 6: After the bare-metal program completes driver loading and hardware initialization, it continues to execute the functional logic of the bare-metal program.
2. The method for running a bare-metal program on a heterogeneous embedded platform according to claim 1, characterized in that, The local device information in step 1 includes the vendor ID, version number, and checksum.
3. The method for running a bare-metal program on a heterogeneous embedded platform according to claim 1, characterized in that, The first-stage bootloader for each heterogeneous hardware platform in S2 must complete the bootstrapping of device information before the bare-metal program is loaded.
4. The method for running a bare-metal program on a heterogeneous embedded platform according to claim 1, characterized in that, S4 generates fingerprint information of heterogeneous hardware platform based on comparison results. If the checksum is consistent, the bare-metal program parses and extracts the vendor identifier and version number of the bootstrap information, and generates fingerprint information of heterogeneous hardware platform based on the vendor identifier and version number. The fingerprint information is used to identify the uniqueness of heterogeneous hardware platform and its version, so that the bare-metal program can match the driver code of heterogeneous platform based on fingerprint information. If the checksum is inconsistent, report a checksum failure and exit the bare-metal program.
5. The method for running a bare-metal program on a heterogeneous embedded platform according to claim 4, characterized in that, The process of executing the driver code to complete the initialization sequence of the current heterogeneous platform includes loading the driver module corresponding to the vendor identifier and version number from the preloaded driver code, and calling the corresponding driver to complete the initialization sequence of the current heterogeneous platform.