Code loading method and device
By using pre-allocated transit memory space for symbol relocation and storage in IoT devices, the problem of high RAM resource usage by dynamic loading technology is solved, XIP can be executed in FLASH storage, and memory usage efficiency is improved.
Patent Information
- Application Number
- CN202410735247.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-10
AI Technical Summary
Dynamic loading technology occupies a large amount of RAM resources in IoT devices, resulting in tight memory resources, and does not support in-place execution of XIP, which limits the application of dynamic loading technology.
Using pre-allocated transit memory space, code snippets are read from the code segments in sequence for symbol relocation, and stored in FLASH storage for execution, reducing RAM usage and supporting XIP execution in FLASH storage.
During the process of loading ELF files, only a fixed size of transfer memory space is occupied, which reduces the occupation of RAM resources and improves the practicality of dynamic loading technology on IoT devices that support XIP.
Smart Images

Figure CN118626166A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for code loading. Background Art
[0002] At present, dynamic loading technology is usually used to decouple application code from the operating system and publish the application code separately in a specific format. IoT devices can load the required application code according to service requirements at runtime, realizing instant updates and extended functions without having to re-burn all application codes.
[0003] However, this method requires all application codes to be dynamically loaded into RAM and continue to occupy this part of RAM resources until the application code is unloaded, which is a large overhead for IoT devices with limited memory resources.
[0004] Therefore, how to reduce the occupation of RAM resources in the process of loading dynamic modules is an urgent problem to be solved. Summary of the invention
[0005] The present specification provides a code loading method, device, storage medium and electronic device to reduce the occupation of RAM resources during the process of loading dynamic modules.
[0006] This manual adopts the following technical solutions:
[0007] The present specification provides a method for code loading, which is applied to an Internet of Things device, wherein the Internet of Things device supports executing code in an in-place XIP manner in a FLASH storage carried by the device; the memory carried by the Internet of Things device includes a pre-allocated transit memory space; the method comprises:
[0008] Obtain an ELF file that needs to be dynamically loaded, wherein the ELF file includes: at least one code segment;
[0009] Reading code segments from the at least one code segment in sequence according to the order of the at least one code segment in the ELF file, and determining whether the read code segment is a code segment that needs symbol relocation;
[0010] If the read code segment is the first code segment that needs symbol relocation, read the first code segments from the first code segment in sequence according to the space size of the transit memory space, store the first code segment in the transit memory space based on the storage address of the first code segment in the transit memory space, and perform a symbol relocation operation on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage; and
[0011] For any first code fragment stored in the transit memory space, based on the storage address of the first code fragment in the FLASH storage, the first code fragment is stored in the FLASH storage, so as to execute the ELF file in the FLASH storage in an XIP manner.
[0012] Optionally, based on a storage address of the first code segment in the FLASH storage, storing the first code segment in the FLASH storage includes:
[0013] It is further determined whether the code segment to which the first code segment belongs is a code segment with immutable parameters; if so, based on the storage address of the first code segment with immutable parameters in the FLASH storage, the first code segment with immutable parameters is stored in the FLASH storage.
[0014] Optionally, the code segment with immutable parameters includes: a text code segment and a rodata code segment.
[0015] Optionally, the memory space of the memory carried by the IoT device includes: a static memory space and a dynamic memory space; the static memory space is a pre-allocated memory space of a fixed size; the dynamic memory space is a memory space used to dynamically allocate the transit memory space;
[0016] Based on the storage address of the first code segment in the FLASH storage, storing the first code segment in the FLASH storage includes:
[0017] Further determine whether the code segment to which the first code segment belongs is a code segment with immutable parameters; if not, based on the storage address of the first code segment with variable parameters in the static memory space, store the first code segment with variable parameters in the static memory space, and based on the storage address of the first code segment with variable parameters in the FLASH storage, further store the first code segment with variable parameters stored in the static memory space in the FLASH storage.
[0018] Optionally, a basic ELF file is pre-loaded in the IoT device; the code segment with variable parameters includes: a data code segment and a bss code segment;
[0019] Based on the storage address of the first code segment with variable parameters in the static memory space, storing the first code segment with variable parameters in the static memory space, and based on the storage address of the first code segment with variable parameters in the FLASH storage, further storing the first code segment with variable parameters stored in the static memory space in the FLASH storage, including:
[0020] Based on the tail address of the bss code segment contained in the basic ELF file in the static memory space, and the space size of the static memory space, determine the storage addresses of the data code segment and the bss code segment contained in the ELF file that needs to be dynamically loaded in the static memory space;
[0021] Based on the storage addresses of the data code segment and the bss code segment contained in the ELF file to be dynamically loaded in the static memory space, the data code segment and the bss code segment are stored in the static memory space, and the data code segment in the static memory space is further stored in the FLASH storage; and,
[0022] A parameter file corresponding to the ELF file is constructed according to the storage address and actual length of the data code segment in the FLASH storage, the storage address of the data code segment in the static memory space, and the maximum total length of the data code segment and the bss code segment.
[0023] Optionally, the bss code segment contained in the ELF file that needs to be dynamically loaded is used to store uninitialized global variables or static variables; wherein the bss code segment does not occupy actual storage space in the ELF file; and the method further comprises:
[0024] Monitoring that the IoT device is powered on again after power failure, and detecting whether a parameter file corresponding to the ELF file is stored in the file system of the IoT device;
[0025] If so, based on the storage address and actual length of the data code segment contained in the ELF file in the FLASH storage, the data code segment is read from the FLASH storage, and based on the storage address of the data code segment in the static memory space, the data code segment in the FLASH storage is stored in the static memory space, and the bss code segment is stored in the static memory space.
[0026] Optionally, storing the bss code segment in the static memory space includes:
[0027] Determine the actual length of the bss code segment based on the difference between the maximum total length and the actual length of the data code segment;
[0028] Determine the storage address of the bss code segment in the static memory space based on the storage address of the data code segment in the static memory space and the actual length of the data code segment;
[0029] Based on the actual length of the bss code segment and the storage address of the bss code segment in the static memory space, the storage space size of the bss code segment in the static memory space is determined, and based on the storage space size of the bss code segment in the static memory space, the bss code segment is stored in the static memory space.
[0030] Optionally, the method further comprises:
[0031] If the read code segment is a second code segment that does not require symbol relocation, determining whether an actual length of the second code segment is greater than a preset space size of the transfer memory space;
[0032] If so, based on the preset space size, the second code segment is divided to obtain at least one second code segment, and the second code segments are stored in the transit memory space in sequence according to the order of the second code segments in the second code segments, and the second code segments stored in the transit memory space are stored in the FLASH storage.
[0033] Optionally, before reading the first code segments from the first code segments in sequence according to the size of the transfer memory space, the method further includes:
[0034] In the process of storing the first code segment read from the first code segment into the transit memory space, based on the actual length of the first code segment in the first code segment that has not yet been stored in the FLASH storage, the space size of the transit memory space is dynamically adjusted, and the transit memory space is dynamically allocated in the memory carried by the Internet of Things device based on the determined space size.
[0035] Optionally, the method further comprises:
[0036] Read the parameter file corresponding to the ELF file;
[0037] Determine whether the number of exception marks in the ELF file is greater than a set number;
[0038] If yes, refuse to load the data code segment and the bss code segment in the ELF file, and delete the loaded part in the ELF file;
[0039] If not, load the data code segment and the bss code segment in the ELF file, and add an exception mark in the ELF file to indicate that the loading is rejected. If the running time of the loaded ELF file is greater than the set running time, reduce an exception mark in the ELF file and continue to run the ELF file.
[0040] Optionally, the set runtime is greater than the duration required to delete the data code segment and the bss code segment in the ELF file.
[0041] Optionally, the ELF file is an ELF file generated based on an executable code corresponding to an SDK application running on the IoT device.
[0042] Optionally, the ELF file further includes: a relocatable file (Relocatable file), and the relocatable file is used to link with other relocatable files.
[0043] The present specification provides a device for code loading, which is applied to an Internet of Things device, wherein the Internet of Things device supports executing code in a manner of executing XIP in situ in a FLASH storage carried by the device; the memory carried by the Internet of Things device includes a pre-allocated transit memory space; the device includes:
[0044] An acquisition module is used to acquire an ELF file that needs to be dynamically loaded, wherein the ELF file includes: at least one code segment;
[0045] A reading module, used for reading code segments from the at least one code segment in sequence according to the order of the at least one code segment in the ELF file, and determining whether the read code segment is a code segment that needs symbol relocation;
[0046] a storage module, configured to, if the read code segment is a first code segment that needs symbol relocation, sequentially read the first code segments from the first code segment according to the space size of the transit memory space, store the first code segment in the transit memory space based on the storage address of the first code segment in the transit memory space, and perform a symbol relocation operation on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage; and;
[0047] An execution module is used to store any first code fragment stored in the transit memory space in the FLASH storage based on the storage address of the first code fragment in the FLASH storage, so as to execute the ELF file in the FLASH storage using XIP.
[0048] This specification provides an electronic device, including a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;
[0049] The memory stores machine-readable instructions, and the processor executes the above code loading method by calling the machine-readable instructions.
[0050] This specification provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above-mentioned code loading method is implemented.
[0051] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0052] In this specification, the IoT device supports executing code in the FLASH storage carried by it by using the in-place execution XIP method. The code can be executed in the FLASH storage, and there is no need to execute the code in the RAM, thereby reducing the occupation of RAM resources.
[0053] Furthermore, the first code segments are sequentially read from the first code segment and stored in the transit memory space through the pre-allocated transit memory space, and the symbol relocation operation is performed on the first code segment, and then the first code segment after the symbol relocation is stored in the FLASH storage. Therefore, in the process of loading the ELF file, only a fixed size of transit memory space is occupied, which further reduces the occupation of RAM resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0055] Figure 1 is a flow chart of a code loading method shown in an exemplary embodiment;
[0056] Figure 2 is a schematic diagram of an existing dynamic loading method shown in an exemplary embodiment;
[0057] Figure 3 is a schematic diagram of a dynamic loading method shown in an exemplary embodiment;
[0058] Figure 4 is a schematic diagram of a fast loading method shown in an exemplary embodiment;
[0059] Figure 5 is a schematic diagram of a method for detecting anomalies shown in an exemplary embodiment;
[0060] Figure 6 is a structural diagram of an electronic device where a code loading device is located, shown in an exemplary embodiment;
[0061] Figure 7 It is a structural diagram of a code loading device shown in an exemplary embodiment. DETAILED DESCRIPTION
[0062] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0063] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0064] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the relevant technologies involved in the embodiments of this specification are briefly described below.
[0065] Execute in Place (XIP): Allows code to be executed directly in non-volatile memory (such as flash memory) without copying the code to RAM (random access memory) for execution.
[0066] Internet of Things (IoT): A network based on information carriers such as the Internet and traditional telecommunications networks that allows all ordinary physical objects that can be independently addressed to be interconnected.
[0067] Symbols Relocation: The process of mapping the logical addresses of symbols in the code to actual physical addresses in the memory when a computer program is running.
[0068] In actual applications, each application code in traditional operating systems (such as Windows, Linux, etc.) is run through a process, and each process has an independent virtual address space. In IoT devices, they are usually developed based on a real-time operating system (RTOS) or a bare metal environment. All application codes and systems are in the same address space. There is no concept of process in traditional operating systems, and no independent virtual address space is allocated for each application code.
[0069] During the relocation phase, the static linker needs to know the memory address in the application code to perform symbol relocation operations. Therefore, the system and all application codes in the same address space can determine their respective memory addresses only after static linking. Since all application codes are linked together, it is impossible to independently determine the corresponding running address for a certain application code. Once an application code is modified, all application codes need to be relinked, packaged, and burned. This highly coupled development model severely limits the flexibility of application development, debugging, and release, and reduces development efficiency.
[0070] At present, dynamic loading technology is usually used to decouple application code from the operating system and publish the application code separately in a specific format. IoT devices can load the required application code according to service requirements at runtime, realizing instant updates and extended functions without having to re-burn all application codes.
[0071] However, this method requires all application codes to be dynamically loaded into RAM and continue to occupy this part of RAM resources until the application code is unloaded, which is a large overhead for IoT devices with limited memory resources.
[0072] Based on this, this specification proposes a technical solution that uses a pre-allocated transit memory space to sequentially read code fragments from a code segment and store them in the transit memory space, performs symbol relocation operations on the code fragments, and then stores the relocated code fragments in FLASH storage. Therefore, in the process of loading an ELF file, only a fixed size of transit memory space is required, thereby reducing the occupation of RAM resources.
[0073] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0074] Figure 1The following is a flowchart of a method for loading a code according to an exemplary embodiment. The method specifically comprises the following steps:
[0075] S100: Acquire an ELF file that needs to be dynamically loaded, where the ELF file includes at least one code segment.
[0076] S102: Read code segments from the at least one code segment in sequence according to the order of the at least one code segment in the ELF file, and determine whether the read code segment is a code segment that requires symbol relocation.
[0077] S104: If the read code segment is the first code segment that needs symbol relocation, read the first code segments from the first code segment in sequence according to the space size of the transit memory space, store the first code segment in the transit memory space based on the storage address of the first code segment in the transit memory space, and perform symbol relocation operation on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage; and
[0078] S106: For any first code fragment stored in the transit memory space, based on the storage address of the first code fragment in the FLASH storage, store the first code fragment in the FLASH storage, so as to execute the ELF file in the FLASH storage in an XIP manner.
[0079] In an embodiment of the present specification, an Internet of Things device can obtain an ELF file that needs to be dynamically loaded. The ELF file includes: at least one code segment. Among them, ELF files can be divided into three types, namely: relocatable files (Relocatable file), dynamic link library files, and executable files. Relocatable files are used to link with other relocatable files to form executable files or dynamic link libraries. Relocatable files are usually .o files (suffixed with .o). Dynamic link library files (Shared Object File) are non-executable binary program files. When the application in the terminal device is executed, the corresponding symbols can be called from the dynamic link library to complete the execution of the application. Dynamic link library files are usually .so files (suffixed with .so). Executable files (Executable File) are linked, executable program files. Executable files are usually .out files (suffixed with .out).
[0080] It should be noted that the ELF files in the embodiments of this specification are mainly relocatable files. IoT devices can publish application codes in the format of relocatable files, so that the application codes do not need to consider the problem of loading memory addresses when publishing, and postpone the symbol relocation step until the application codes are loaded into the memory and the memory addresses are assigned, thereby avoiding the need to determine the memory addresses of the application codes at compile time or at publishing time, and achieving the decoupling of the application codes from the operating system.
[0081] Furthermore, the ELF file can be obtained by merging, deleting and specifying entry functions of code segments based on the relocatable file. The parameters involved include -r: merging target files, -S: clearing the debugging information of the output file, -T test.ld: specifying the link script test.ld, which specifies the merging rules of the code segments, -e app_entry: specifying the entry function, and -gc-sections: discarding useless code segments.
[0082] In the ELF file compilation process, additional compilation options can be added. For example, -fno-common can prohibit uninitialized global variables from being placed in the COM section that identifies weak symbols, and instead place uninitialized global variables in the bss section. -mlong-calls can avoid the problem of insufficient instruction jump range. The ELF file can also be further reduced in size by using the strip tool.
[0083] Before reading code segment from ELF file, need to parse ELF file first, to obtain the information of at least one code segment.Wherein, the file structure of ELF file is ELF file header, program table header (optional), first section, second section, third section, ..., section header table.ELF file header is located at the beginning of ELF file, contains the structural information of whole ELF file, for example, file type, big end format (big end format, little end format), processor architecture (such as ARM, X86 etc.).Program table header can be ignored in relocatable file.Section header table contains the information of all code segments, as shown in table 1 below.
[0084] Table 1
[0085] Section (code snippet) Section Type (section_type) Section Flag (section_flag) .text SHT_PROGBITS AX .rodata SHT_PROGBITS A / AMS .data SHT_PROGBITS AW .bss SHT_NOBITS AW .rel.name SHT_REL I .symtab SHT_SYMTAB .strtab SHT_STRTAB
[0086] In Table 1 above, the text code segment is used to store program instructions. The rodata code segment is used to store read-only data, for example, constants such as strings. The data code segment is used to store initialized global variables or static variables. The bss code segment is used to store uninitialized global variables or static variables, as well as global variables or static variables initialized to 0, wherein the bss code segment does not occupy actual storage space in the ELF file. The rel.name code segment is used to store relocation information, which includes: the type of relocation instruction, the location of the relocation, and the symbols involved in the relocation. The IoT device can complete symbol relocation based on this relocation information. Symtab is used to represent the symbol table, which is used for the definition and reference of symbols during the relocation process. Strtab is used to represent the string table, which is used to store symbol names or section names in the ELF file. The section header table also stores the location and size of each section. The IoT device can parse the ELF file, and obtain the location and size of each section from the section header table according to the section type and section flag, so as to read the code segment from the ELF file.
[0087] In actual applications, the memory space of the memory includes: static memory space and dynamic memory space. Static memory space refers to the memory space whose memory address has been determined when the program is compiled. Dynamic memory space is the memory space that is dynamically requested and released when the program is running. Dynamic loading technology usually requires all application codes to be dynamically loaded into the dynamic memory space, and continue to occupy this part of the dynamic memory space until the application code is unloaded. Figure 2 shown.
[0088] Figure 2 It is a schematic diagram of an existing dynamic loading method shown in an exemplary embodiment.
[0089] exist Figure 2 In the , the code segment without the "ex" prefix is used to represent the code segment in the ELF file corresponding to the operating system. The code segment with the "ex" prefix is used to represent the code segment in the ELF file that needs to be dynamically loaded.
[0090] It can be seen that the code segments in the ELF file that need to be dynamically loaded all occupy the dynamic memory space. This is a large overhead for IoT devices with limited memory resources. In addition, the existing dynamic loading technology does not support XIP. This means that the code cannot be executed directly on the FLASH storage, which limits the application of dynamic loading technology on IoT devices that support XIP.
[0091] To overcome these limitations, this specification can load application code into the FLASH of IoT devices that support XIP, reducing the demand for RAM resources by dynamic loading technology and improving the practicality of dynamic loading technology on IoT devices that support XIP.
[0092] However, in the process of loading the application code into FLASH, the memory still needs to be used as a transit storage to perform symbol relocation operations. Since this process temporarily stores all application codes in the memory, the peak value of memory usage is high.
[0093] Therefore, this specification uses the pre-allocated transit memory space to sequentially read code segments from the code segment and store them in the transit memory space for symbol relocation, and then stores the relocated code segments in the FLASH storage. Thus, the peak value of memory usage is effectively controlled, and the RAM resources occupied during dynamic loading are further reduced.
[0094] In the embodiments of this specification, the IoT device supports executing code in the FLASH storage carried by it by using the in-place execution XIP method. The memory carried by the IoT device includes a pre-allocated transit memory space.
[0095] Then, the IoT device can read the code segments from at least one code segment in the order of at least one code segment in the ELF file, and determine whether the read code segment is a code segment that needs symbol relocation. In the compilation process, the identifier in the code segment will be assigned a logical address in the memory. The identifier mentioned here can be used to represent the name of elements such as functions, variables, and classes, and can also be called a symbol. The IoT device can determine whether the read code segment is a code segment that needs symbol relocation by whether there is an identifier in the code segment. In order to ensure that the application can accurately access these functions and variables when it is executed, symbol relocation needs to be completed before the application code runs.
[0096] During the process of loading the application code into the FLASH storage of the IoT device, the size of the code segment may be larger than the size of the pre-allocated transfer memory space, making it impossible to transfer the code segment to the FLASH storage at one time. The code segment needs to be divided into smaller code segments and transferred sequentially.
[0097] Therefore, if the read code segment is the first code segment that needs to be symbolically relocated, the first code segment is read from the first code segment in sequence according to the size of the transfer memory space, and based on the storage address of the first code segment in the transfer memory space, the first code segment is stored in the transfer memory space, and a symbol relocation operation is performed on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage. The first code segment may refer to a portion of the code read from the first code segment.
[0098] For any first code segment stored in the transit memory space, based on the storage address of the first code segment in the FLASH storage, the first code segment is stored in the FLASH storage, so as to execute the ELF file in the FLASH storage in a XIP manner.
[0099] In actual applications, the code segments may include code segments with immutable parameters and code segments with variable parameters. The code segments with immutable parameters need to be stored in FLASH storage, and the code segments with variable parameters need to be stored in memory to run the application code.
[0100] Furthermore, the memory space of the memory includes: static memory space and dynamic memory space. If the code segment with variable parameters is stored in the dynamic memory space, the storage address of the dynamic memory space allocated to it after each power-on is different, which will reduce the storage efficiency. Therefore, the code segment with variable parameters is stored in the static memory space, so that the storage address of the static memory space allocated to it after each power-on is the same, thereby improving the storage efficiency.
[0101] Since some IoT devices will be powered off when in sleep mode to reduce power consumption, and memory is a volatile memory, the data stored in the memory will be lost when power is lost.
[0102] Based on this, in order to avoid data loss caused by power failure, the IoT device can further store the parameter-variable code segment stored in the static memory space in the FLASH storage (FLASH storage is a non-volatile memory that can retain data after power failure), so that when the IoT device is powered on again after power failure, the parameter-variable code segment stored in the FLASH storage can be stored back in the static memory space.
[0103] As can be seen from Table 1, the text code segment and the rodata code segment are code segments with immutable parameters, while the data code segment and the bss code segment are code segments with variable parameters.
[0104] In the embodiment of the present specification, the IoT device may further determine whether the code segment to which the first code segment belongs is a code segment with immutable parameters.
[0105] If yes, based on the storage address of the first code segment with immutable parameters in the FLASH storage, the first code segment with immutable parameters is stored in the FLASH storage.
[0106] If not, based on the storage address of the code segment with variable parameters in the static memory space, the code segment with variable parameters is stored in the static memory space, and based on the storage address of the code segment with variable parameters in the FLASH storage, the code segment with variable parameters stored in the static memory space is further stored in the FLASH storage. Figure 3 shown.
[0107] Figure 3 It is a schematic diagram of a dynamic loading method shown in an exemplary embodiment.
[0108] exist Figure 3 In the example, the data code segment and the bss code segment are stored in the static memory space. The text code segment, the rodata code segment, and the data code segment are stored in the FLASH storage. It can be seen that storing the text code segment and the rodata code segment in the FLASH of the IoT device reduces the demand for RAM resources. In addition, when the IoT device is powered on again after power failure, the data code segment stored in the FLASH storage is stored again in the static memory space to complete the fast loading of the data code segment.
[0109] During the loading process, the IoT device needs to read the ELF file into the memory space of the memory for parsing and release it after loading is completed. The size of the ELF file is the size of the text code segment + the size of the rodata code segment + the size of the data code segment + the size of the rel.name code segment + the size of the symtab code segment + the size of the strtab code segment. Figure 2 as well as Figure 3 , determine the additional memory resources required by the dynamic loading method compared to the traditional burning mode, as shown in Table 2 below.
[0110] Table 2
[0111]
[0112] As can be seen from Table 2, compared with the traditional burning mode, the dynamic loading method that does not support XIP requires additional memory of the size of the text code segment + the size of the rodata code segment + the size of the data code segment during the loading process, and requires additional memory of the size of the text code segment + the size of the rodata code segment after the loading is completed.
[0113] Compared with the traditional burning mode, the dynamic loading method that supports XIP only needs to increase the size of the transfer memory space during the loading process, and no additional memory is required after the loading is completed.
[0114] It can be seen that the dynamic loading method that supports XIP effectively reduces the occupancy of memory space.
[0115] In actual applications, data segments related to the operating system have been burned into the static memory space. When storing code segments with variable parameters in the static memory space, it is necessary to ensure that the allocated storage address does not overlap with the data segments burned in the operating system to avoid potential memory conflicts.
[0116] Based on this, the basic ELF file is pre-loaded in the IoT device. The basic ELF file mentioned here can refer to the ELF file corresponding to the operating system.
[0117] Then, the IoT device can determine the storage addresses of the data code segment and the bss code segment contained in the ELF file that needs to be dynamically loaded in the static memory space based on the tail address of the bss code segment contained in the basic ELF file in the static memory space and the space size of the static memory space.
[0118] Furthermore, in the process of backing up the data code segment and the bss code segment to FLASH storage, the IoT device needs to build a special parameter file in the file system to store the parameters required for loading the data code segment and the bss code segment for subsequent loading of the data code segment and the bss code segment.
[0119] Based on this, the IoT device can store the data code segment and the bss code segment in the static memory space based on the storage addresses of the data code segment and the bss code segment contained in the ELF file that needs to be dynamically loaded in the static memory space, and further store the data code segment in the static memory space into the FLASH storage.
[0120] Next, the IoT device can construct a parameter file corresponding to the ELF file based on the storage address and actual length of the data code segment in the ELF file in the FLASH storage, the storage address of the data code segment in the static memory space, and the maximum length of the data code segment and the bss code segment, so as to be used to store the data code segment and the bss code segment back to the static memory space after the IoT device loses power.
[0121] In actual applications, if it is detected that a parameter file corresponding to the ELF file is stored in the file system, it means that the data code segment and the bss code segment contained in the ELF file have been loaded during the last run.
[0122] Based on this, the IoT device can store the data code segment and the bss code segment in the static memory space based on the parameters in the parameter file corresponding to the ELF file to complete fast loading, thereby improving the efficiency of loading application code.
[0123] In the embodiment of the present specification, it is monitored that the IoT device is powered on again after power failure, and it is detected whether a parameter file corresponding to the ELF file is stored in the file system of the IoT device.
[0124] If yes, based on the storage address and actual length of the data code segment contained in the ELF file in the FLASH storage, read the data code segment from the FLASH storage, and based on the storage address of the data code segment in the static memory space, store the data code segment in the FLASH storage into the static memory space, and store the bss code segment into the static memory space. Figure 4 shown.
[0125] Figure 4 It is a schematic diagram of a fast loading method shown in an exemplary embodiment.
[0126] exist Figure 4 In the ELF file, the IoT device can be powered on again after power failure, and store the data code segment in the FLASH storage into the static memory space. Since the bss code segment does not occupy actual storage space in the ELF file, the IoT device can store the bss code segment into the static memory space based on the storage location of the data code segment in the static memory space.
[0127] Since the bss code segment does not occupy actual storage space in the ELF file, and only the total length of the data code segment and the bss code segment is known, the IoT device needs to first calculate the storage address of the bss code segment in the static memory space and the storage space size of the bss code segment in the static memory space before storing the bss code segment in the static memory space.
[0128] In the embodiment of the present specification, the actual length of the bss code segment is determined based on the difference between the maximum total length and the actual length of the data code segment.
[0129] Then, based on the storage address of the data code segment in the static memory space and the actual length of the data code segment, the storage address of the bss code segment in the static memory space is determined.
[0130] Finally, based on the actual length of the bss code segment and the storage address of the bss code segment in the static memory space, the storage space size of the bss code segment in the static memory space is determined, and based on the storage space size of the bss code segment in the static memory space, the bss code segment is stored in the static memory space.
[0131] In actual applications, some code segments do not need symbol relocation. For example, some code segments can be completely independent of other parts of the application code, and they do not reference any external symbols or global variables that need to be relocated. Another example is a code segment that determines the memory address at the beginning of the application code and a global variable that remains unchanged during the entire application code execution.
[0132] Based on this, if the read code segment is the second code segment that does not require symbol relocation, it is determined whether the actual length of the second code segment is greater than the preset space size of the transit memory space.
[0133] If so, based on the preset space size, the second code segment is divided to obtain at least one second code segment, and the second code segments are stored in the transit memory space in sequence according to the order of the second code segments in the second code segment, and the second code segments stored in the transit memory space are stored in the FLASH storage.
[0134] Since the size of the transit memory space is pre-allocated, when reading code snippets from the code segment and storing them in the transit memory space, it may happen that the length of a single code snippet is not enough to fill the entire transit memory space. This makes part of the transit memory space unused, resulting in a waste of memory resources.
[0135] Based on this, IoT devices can dynamically allocate transit memory space, further reducing the RAM resources occupied during dynamic loading.
[0136] In an embodiment of the present specification, in the process of storing the first code fragment read from the first code segment into the transit memory space, the space size of the transit memory space is dynamically adjusted based on the actual length of the first code fragment in the first code segment that has not yet been stored in the FLASH storage, and the transit memory space is dynamically allocated in the memory carried by the Internet of Things device based on the determined space size.
[0137] In actual applications, when restoring the code segments in the FLASH storage to the static memory space, the parameter files may be modified, the code segments corresponding to the operating system may be re-burned, the code segments in the FLASH storage may become invalid, etc. In these cases, the IoT device will restart after the loading fails after being powered on again.
[0138] Since the IoT device will continue to try to load the wrong code segment after powering on again, falling into an infinite restart loop, the IoT device needs to delete the wrong code segment in the FLASH storage. However, when the IoT device is constantly restarting, the IoT device does not have enough time to issue or execute the instruction to delete the code segment, resulting in negative effects such as security risks, resource consumption, and IoT device unavailability.
[0139] Based on this, a method for detecting anomalies is designed in the embodiments of this specification to prevent IoT devices from constantly restarting.
[0140] In the embodiment of this specification, the IoT device can read the parameter file corresponding to the ELF file.
[0141] Determine whether the number of exception markers in the ELF file is greater than the set number.
[0142] If so, refuse to load the data code segment and bss code segment in the ELF file, and delete the loaded part in the ELF file.
[0143] If not, load the data code segment and bss code segment in the ELF file, and add an exception mark in the ELF file to indicate that the loading is rejected. If the running time of the loaded ELF file is greater than the set running time, reduce an exception mark in the ELF file and continue to run the ELF file. Figure 5 shown.
[0144] Figure 5 It is a schematic diagram of a method for detecting anomalies shown in an exemplary embodiment.
[0145] exist Figure 5 In the example, the IoT device can read the parameter file corresponding to the ELF file. Then, it is determined whether the number of abnormal tags in the ELF file is greater than the set number. If so, the data code segment and bss code segment in the ELF file are refused to be loaded, and the loaded part in the ELF file is deleted.
[0146] If not, the data code segment and bss code segment in the ELF file are loaded, and an exception mark indicating the refusal to load is added to the ELF file. When errors occur in the data code segment and bss code segment in the ELF file, the IoT device is restarted before the exception mark is cleared, which will cause the number of exception marks to gradually increase until the number of exception marks exceeds the set number. At this time, the IoT device will refuse to load the data code segment and bss code segment in the ELF file and execute other instructions.
[0147] If the runtime of the loaded ELF file is greater than the set runtime, an exception mark is reduced in the ELF file and the ELF file continues to run.
[0148] The moment when the IoT device clears the abnormal flag depends on the actual duration of deleting the code segment, which can be adjusted according to the actual situation, as long as the IoT device has enough time to issue or execute the instruction to delete the code segment. Therefore, the runtime is set to be longer than the duration required to delete the data code segment and the bss code segment in the ELF file.
[0149] It should be noted that for the Confidential Computing Cloud Service (C3S), the carrier running the trusted on-chain SDK (Software Development Kit) is usually an embedded IoT device, such as a microcontroller unit (MCU), a Bluetooth SOC (System on Chip), a 4G communication module, etc. The storage resources of these embedded IoT devices are relatively tight, and they use cellular communication technology, which is more sensitive to traffic, and require a flexible and lightweight way to upgrade and maintain the application code. IoT devices can reduce initial storage and network traffic requirements by adopting dynamic loading technology. Furthermore, the ELF file can be an ELF file generated for the executable code corresponding to the SDK application running on the IoT device.
[0150] It can be seen from the above method that the IoT device supports executing code in the FLASH storage it carries by using the in-place execution XIP method. The code can be executed in the FLASH storage and there is no need to execute the code in the RAM, thereby reducing the occupation of RAM resources.
[0151] Furthermore, the first code segments are sequentially read from the first code segment and stored in the transit memory space through the pre-allocated transit memory space, and the symbol relocation operation is performed on the first code segment, and then the first code segment after the symbol relocation is stored in the FLASH storage. Therefore, in the process of loading the ELF file, only a fixed size of transit memory space is occupied, which further reduces the occupation of RAM resources.
[0152] In addition, the IoT device can further store the code segments with variable parameters stored in the static memory space in the FLASH storage, so that when the IoT device is powered on again after power failure, the code segments with variable parameters can be quickly loaded, reducing the time copying degree from O(N) to O(1), where N is the number of code segments that need to be relocated.
[0153] Corresponding to the above-mentioned embodiment of the method for loading code, this specification also provides an embodiment of a device for loading code.
[0154] See also Figure 6 , Figure 6 It is a structural diagram of an electronic device where a code loading device is located, shown in an exemplary embodiment. At the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610, and of course may also include other required hardware. One or more embodiments of this specification can be implemented based on software, such as the processor 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0155] See also Figure 7 , Figure 7 FIG. 1 is a structural diagram of a code loading device shown in an exemplary embodiment. The code loading device can be applied to Figure 6 In the electronic device shown in the figure, the technical solution of this specification is implemented. The device may include:
[0156] The acquisition module 700 is used to acquire an ELF file that needs to be dynamically loaded, wherein the ELF file includes: at least one code segment;
[0157] A reading module 702 is used to read code segments from the at least one code segment in sequence according to the order of the at least one code segment in the ELF file, and determine whether the read code segment is a code segment that needs symbol relocation;
[0158] The storage module 704 is configured to, if the read code segment is the first code segment that needs to be symbolically relocated, read the first code segments from the first code segment in sequence according to the space size of the transit memory space, store the first code segment in the transit memory space based on the storage address of the first code segment in the transit memory space, and perform a symbol relocation operation on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage; and;
[0159] The execution module 706 is used to store any first code fragment stored in the transit memory space in the FLASH storage based on the storage address of the first code fragment in the FLASH storage, so as to execute the ELF file in the FLASH storage using the XIP method.
[0160] Optionally, the execution module 706 is specifically used to further determine whether the code segment to which the first code segment belongs is a code segment with immutable parameters; if so, based on the storage address of the first code segment with immutable parameters in the FLASH storage, store the first code segment with immutable parameters in the FLASH storage.
[0161] Optionally, the code segment whose parameters are immutable includes: a text code segment and a rodata code segment.
[0162] Optionally, the memory space of the memory carried by the IoT device includes: static memory space and dynamic memory space; the static memory space is a pre-allocated memory space of a fixed size; the dynamic memory space is a memory space used to dynamically allocate the transit memory space; the execution module 706 is specifically used to further determine whether the code segment to which the first code segment belongs is a code segment with immutable parameters; if not, based on the storage address of the first code segment with variable parameters in the static memory space, the first code segment with variable parameters is stored in the static memory space, and based on the storage address of the first code segment with variable parameters in the FLASH storage, the first code segment with variable parameters stored in the static memory space is further stored in the FLASH storage.
[0163] Optionally, a basic ELF file is pre-loaded in the IoT device; the code segments with variable parameters include: a data code segment and a bss code segment; the execution module 706 is specifically used to determine the storage addresses of the data code segment and the bss code segment contained in the ELF file that needs to be dynamically loaded in the static memory space based on the tail address of the bss code segment contained in the basic ELF file in the static memory space and the space size of the static memory space; based on the storage addresses of the data code segment and the bss code segment contained in the ELF file that needs to be dynamically loaded in the static memory space, the data code segment and the bss code segment are stored in the static memory space, and the data code segment in the static memory space is further stored in the FLASH storage; and, according to the storage address and actual length of the data code segment in the ELF file in the FLASH storage, the storage address of the data code segment in the static memory space, and the maximum total length of the data code segment and the bss code segment, a parameter file corresponding to the ELF file is constructed.
[0164] Optionally, the bss code segment contained in the ELF file that needs to be dynamically loaded is used to store uninitialized global variables or static variables; wherein, the bss code segment does not occupy actual storage space in the ELF file; the execution module 706 is further specifically used to monitor when the Internet of Things device is powered on again after power failure, and detect whether a parameter file corresponding to the ELF file is stored in the file system of the Internet of Things device; if so, based on the storage address and actual length of the data code segment contained in the ELF file in the FLASH storage, read the data code segment from the FLASH storage, and based on the storage address of the data code segment in the static memory space, store the data code segment in the FLASH storage to the static memory space, and store the bss code segment in the static memory space.
[0165] Optionally, the execution module 706 is further specifically used to determine the actual length of the bss code segment based on the difference between the maximum total length and the actual length of the data code segment; determine the storage address of the bss code segment in the static memory space based on the storage address of the data code segment in the static memory space and the actual length of the data code segment; determine the storage space size of the bss code segment in the static memory space based on the actual length of the bss code segment and the storage address of the bss code segment in the static memory space, and store the bss code segment in the static memory space based on the storage space size of the bss code segment in the static memory space.
[0166] Optionally, the execution module 706 is further specifically used to determine whether the actual length of the read code segment is greater than the preset space size of the transit memory space if the second code segment does not require symbol relocation; if so, based on the preset space size, divide the second code segment to obtain at least one second code fragment, store the second code fragments in the transit memory space in sequence according to the order of the second code fragments in the second code segment, and store the second code fragments stored in the transit memory space in the FLASH storage.
[0167] Optionally, the execution module 706 is further specifically used to dynamically adjust the space size of the transit memory space based on the actual length of the first code fragment in the first code segment that has not yet been stored in the FLASH storage during the process of storing the first code fragment read from the first code segment into the transit memory space, and dynamically allocate the transit memory space in the memory carried by the Internet of Things device based on the determined space size.
[0168] Optionally, the acquisition module 700 is further specifically used to read a parameter file corresponding to the ELF file; determine whether the number of exception marks in the ELF file is greater than a set number; if so, refuse to load the data code segment and the bss code segment in the ELF file, and delete the loaded part in the ELF file; if not, load the data code segment and the bss code segment in the ELF file, and add an exception mark to the ELF file to indicate the refusal to load, if the running time of the loaded ELF file is greater than the set running time, reduce one exception mark in the ELF file and continue to run the ELF file.
[0169] Optionally, the set runtime is greater than the duration required to delete the data code segment and the bss code segment in the ELF file.
[0170] Optionally, the ELF file is an ELF file generated based on the executable code corresponding to the SDK application running on the IoT device.
[0171] Optionally, the ELF file further includes: a relocatable file (Relocatable file), and the relocatable file is used to link with other relocatable files.
[0172] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0173] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.
[0174] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0175] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.
[0176] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0177] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A code loading method, the method is applied to an Internet of Things device, wherein: The IoT device supports executing code in the FLASH storage it carries by using an in-place execution XIP method; The memory carried by the IoT device includes a pre-allocated transit memory space; The method comprises: Obtain an ELF file that needs to be dynamically loaded, wherein the ELF file includes: at least one code segment; Reading code segments from the at least one code segment in sequence according to the order of the at least one code segment in the ELF file, and determining whether the read code segment is a code segment that needs symbol relocation; If the read code segment is the first code segment that needs symbol relocation, read the first code segments from the first code segment in sequence according to the space size of the transit memory space, store the first code segment in the transit memory space based on the storage address of the first code segment in the transit memory space, and perform a symbol relocation operation on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage; and For any first code fragment stored in the transit memory space, based on the storage address of the first code fragment in the FLASH storage, the first code fragment is stored in the FLASH storage, so as to execute the ELF file in the FLASH storage in an XIP manner.
2. The method of claim 1, storing the first code segment in the FLASH storage based on the storage address of the first code segment in the FLASH storage, comprising: Further determining whether the code segment to which the first code segment belongs is a code segment with immutable parameters; If yes, based on the storage address of the first code segment with immutable parameters in the FLASH storage, the first code segment with immutable parameters is stored in the FLASH storage.
3. The method according to claim 2, wherein the code segment with immutable parameters comprises: text code segment, rodata code segment.
4. According to the method of claim 3, the memory space of the memory carried by the IoT device includes: Static memory space and dynamic memory space; The static memory space is a pre-allocated memory space of a fixed size; The dynamic memory space is a memory space used to dynamically allocate the transfer memory space; Based on the storage address of the first code segment in the FLASH storage, storing the first code segment in the FLASH storage includes: Further determining whether the code segment to which the first code segment belongs is a code segment with immutable parameters; If not, based on the storage address of the first code segment with variable parameters in the static memory space, the first code segment with variable parameters is stored in the static memory space, and based on the storage address of the first code segment with variable parameters in the FLASH storage, the first code segment with variable parameters stored in the static memory space is further stored in the FLASH storage.
5. The method according to claim 4, wherein the basic ELF file is pre-loaded in the IoT device; The code segments with variable parameters include: data code segments and bss code segments; Based on the storage address of the first code segment with variable parameters in the static memory space, storing the first code segment with variable parameters in the static memory space, and based on the storage address of the first code segment with variable parameters in the FLASH storage, further storing the first code segment with variable parameters stored in the static memory space in the FLASH storage, including: Based on the tail address of the bss code segment contained in the basic ELF file in the static memory space, and the space size of the static memory space, determine the storage addresses of the data code segment and the bss code segment contained in the ELF file that needs to be dynamically loaded in the static memory space; Based on the storage addresses of the data code segment and the bss code segment contained in the ELF file to be dynamically loaded in the static memory space, the data code segment and the bss code segment are stored in the static memory space, and the data code segment in the static memory space is further stored in the FLASH storage; and, A parameter file corresponding to the ELF file is constructed according to the storage address and actual length of the data code segment in the FLASH storage, the storage address of the data code segment in the static memory space, and the maximum total length of the data code segment and the bss code segment.
6. The method according to claim 5, wherein the bss code segment contained in the ELF file that needs to be dynamically loaded is used to store uninitialized global variables or static variables; wherein, The bss code segment does not occupy actual storage space in the ELF file; The method further comprises: Monitoring that the IoT device is powered on again after power failure, and detecting whether a parameter file corresponding to the ELF file is stored in the file system of the IoT device; If so, based on the storage address and actual length of the data code segment contained in the ELF file in the FLASH storage, the data code segment is read from the FLASH storage, and based on the storage address of the data code segment in the static memory space, the data code segment in the FLASH storage is stored in the static memory space, and the bss code segment is stored in the static memory space.
7. The method according to claim 6, storing the bss code segment in the static memory space, comprising: Determine the actual length of the bss code segment based on the difference between the maximum total length and the actual length of the data code segment; Determine the storage address of the bss code segment in the static memory space based on the storage address of the data code segment in the static memory space and the actual length of the data code segment; Based on the actual length of the bss code segment and the storage address of the bss code segment in the static memory space, the storage space size of the bss code segment in the static memory space is determined, and based on the storage space size of the bss code segment in the static memory space, the bss code segment is stored in the static memory space.
8. The method of claim 1, further comprising: If the read code segment is a second code segment that does not require symbol relocation, determining whether an actual length of the second code segment is greater than a preset space size of the transfer memory space; If so, based on the preset space size, the second code segment is divided to obtain at least one second code segment, and the second code segments are stored in the transit memory space in sequence according to the order of the second code segments in the second code segments, and the second code segments stored in the transit memory space are stored in the FLASH storage.
9. The method according to claim 1, before sequentially reading the first code segments from the first code segments according to the size of the transfer memory space, the method further comprises: In the process of storing the first code segment read from the first code segment into the transit memory space, based on the actual length of the first code segment in the first code segment that has not yet been stored in the FLASH storage, the space size of the transit memory space is dynamically adjusted, and the transit memory space is dynamically allocated in the memory carried by the Internet of Things device based on the determined space size.
10. The method of claim 5, further comprising: Read the parameter file corresponding to the ELF file; Determine whether the number of exception marks in the ELF file is greater than a set number; If yes, refuse to load the data code segment and the bss code segment in the ELF file, and delete the loaded part in the ELF file; If not, load the data code segment and the bss code segment in the ELF file, and add an exception mark in the ELF file to indicate that the loading is rejected. If the running time of the loaded ELF file is greater than the set running time, reduce an exception mark in the ELF file and continue to run the ELF file.
11. The method of claim 10, wherein the set runtime is greater than the duration required to delete the data code segment and the bss code segment in the ELF file.
12. The method according to claim 1, wherein the ELF file is an ELF file generated based on an executable code corresponding to an SDK application running on an IoT device.
13. The method of claim 1, wherein the ELF file further comprises: A relocatable file (Relocatablefile), wherein the relocatable file is used to link with other relocatable files.
14. A code loading device, the device being applied to an Internet of Things device, wherein: The IoT device supports executing code in the FLASH storage it carries by using an in-place XIP execution method; The memory carried by the IoT device includes a pre-allocated transit memory space; The device comprises: An acquisition module is used to acquire an ELF file that needs to be dynamically loaded, wherein the ELF file includes: at least one code segment; A reading module, used for reading code segments from the at least one code segment in sequence according to the order of the at least one code segment in the ELF file, and determining whether the read code segment is a code segment that needs symbol relocation; a storage module, configured to, if the read code segment is a first code segment that needs symbol relocation, sequentially read the first code segments from the first code segment according to the space size of the transit memory space, store the first code segment in the transit memory space based on the storage address of the first code segment in the transit memory space, and perform a symbol relocation operation on the first code segment to map the symbol address corresponding to the identifier included in the first code segment to the storage address of the identifier in the FLASH storage; and; An execution module is used to store any first code fragment stored in the transit memory space in the FLASH storage based on the storage address of the first code fragment in the FLASH storage, so as to execute the ELF file in the FLASH storage in an XIP manner.
15. An electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 13 by calling the machine-readable instructions.
16. A machine-readable storage medium storing machine-readable instructions, wherein the machine-readable instructions, when called and executed by a processor, implement the method according to any one of claims 1 to 13.
Citation Information
Cited By
HSM firmware starting method and device, equipment and storage medium
CN120469729A
HSM firmware startup method, device, equipment and storage medium
CN120469729B
Embedded operating system dynamic loading method based on LoongArch processor
CN121387379A
A dynamic loading method of an embedded operating system based on a LoongArch processor
CN121387379B
