Heterogeneous multi-system booting method, device and storage medium based on Linux system

After the main Linux system starts, it parses the configuration file, generates a task queue, sets CPU resources and jump addresses, and executes the system startup program. This solves the security risk problem of multi-core CPUs running multiple heterogeneous operating systems and achieves safe heterogeneity. Multiple system startup.

CN118586007BActive Publication Date: 2024-10-18KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411066723.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-10-18
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

In the existing technology, there are security risks when multi-core CPUs run multiple heterogeneous operating systems, especially security issues caused by the mutual influence of kernels.

Method used

After the main Linux system starts normally, it parses the multi-system startup configuration files, generates a system loading task queue, determines resource requirements, sets CPU resources and jump addresses, and uses wake-up instructions to execute the system startup program to avoid kernel involvement.

Benefits of technology

It realizes the safe startup of heterogeneous multi-systems, avoids security risks caused by kernels interacting with each other, and ensures system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586007B_ABST
    Figure CN118586007B_ABST
Patent Text Reader

Abstract

The invention discloses a heterogeneous multi-system booting method, device and storage medium based on Linux system. The method comprises: after the main Linux system is normally started, parsing the multi-system startup configuration file, generating a system loading task queue according to the parsing result; reading the required system information from the system loading task queue, judging whether the current environment meets the resource requirements of the system; if the requirements are met, taking out the information of the loaded system from the system loading task queue, setting the CPU resources corresponding to the loaded system, and setting a jump address for the CPU resources, wherein the jump address corresponds to the register of the CPU resources; using a wake-up instruction, waking up the CPU to read the jump address in the register, and executing the system startup program; returning to reading the system information required to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system required to be loaded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of heterogeneous multi-systems, and in particular to a heterogeneous multi-system booting method, device and storage medium based on a Linux system. Background Art

[0002] The multi-core trend is changing the face of IT computing. Compared with the traditional single-core central processing unit (CPU), multi-core CPU has more advantages, such as stronger parallel processing capabilities, higher computing density and higher clock frequency, and greatly reduced heat dissipation and power consumption. In order to facilitate users to quickly migrate their business, using a hardware platform to run multiple heterogeneous operating systems at the same time has become the most reasonable solution.

[0003] In the prior art, virtual machines, multi-system startup, and docker container technical solutions are usually used to implement a solution where a hardware platform runs multiple systems at the same time. The virtual machine solution requires dedicated virtualization software, such as qemu, etc., and the host operating system generally needs to support virtualization functions, such as KVM functions. The use of virtual machine solutions has certain losses on the system. The use of docker technology has security risks, because all resources used by docker technology belong to the host machine, and it shares a kernel with the host machine. The use of multi-system startup usually uses the main kernel to start, and then uses the main kernel's operating system kernel to start the slave system, which will also cause the problem of kernels affecting each other, posing a security risk. Summary of the invention

[0004] The embodiments of the present invention provide a heterogeneous multi-system booting method, device and storage medium based on the Linux system to solve the technical problem in the prior art that there are security risks when a multi-core CPU runs multiple heterogeneous operating systems.

[0005] In a first aspect, an embodiment of the present invention provides a heterogeneous multi-system booting method based on a Linux system, comprising:

[0006] After the main Linux system starts normally, parse the multi-system startup configuration files and generate a system loading task queue based on the parsing results;

[0007] Reading the system information to be loaded from the system loading task queue, and determining whether the current environment meets the resource requirements of the system;

[0008] When the conditions are met, the information of the loaded system is taken out from the system loading task queue, the CPU resources corresponding to the loaded system are set, and a jump address is set for the CPU resources, where the jump address corresponds to a register of the CPU resources;

[0009] Using the wake-up instruction, the CPU is woken up to read the jump address in the register and execute the startup program of the system;

[0010] Return to reading the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

[0011] In a second aspect, an embodiment of the present invention further provides a heterogeneous multi-system booting device based on a Linux system, comprising:

[0012] The parsing module is used to parse the multi-system startup configuration files after the main Linux system is started normally, and generate the system loading task queue according to the parsing results;

[0013] A reading module is used to read the system information to be loaded from the system loading task queue and determine whether the current environment meets the resource requirements of the system;

[0014] A setting module, used for taking out the information of the loaded system from the system loading task queue when the conditions are met, setting the CPU resources corresponding to the loaded system, and setting a jump address for the CPU resources, wherein the jump address corresponds to a register of the CPU resources;

[0015] A wake-up module, used to use a wake-up instruction to wake up the CPU to read the jump address in the register and execute the startup program of the system;

[0016] The return module is used to return the system information to be loaded read from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

[0017] In a third aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the heterogeneous multi-system booting method based on the Linux system as provided in the above embodiment.

[0018] The heterogeneous multi-system booting method, device and storage medium based on Linux system provided by the embodiment of the present invention are as follows: after the main Linux system is normally started, the multi-system startup configuration file is parsed, and a system loading task queue is generated according to the parsing result; the system information to be loaded is read from the system loading task queue to determine whether the current environment meets the resource requirements of the system; when the requirements are met, the information of the loaded system is taken out from the system loading task queue, the CPU resources corresponding to the loaded system are set, and the jump address is set for the CPU resources, and the jump address corresponds to the register of the CPU resources; the CPU is awakened by a wake-up instruction to read the jump address in the register and execute the startup program of the system; the system information to be loaded is read from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded. According to the heterogeneous multi-system set by the user, the loaded system can be determined, the corresponding CPU resources can be determined, and the corresponding CPU resources can be awakened, and the corresponding system can be started by reading the jump address of the register, and the heterogeneous multi-system startup can be realized without the participation of the kernel of the Linux system. The security problems caused by the mutual influence of the kernel are avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0020] Figure 1 It is a flowchart of a heterogeneous multi-system booting method based on a Linux system provided in Embodiment 1 of the present invention;

[0021] Figure 2 It is a flowchart of a heterogeneous multi-system booting method based on a Linux system provided in Embodiment 2 of the present invention;

[0022] Figure 3 It is a schematic diagram of the structure of a heterogeneous multi-system booting device based on a Linux system provided in the third embodiment of the present invention. DETAILED DESCRIPTION

[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0024] Embodiment 1

[0025] Figure 11 is a flowchart of a heterogeneous multi-system booting method based on a Linux system provided in Embodiment 1 of the present invention. This embodiment is applicable to booting heterogeneous operating systems in a multi-core system. The method can be executed by a heterogeneous multi-system booting device based on a Linux system, and specifically includes the following steps:

[0026] Step 110, after the main Linux system is started normally, parse the multi-system startup configuration file, and generate a system loading task queue according to the parsing result.

[0027] In this embodiment, the Linux system can be used as the main system to realize multi-system startup. In this embodiment, taking Feiteng's D2000 device as an example, it is first powered on. The uboot boot program is used to realize the startup of the main Linux system.

[0028] Optionally, move the uboot boot program to the memory and jump to uboot to start the main Linux system. By moving the uboot boot program to the memory, you can avoid repeatedly erasing and writing in the firmware flash, which may cause flash damage.

[0029] Then determine whether the Uboot program is running on CPU1. When running on CPU1, use the register jump address of CPU1 to start the main Linux system. In this embodiment, the main system must run on CPU1, that is, CPU numbered 0, in order to start the main Linux system. If it runs on other CPUs, the CPU needs to be hibernated.

[0030] In this embodiment, a multi-system startup configuration file can be generated according to user needs, wherein the type of each heterogeneous system, required resources and other information can be set. Exemplarily, the multi-system startup configuration file can be in XML file format. It is convenient to read the corresponding configuration information. By parsing the multi-system startup configuration file, each heterogeneous system information and the required system resources, such as CPU resources, memory resources and device resources, can be obtained. Exemplarily, the operating resources required for each system can also be obtained according to the analysis results, and it can be determined whether there is a conflict in the operating resources of each system. When there is no conflict, a system loading task queue is generated according to the analysis results. This is to avoid the situation where the subsequent system cannot be loaded due to resource conflicts. According to the above information, a system loading task queue is generated according to the arrangement of the heterogeneous system information.

[0031] Step 120, reading the system information to be loaded from the system loading task queue, and determining whether the current environment meets the resource requirements of the system.

[0032] The information of the first system to be loaded in the queue is read from the system loading task queue. The loaded system can be a heterogeneous system such as Linux, FreeRTOS, VXWorks, etc., which is determined by the multi-system startup configuration file. The remaining resources are queried through the hardware query instruction. The remaining resources can be all the resources of the hardware platform minus the resources of the started system. And it is determined whether the remaining resources can meet the resources of the system to be loaded.

[0033] Step 130, when the conditions are met, retrieve the information of the loaded system from the system loading task queue, set the CPU resources corresponding to the loaded system, and set a jump address for the CPU resources, wherein the jump address corresponds to the register of the CPU resources.

[0034] If the resources of the loaded system are satisfied, the environment for starting the loaded system can be set according to the information of the loaded heterogeneous system, including the CPU startup environment and the memory environment. For example, the corresponding CPU resources, that is, the CPU used by the system, can be set. The jump address can be set using the register of the CPU, and the jump address can correspond to the startup file of the system stored in the main Linux system.

[0035] In addition, the corresponding actual memory address range can be determined based on the allocated memory resources, and the actual memory address range can be passed into the system startup file so that the system startup file can establish a mapping between the actual memory address and the operating system virtual memory address. In this way, multiple heterogeneous systems can be adapted to the actual memory environment.

[0036] Optionally, the setting of the CPU resources corresponding to the loaded system can be optimized to: determine whether the current CPU resources, memory resources and peripheral resources required by the loaded system are met; if they are met, set the CPU resources corresponding to the loaded system. The above method can avoid the problem of the system being unable to load due to the resource requirements of some special systems.

[0037] Step 140: Using a wake-up instruction, the CPU is woken up to read the jump address in the register and execute the startup program of the system.

[0038] The CPU assigned to the system is awakened by the CPU wake-up instruction, and the awakened CPU is used to read the jump address configured by the register in the above step, and the system startup program is executed by using the jump address to realize the startup of the heterogeneous system. It can be seen from the above steps that when the heterogeneous system is started, the kernel information of the main Linux system is not required, so there will be no security issues.

[0039] Optionally, before using the wake-up instruction, the method may further include the following step: allocating memory resources corresponding to the CPU resources to the loaded system, wherein the memory resources meet the system configuration requirements in the multi-system startup configuration file. Since the loaded system does not have the flash memory resources of the conventional system, it is necessary to allocate some resources from the memory resources for it to complete the loading and startup requirements of the loaded system.

[0040] Step 150, return to read the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

[0041] The corresponding system information to be loaded is sequentially taken out from the system loading task queue, and the above steps are repeated to sequentially complete the startup of all heterogeneous systems in the system loading task queue. Until the system loading task queue is empty, it indicates that all heterogeneous systems have been loaded, or the current environment cannot meet the resource requirements of the system to be loaded, that is, the platform can no longer meet the resources required for loading the new heterogeneous system.

[0042] This embodiment parses the multi-system startup configuration file after the main Linux system is started normally, and generates a system loading task queue according to the parsing result; reads the system information to be loaded from the system loading task queue to determine whether the current environment meets the resource requirements of the system; if it meets the requirements, takes out the information of the loaded system from the system loading task queue, sets the CPU resources corresponding to the loaded system, and sets a jump address for the CPU resources, and the jump address corresponds to the register of the CPU resources; uses the wake-up instruction to wake up the CPU to read the jump address in the register and execute the startup program of the system; returns to read the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded. According to the heterogeneous multi-system set by the user, the loaded system can be determined, the corresponding CPU resources can be determined, and the corresponding CPU resources can be awakened. The corresponding system can be started by reading the jump address of the register, and the heterogeneous multi-system startup can be realized without the participation of the kernel of the Linux system. Security issues caused by the mutual influence of kernels are avoided.

[0043] Embodiment 2

[0044] Figure 2It is a flow chart of a heterogeneous multi-system booting method based on a Linux system provided in the second embodiment of the present invention. This embodiment is optimized based on the above embodiment, and the parsing of the multi-system startup configuration file is specifically optimized as follows: parsing to obtain type tags in the multi-system startup configuration file, the type tags including: system priority type, resource priority type and resource system coexistence type; parsing to obtain system resources required for each heterogeneous system. Further, the generation of the system loading task queue according to the analysis result is specifically optimized as follows: determine whether the required system resources conflict, and when there is no conflict, determine the type tag; when it is a system priority type, read the priority of each heterogeneous system; generate the system loading task queue according to the priority order of each heterogeneous system; when it is a resource priority type, generate multiple satisfying heterogeneous system queues according to existing resources; select the satisfying heterogeneous system queue with the largest number of heterogeneous systems from the multiple satisfying heterogeneous system queues as the system loading task queue; when it is a resource system coexistence type, generate a required system queue according to the priority order of the multiple heterogeneous systems; calculate the system resources required for the required system queue, and calculate the remaining system resources based on the required system resources, and generate the remaining satisfying heterogeneous system queues based on the remaining system resources; generate the system loading task queue according to the required system queue and the remaining satisfying heterogeneous system queues.

[0045] See also Figure 2 , the heterogeneous multi-system booting method based on the Linux system comprises:

[0046] Step 210: After the main Linux system is started normally, the type tag in the multi-system startup configuration file is parsed to obtain the system resources required by each heterogeneous system.

[0047] In this embodiment, the user can add a type tag in the multi-system startup configuration file. For example, the type tag may include: system priority type, resource priority type, and resource system coexistence type. According to the selected tag, different multi-heterogeneous system loading can be achieved according to requirements. And the system resources required by each heterogeneous system can also be obtained through the parsing results.

[0048] Step 220, determine whether the required system resources conflict, and when there is no conflict, determine the type tag; when it is a system priority type, read the priority of each heterogeneous system; generate a system loading task queue according to the priority order of each heterogeneous system.

[0049] In this embodiment, a preliminary judgment can first be made through software, that is, the maximum CPU resources, memory resources and device resources of the platform are compared with the total resources required by all heterogeneous systems. When they are less than, it can be considered that there is no conflict, so as to avoid the system resources required by the generated queue exceeding the scope provided by the platform, thereby reducing the possibility of termination after the evaluation of each heterogeneous system is started later.

[0050] Optionally, the system priority type can be a priority set by the user for the heterogeneous systems to be started according to the importance of the heterogeneous systems to be started, and the platform generates a loading task queue according to the set priority, and starts the heterogeneous systems according to the priority. Exemplarily, the system loading task queue can be generated according to the priority order.

[0051] Step 230, when it is a resource priority type, multiple heterogeneous system queues are generated according to existing resource calculations, and a heterogeneous system queue with the largest number of heterogeneous systems is selected from the multiple heterogeneous system queues as the system loading task queue.

[0052] In this embodiment, the resource priority type may be to start the maximum number of heterogeneous systems as much as possible according to the maximum performance that the platform can provide. When the resource priority type is determined, multiple heterogeneous system queues can be generated by enumerating different combinations based on the information of all heterogeneous systems recorded in the multi-system startup configuration file, and each heterogeneous system queue can meet the requirement of less than the resources provided by the platform. Then, the number of heterogeneous systems in each heterogeneous system queue is compared in turn, and the heterogeneous system queue with the largest number is selected as the system loading task queue.

[0053] Step 240, when it is a resource system coexistence type, generate a required system queue according to the priority order of the multiple heterogeneous systems; calculate the system resources required for the required system queue, and calculate the remaining system resources based on the required system resources, and generate a remaining satisfied heterogeneous system queue based on the remaining system resources; generate a system loading task queue based on the required system queue and the remaining satisfied heterogeneous system queue.

[0054] In this embodiment, the resource system coexistence type can be to start as many heterogeneous systems as possible on the basis of the heterogeneous systems that need to be started to meet the needs of users. In response to this requirement, a required system queue is first generated according to the priority order of the multiple heterogeneous systems. The system resources required by all systems in the required system queue are subtracted from the resources provided by the platform system to obtain the remaining system resources, and the queue with the largest number of heterogeneous systems can be obtained by the aforementioned method as the queue for satisfying heterogeneous systems. The required system queue is merged with the remaining queues of satisfying heterogeneous systems to generate a system loading task queue.

[0055] Step 250, read the system information to be loaded from the system loading task queue, and determine whether the current environment meets the resource requirements of the system.

[0056] Step 260, when satisfied, takes out the information of the loaded system from the system loading task queue, sets the CPU resources corresponding to the loaded system, and sets a jump address for the CPU resources, wherein the jump address corresponds to the register of the CPU resources.

[0057] Step 270: Use the wake-up instruction to wake up the CPU to read the jump address in the register and execute the startup program of the system.

[0058] Step 280, return to read the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

[0059] This embodiment optimizes the parsing of the multi-system startup configuration file to: parse and obtain the type tag in the multi-system startup configuration file, the type tag includes: system priority type, resource priority type and resource system coexistence type; parse and obtain the system resources required by each heterogeneous system. Further, the generation of the system loading task queue according to the parsing result is optimized to: determine whether the required system resources conflict, and when there is no conflict, determine the type tag; when it is the system priority type, read the priority of each heterogeneous system; generate the system loading task queue according to the priority order of each heterogeneous system; when it is the resource priority type, calculate and generate multiple heterogeneous system queues according to the existing resources; select the heterogeneous system queue with the largest number of heterogeneous systems from the multiple heterogeneous system queues as the system loading task queue; when it is the resource system coexistence type, generate the required system queue according to the priority order of the multiple heterogeneous systems; calculate the system resources required by the required system queue, and calculate the remaining system resources according to the required system resources, and generate the remaining heterogeneous system queue according to the remaining system resources; generate the system loading task queue according to the required system queue and the remaining heterogeneous system queue. It can flexibly generate various system loading task queues according to different user needs, and realize the startup and guidance of multiple heterogeneous systems on the same platform.

[0060] Embodiment 3

[0061] Figure 3 is a schematic diagram of the structure of a heterogeneous multi-system boot device based on a Linux system provided by Embodiment 3 of the present invention, see Figure 3 , the heterogeneous multi-system boot device based on the Linux system comprises:

[0062] The parsing module 310 is used to parse the multi-system startup configuration files after the main Linux system is normally started, and generate a system loading task queue according to the parsing result;

[0063] The reading module 320 is used to read the system information to be loaded from the system loading task queue and determine whether the current environment meets the resource requirements of the system;

[0064] A setting module 330, configured to fetch the information of the loaded system from the system loading task queue when the conditions are met, set the CPU resources corresponding to the loaded system, and set a jump address for the CPU resources, wherein the jump address corresponds to a register of the CPU resources;

[0065] A wake-up module 340 is used to use a wake-up instruction to wake up the CPU to read the jump address in the register and execute the startup program of the system;

[0066] The return module 350 is used to return the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

[0067] The heterogeneous multi-system boot device based on the Linux system provided in this embodiment parses the multi-system startup configuration file after the main Linux system is normally started, and generates a system loading task queue according to the parsing result; reads the system information to be loaded from the system loading task queue to determine whether the current environment meets the resource requirements of the system; if it meets the requirements, takes out the information of the loaded system from the system loading task queue, sets the CPU resources corresponding to the loaded system, and sets a jump address for the CPU resources, and the jump address corresponds to the register of the CPU resources; uses the wake-up instruction to wake up the CPU to read the jump address in the register and execute the startup program of the system; returns to read the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded. According to the heterogeneous multi-system set by the user, the loaded system can be determined, the corresponding CPU resources can be determined, and the corresponding CPU resources can be woken up, and the corresponding system can be started by reading the jump address of the register, without the participation of the kernel of the Linux system, and the startup of the heterogeneous multi-system can be realized. The security issues caused by the mutual influence of the kernel are avoided.

[0068] Based on the above embodiments, the parsing module includes:

[0069] The judgment unit is used to obtain the operating resources required by each system according to the analysis result, and judge whether the operating resources of each system exist. When there is no conflict, a system loading task queue is generated according to the analysis result.

[0070] Based on the above embodiments, the device further includes:

[0071] The memory resource allocation module is used to allocate memory resources corresponding to the CPU resources to the loaded system, and the memory resources meet the system configuration requirements in the multi-system startup configuration file.

[0072] Based on the above embodiments, the device further includes:

[0073] The startup module is used to power on the system and start the Uboot boot program;

[0074] The main system startup module is used to determine whether the Uboot program is running on CPU1. When running on CPU1, the main Linux system is started using the register jump address of CPU1.

[0075] Based on the above embodiments, the device further includes:

[0076] The sleep module is used to sleep the current CPU when the Uboot program is not running on CPU1.

[0077] Based on the above embodiments, the setting module includes:

[0078] A compliance determination unit, used to determine whether the current environment complies with the CPU resources, memory resources and peripheral resources required by the loaded system;

[0079] The setting unit is used to set the CPU resources corresponding to the loaded system when it meets the requirements.

[0080] Based on the above embodiments, the parsing module includes:

[0081] A type tag parsing unit, used for parsing and obtaining type tags in the multi-system startup configuration file, wherein the type tags include: system priority type, resource priority type and resource system coexistence type;

[0082] The system resource analysis unit is used to analyze and obtain the system resources required by each heterogeneous system.

[0083] Based on the above embodiments, the analysis module further includes:

[0084] A type tag determination unit, used to determine whether the required system resources conflict, and when there is no conflict, determine the type tag;

[0085] A priority reading unit, used for reading the priority of each heterogeneous system when it is a system priority type;

[0086] A first system loading task queue generating unit, configured to generate a system loading task queue according to a priority order of each heterogeneous system;

[0087] A heterogeneous system queue calculation unit is used to generate multiple heterogeneous system queues according to existing resource calculations when the resource priority type is selected;

[0088] A selection unit, configured to select a heterogeneous system queue having the largest number of heterogeneous systems from the plurality of heterogeneous system queues as a system loading task queue;

[0089] A necessary system queue generation unit, used for generating necessary system queues according to the priority order of multiple heterogeneous systems when the resource system coexists;

[0090] a remaining satisfied heterogeneous system queue generating unit, configured to calculate the system resources required by the required system queue, obtain the remaining system resources based on the required system resources, and generate the remaining satisfied heterogeneous system queue based on the remaining system resources;

[0091] The second system loading task queue generating unit is configured to generate a system loading task queue according to the required system queue and the remaining satisfying heterogeneous system queues.

[0092] The heterogeneous multi-system booting device based on the Linux system provided in the embodiment of the present invention can execute the heterogeneous multi-system booting method based on the Linux system provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0093] Embodiment 4

[0094] Embodiment 4 of the present invention further provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute any of the heterogeneous multi-system booting methods based on the Linux system provided in the above embodiments.

[0095] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.

[0096] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0097] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0098] Computer program code for performing the operation of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0099] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A heterogeneous multi-system booting method based on Linux system, It is characterized in that include: After the main Linux system starts normally, parse the multi-system startup configuration files and generate a system loading task queue based on the parsing results; Reading the system information to be loaded from the system loading task queue, and determining whether the current environment meets the resource requirements of the system; When the conditions are met, the information of the loaded system is taken out from the system loading task queue, the CPU resources corresponding to the loaded system are set, and a jump address is set for the CPU resources, where the jump address corresponds to a register of the CPU resources; Using the wake-up instruction, the CPU is woken up to read the jump address in the register and execute the startup program of the system; Return to reading the system information to be loaded from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

2. The method according to claim 1, It is characterized in that The step of parsing the multi-system startup configuration files and generating a system loading task queue according to the parsing results includes: The operating resources required by each system are obtained according to the analysis results, and it is determined whether there is a conflict in the operating resources of each system. When there is no conflict, a system loading task queue is generated according to the analysis results.

3. The method according to claim 1, It is characterized in that Before using the wake-up instruction, the method further includes: Memory resources corresponding to the CPU resources are allocated to the loaded system, and the memory resources meet the system configuration requirements in the multi-system startup configuration file.

4. The method according to claim 1, It is characterized in that Before parsing the multi-system startup configuration file, the method further includes: Power on the system and start the Uboot boot program; Determine whether the Uboot program is running on CPU1. When running on CPU1, use the register jump address of CPU1 to start the main Linux system.

5. The method according to claim 1, It is characterized in that The method further comprises: When the Uboot program is not running on CPU1, the current CPU is hibernated.

6. The method according to claim 1, It is characterized in that The setting of the CPU resources corresponding to the loaded system also includes: Determine whether the current environment meets the CPU resources, memory resources and peripheral resources required by the loaded system; When it matches, set the CPU resources corresponding to the loaded system.

7. The method according to claim 1, It is characterized in that The parsing of the multi-system startup configuration file includes: Parsing and obtaining type tags in the multi-system startup configuration file, the type tags including: system priority type, resource priority type and resource system coexistence type; Analyze and obtain the system resources required for each heterogeneous system.

8. The method according to claim 7, It is characterized in that The step of generating a system loading task queue according to the parsing result includes: Determine whether the required system resources conflict, and if there is no conflict, determine the type tag; When the system priority type is selected, read the priority of each heterogeneous system; Generate a system loading task queue according to the priority order of each heterogeneous system; When the resource priority type is selected, multiple queues that meet the heterogeneous system requirements are generated based on the existing resource calculations; Selecting a heterogeneous system queue with the largest number of heterogeneous systems from the plurality of heterogeneous system queues as a system loading task queue; When the resource system coexists, a required system queue is generated according to the priority order of multiple heterogeneous systems; Calculating the system resources required by the required system queue, calculating the remaining system resources according to the required system resources, and generating the remaining satisfied heterogeneous system queues according to the remaining system resources; A system loading task queue is generated according to the required system queue and the remaining satisfying heterogeneous system queues.

9. A heterogeneous multi-system boot device based on Linux system, It is characterized in that include: The parsing module is used to parse the multi-system startup configuration files after the main Linux system is started normally, and generate the system loading task queue according to the parsing results; A reading module is used to read the system information to be loaded from the system loading task queue and determine whether the current environment meets the resource requirements of the system; A setting module, used for taking out the information of the loaded system from the system loading task queue when the conditions are met, setting the CPU resources corresponding to the loaded system, and setting a jump address for the CPU resources, wherein the jump address corresponds to a register of the CPU resources; A wake-up module, used to use a wake-up instruction to wake up the CPU to read the jump address in the register and execute the startup program of the system; The return module is used to return the system information to be loaded read from the system loading task queue until the system loading task queue is empty or the current environment cannot meet the resource requirements of the system to be loaded.

10. A storage medium containing computer executable instructions, It is characterized in that The computer executable instructions are used to execute the heterogeneous multi-system booting method based on the Linux system as described in any one of claims 1-8 when executed by a computer processor.

Citation Information

Patent Citations

  • Embedded multisystem self-starting method

    CN102880496A

  • Method and device for starting multiple operating systems on multi-core CPU

    CN108108199A