Multi-system startup management method and system based on many-core processor

By allocating processor cores and memory space to multi-core processors and using global variables to control system startup, the multi-system management problem on multi-core processors without global cache consistency is solved, and the coordinated operation and flexible management of multiple operating systems are achieved.

CN116225545BActive Publication Date: 2025-09-16NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310192237.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-02
Publication Date
2025-09-16
Estimated Expiration
2043-03-02

AI Technical Summary

Technical Problem

Existing technologies cannot directly run general-purpose operating systems and real-time systems on multi-core processors without global cache coherence, resulting in insufficient multi-core management capabilities.

Method used

By allocating processor cores and memory space to general-purpose operating systems and real-time systems respectively, and using global variables and array variables to control the start and pause of each system, multi-system collaborative operation can be achieved.

Benefits of technology

It achieves unified management of multiple operating systems on cache-free multi-core processors, reduces resource consumption, provides flexible start and stop control, and adapts to processors with different core counts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116225545B_ABST
    Figure CN116225545B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-system startup management method and system based on a many-core processor. The method includes allocating processor cores and memory space for a general-purpose operating system and a real-time system, respectively, and loading and running a startup program in the memory space to perform the following steps: the startup processor core globally initializes the general-purpose operating system and the real-time system; the processor core running the general-purpose operating system then starts and runs the general-purpose operating system on the current processor core, and controls the startup or pause of each real-time system through the global variable rtflag; the processor core running the real-time system enters the real-time system entry program and starts or pauses the real-time system according to changes in the global variable rtflag. The present invention can start the general-purpose operating system and the real-time system in the many-core processor so that they work together, realizing unified management of the cache-free coherent many-core processor using the operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an operating system startup technology in the field of network processing, and in particular to a multi-system startup management method and system based on a many-core processor. Background Art

[0002] When forwarding network data, many-core processors offer the same high flexibility as general-purpose processors while leveraging their multiple cores and high parallelism to achieve extremely high forwarding efficiency. In comparison, using dedicated forwarding chips significantly limits flexibility, while general-purpose processors lack parallelism and result in lower forwarding efficiency.

[0003] Many-core processors are multi-core processors with far more cores than typical multi-core processors. This high number of cores results in fewer hardware resources available to each core within the processor. Global cache coherence within the processor is difficult to implement and consumes a lot of hardware resources, which impacts parallel processing efficiency. To increase the number of cores and concurrent processing efficiency, many-core processors handling network data forwarding can sacrifice global cache coherence. This saves significant hardware resources and simplifies hardware design. Given the same hardware resources, more hardware resources are available for data forwarding, thereby improving data forwarding efficiency.

[0004] Traditional network processors use bare C language programs or even microcode programming to directly process network data. This makes programming difficult, processing complex, and development efficiency high. By running an operating system and leveraging the platform advantages of the operating system, the efficiency of network processing program development and operation and maintenance can be greatly improved.

[0005] Linux is an open-source, general-purpose operating system that runs on a wide variety of computer devices and processors. General-purpose Linux can only run on single-core processors and multi-core processors with global cache coherence, but cannot be directly used on multi-core processors without global cache coherence. A real-time operating system (RTOS) is a type of operating system that, compared to general-purpose operating systems like Linux and Windows, generally features streamlined code, single-function functionality, and low resource usage. Most RTOS operate in single-core mode and lack multi-core management capabilities. A few, such as VxWorks, do provide multi-core management capabilities, but they also rely on the global cache coherence mechanisms of multi-core processors. Neither Linux nor any other real-time systems can run directly on multi-core processors without global cache coherence. However, both Linux and real-time systems can run on a single core of a multi-core processor. If cache coherence is enabled on some cores of a multi-core processor, Linux can also be run on multiple cores within these cores. Real-time systems typically access memory directly using physical memory addresses. This eliminates the need for a memory management unit within the processor core, further simplifying hardware resource requirements. Applications in Linux systems access physical memory using virtual memory addresses. These addresses are automatically translated by the processor core's memory management unit (MMU) into physical memory addresses before final memory access. Linux also provides a feature called reserved memory. Physical memory addresses designated as reserved memory can be accessed directly using physical addresses under restricted conditions, without requiring address translation by the processor's MMU. For many-core processors without global cache coherence, how to manage the processor by running multiple operating systems (Linux plus multiple real-time operating systems (RTOSs)) and controlling the coordinated operation of these multiple operating systems has become a critical technical challenge that needs to be addressed. Summary of the Invention

[0006] Technical problem to be solved by the present invention: In response to the above-mentioned problems in the prior art, a multi-system startup management method and system based on a many-core processor are provided. The present invention can start a general operating system and a real-time system in the many-core processor to make them work together, and realize unified management of the cache-less consistent many-core processor using the operating system.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0008] A multi-system startup management method based on a many-core processor includes: allocating processor cores and memory space to a general operating system and a real-time system respectively, loading and running a startup program in the memory space to perform the following steps:

[0009] S101, determine whether the current processor core is the startup processor core, if the current processor core is the startup processor core, jump to S102, otherwise jump to S103;

[0010] S102, globally initialize the general operating system and the real-time system, set the global variable flag to 1, and jump to step S104;

[0011] S103, loop and wait for the global variable flag to become 1. If the global variable flag becomes 1, jump to step S104;

[0012] S104, determine whether the current processor core is a processor core running a general-purpose operating system. If the current processor core is a processor core running a general-purpose operating system, start and run the general-purpose operating system on the current processor core, and control the start or pause of each real-time system through the global variable rtflag. Otherwise, the current processor core enters the real-time system entry program and starts or pauses the real-time system according to the change of the global variable rtflag.

[0013] Optionally, the starting processor core in step S101 refers to the first processor core of the many-core processor.

[0014] Optionally, when allocating processor cores and memory space to the general operating system and the real-time system respectively, allocating processor cores to the general operating system and the real-time system includes: if the many-core processor includes multiple processor cores with cache consistency, allocating a specified number of processor cores with cache consistency to the general operating system, and allocating a real-time system to each of the remaining processor cores; if the many-core processor does not include multiple processor cores with cache consistency, allocating an independent processor core to the general operating system, and allocating a real-time system to each of the remaining processor cores.

[0015] Optionally, when allocating processor cores and memory space to the general operating system and the real-time system respectively, the memory space is divided into three parts: a startup program part, a real-time system part, and a general operating system part. The startup program part is used to load the startup program of each processor core, the real-time system part serves as the reserved memory of the general operating system, and the real-time system part is composed of memory intervals corresponding to the real-time systems one by one. The memory interval of each real-time system part loads the corresponding real-time system program; the general operating system part serves as the running memory of the general operating system.

[0016] Optionally, when allocating processor cores and memory space to the general operating system and real-time system respectively, the memory starting address of the startup program part is As1, the memory starting address of the real-time system part is As2, and the memory starting address of the general operating system part is As3, and As3=As2+Si×rN, where Si is the memory interval size allocated to the real-time system, and rN is the number of real-time systems.

[0017] Optionally, the memory start address As2 is stored as a constant gAs2 in the startup program part, the memory interval size Si allocated by the real-time system is stored as a constant gSi in the startup program part, the global variable flag is stored as a variable flag0 in the startup program part, and the global variable rtflag is stored as an array variable rtflag in the startup program part, and each element of the array variable rtflag corresponds to a real-time system.

[0018] Optionally, the global initialization of the general operating system and the real-time system in step S102 includes: copying the program of the general operating system to the memory of the general operating system part; copying the program of the real-time system to the memory of the real-time system part by rN copies, and the destination addresses of the copies are: gAs2, gAs2+Si, Si+2×Si, ..., Si+rN×Si, and the corresponding rN real-time systems are respectively recorded as rtos[1], rtos[2], ..., rtos[i], ..., rtos[rN]; copying the global variable rtFlag to rN copies, and copying one copy of the global variable rtFlag to each of the copied real-time systems, and recording the global variable rtFlag in any i-th real-time system rtos[i] as the system global variable rtFlag[i].

[0019] Optionally, the startup program portion further includes a global array constant vRtos for recording the address of the real-time system entry program. In step S104, the current processor core enters the real-time system entry program and starts or pauses the real-time system according to the change of the global variable rtflag, including: S201, the current processor core queries the global array constant vRtos for the position vrIndex of the current processor core number hartId in the global array constant vRtos to obtain the real-time system entry program address Si+vrIndex×Si, where Si is the size of the memory interval allocated by the real-time system; S202, determining the real-time system rtos[vrIndex] corresponding to the position vrIndex Whether the system global variable rtFlag[vrIndex] is 1, if it is 0, the real-time system rtos[vrIndex] is paused and the execution is jumped to S202; otherwise, the real-time system rtos[vrIndex] is started and the execution is jumped to S202 again; in step S104, the start or pause of each real-time system is controlled by the global variable rtflag, including: for any i-th real-time system rtos[i], if the i-th real-time system rtos[i] needs to be paused, the system global variable rtFlag[i] of the i-th real-time system rtos[i] is set to 0; otherwise, the system global variable rtFlag[i] of the i-th real-time system rtos[i] is set to 1.

[0020] In addition, the present invention also provides a multi-system boot management system based on a many-core processor, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the multi-system boot management method based on the many-core processor.

[0021] In addition, the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be programmed or configured by a microprocessor to execute the multi-system startup management method based on a many-core processor.

[0022] Compared with the prior art, the present invention mainly has the following advantages:

[0023] 1. The present invention can utilize global cache consistency between different operating systems without relying on the processor to solve the problem of management core utilization of multiple processor cores in a multi-core processor without cache consistency.

[0024] 2. The startup program of the present invention is simple and flexible, and can start different numbers of real-time systems according to different configurations of the number of processor cores, and is adaptable to a variety of processors with different numbers of processor cores.

[0025] 3. The present invention uses a real-time system as the business system, which reduces the resource consumption of the operating system and facilitates the writing of business programs. It uses a general operating system as the main control system and provides rich management functions.

[0026] 4. The present invention runs the startup core of the controller real-time system in a general operating system, and can dynamically start and stop the real-time system without restarting the device. It can start the general operating system and the real-time system in the many-core processor to make them work together, and realize the unified management of the cache-free consistent many-core processor using the operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 Schematic diagram of the basic process of the method of the embodiment of the present invention.

[0028] Figure 2 FIG. 4 is a schematic diagram of processor core distribution of a many-core processor according to an embodiment of the present invention.

[0029] Figure 3 This is an example of processor core allocation in which some processor cores have cache coherence in an embodiment of the present invention.

[0030] Figure 4 This is an example of processor core allocation in which all processor cores do not have cache coherence in an embodiment of the present invention.

[0031] Figure 5 This is an example of processor core allocation in which all processor cores have cache coherence in an embodiment of the present invention.

[0032] Figure 6 Schematic diagram of memory allocation in an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following will take the booting of a Linux system (a typical general-purpose operating system) plus multiple real-time operating systems (RTOS) as an example to further explain the multi-system boot management method based on a many-core processor of the present invention in detail.

[0034] like Figure 1 As shown, this embodiment of the multi-system startup management method based on the many-core processor includes: allocating processor cores and memory space to the general operating system and the real-time system respectively, loading and running the startup program in the memory space to perform the following steps:

[0035] S101, determine whether the current processor core is the startup processor core, if the current processor core is the startup processor core, jump to S102, otherwise jump to S103;

[0036] S102, globally initialize the general operating system and the real-time system, set the global variable flag to 1, and jump to step S104;

[0037] S103, loop and wait for the global variable flag to become 1. If the global variable flag becomes 1, jump to step S104;

[0038] S104, determine whether the current processor core is a processor core running a general-purpose operating system. If the current processor core is a processor core running a general-purpose operating system, start and run the general-purpose operating system on the current processor core, and control the start or pause of each real-time system through the global variable rtflag. Otherwise, the current processor core enters the real-time system entry program and starts or pauses the real-time system according to the change of the global variable rtflag.

[0039] The startup processor core in step S101 of this embodiment refers to the first processor core of the many-core processor.

[0040] When designing a many-core processor, different processor cores may or may not have cache consistency.

[0041] like Figure 2 As shown, processor cores 0, 1, 2, and 3 have cache coherence; processor cores 4, 5, 6, and 7 have cache coherence; processor cores 3 and 6 do not have cache coherence; and processor cores 8, 9, 10, 11, and so on do not have cache coherence. In this embodiment, when allocating processor cores and memory space to a general-purpose operating system and a real-time system, allocating processor cores to the general-purpose operating system and the real-time system includes: if the many-core processor includes multiple cache-coherent processor cores, allocating a specified number of cache-coherent processor cores to the general-purpose operating system and allocating a real-time system to each of the remaining processor cores; if the many-core processor does not include multiple cache-coherent processor cores, allocating a separate processor core to the general-purpose operating system and allocating a real-time system to each of the remaining processor cores. When starting multiple systems on a many-core processor using the solution of this embodiment, a group of cache-coherent processor cores is first selected and allocated to Linux for operation. For example, in a many-core processor, a group of cache-coherent processor cores C00, C01, ..., C0n are selected and allocated to the Linux system. This group of processor cores is used to jointly operate a Linux system. The remaining processor cores C10, C12, ..., C1m are all assigned to real-time systems, with each processor core running a real-time system. C00 is the startup core, which also performs global initialization work before the system starts during Linux system verification.

[0042] like Figure 3 As shown in the figure, processor cores 0, 1, 2, and 3 with cache coherence are assigned to Linux, and the remaining cores are assigned to RTOS, with each core running an RTOS system. The RTOS cores 4, 5, 6, and 7 with cache coherence are identical to the RTOS cores of the other processor cores without cache coherence. Figure 4 As shown in the figure, when all processor cores do not have cache coherence with each other, a single processor core can be selected to run Linux, and the remaining cores are allocated to RTOS, with each core running an RTOS system. When there are more cores with cache coherence, some of these processor cores can be allocated to Linux to run, as shown in the figure. Figure 5 As shown, all processor cores have cache consistency with each other, that is, the processors have global cache consistency. Processor cores 0, 1, 2, and 3 are assigned to Linux operation, and the remaining cores are assigned to RTOS, with each core running an RTOS system.

[0043] like Figure 6 As shown, in this embodiment, when allocating processor cores and memory space for the general operating system and the real-time system respectively, the memory space is divided into three parts: a startup program part, a real-time system part, and a general operating system part. The startup program part is used to load the startup program of each processor core, and the real-time system part serves as the reserved memory of the general operating system. The real-time system part is composed of memory intervals corresponding to the real-time systems one by one, and each memory interval of the real-time system part loads the program of the corresponding real-time system; the general operating system part serves as the running memory of the general operating system.

[0044] The memory space is divided into three main parts:

[0045] The first is the boot program part. The boot program is burned into this area and runs in this area. Each processor core in the processor first starts executing the program from the starting point of this area.

[0046] Next comes the real-time system portion. Since each processor core running a real-time system also runs a real-time system, multiple real-time systems can run simultaneously. Accordingly, the real-time system portion of memory consists of multiple copies of memory. When there are rN processor cores running rN real-time systems, the real-time system portion of memory consists of rN copies of memory, each of which is loaded with a real-time system program. The program in the first copy of memory is run by the processor core represented by the first element in the vRtos array; the program in the second copy of memory is run by the processor core represented by the second element in the vRtos array; and so on, with the program in the rNth copy of memory being run by the processor core represented by the rNth element in the vRtos array.

[0047] Finally, the Linux system portion occupies all remaining memory and is used to run the Linux system. The real-time system memory is configured as reserved memory in the Linux system. When the Linux system boots, the real-time system memory is treated as reserved memory and accessed through the reserved memory handling mechanism.

[0048] In this embodiment, when allocating processor cores and memory space to the general operating system and the real-time system respectively, the memory starting address of the startup program is As1 (the startup program is relatively small in size, and the additional memory required for running is also relatively small, and the approximate size can be estimated based on the actual usage scenario).

[0049] In this embodiment, the starting memory address of the real-time system is As2, which is calculated by adding the startup program size to As1 and a certain amount of reserved redundancy. This ensures that the value of As2 - As1 is greater than the startup program size. Each real-time system is allocated the same amount of memory. The services in the real-time system are relatively simple, and physical address process memory access is used directly. Memory usage is also predictable. The estimated memory usage plus a certain amount of redundancy yields the memory size allocated to each real-time system, denoted as Si. Let rN be the number of processor cores allocated to the real-time system. The memory occupied by the real-time system is Si × rN.

[0050] In this embodiment, the general operating system's memory starts at address As3, where As3 = As2 + Si × rN, where Si is the size of the memory interval allocated to the real-time system and rN is the number of real-time systems. All remaining memory outside the bootloader and real-time system segments is allocated to the Linux system, facilitating its handling of complex and changing tasks. Therefore, the Linux system's memory segment starts at address As2 + Si × M, which is As3.

[0051] In this embodiment, the memory start address As2 is stored as a constant gAs2 in the startup program part, the memory interval size Si allocated by the real-time system is stored as a constant gSi in the startup program part, the global variable flag is stored as a variable flag0 in the startup program part, and the global variable rtflag is stored as an array variable rtflag in the startup program part, and each element of the array variable rtflag corresponds to a real-time system.

[0052] Running the startup program is consistent with the startup of other mainstream operating systems and multi-core processors, with the difference being the startup program itself. The startup process is as follows: the startup program is pre-burned to the agreed starting address As1. When the processor starts, all processor cores independently and concurrently run the same startup program starting from As1. The startup program in this embodiment includes a global variable flag, with an initial value of 0, used to control the startup of each Linux processor core; a global constant gAs2, which is the starting address of the real-time system memory segment allocated in the first step, with a value of As2; a global constant gSi, which is the memory size allocated to each real-time system in the first step, with a value of Si; a global array constant vLinux, with the number of elements in the array equal to the number of processor cores allocated to Linux in the first step, and the array elements are the numbers of these processor cores; and a global array constant vRtos, with the number of elements in the array equal to the number of processor cores allocated to the real-time system in the first step, and the array elements are the numbers of these processor cores. The startup program also includes programs for the real-time system and Linux systems, which will be copied to the real-time system and Linux system memory portions in subsequent steps. The real-time system program includes the rtFlag global variable. The startup program checks the hartId of the currently running processor core. If hartId is the number of the C00 processor core, that is, the current processor core is the startup core, then jump to step 3 to continue execution; if hartId is C01, C02, ..., C0n or other processor core numbers used to run Linux, then jump to step 4 and enter the check waiting state.

[0053] The startup program enters the global core initialization execution phase. Since only one processor core is required to perform global initialization, only the designated startup core will execute this step. In this embodiment, the global initialization of the general operating system and the real-time system in step S102 includes: copying the general operating system program to the memory of the general operating system portion; copying the real-time system program rN copies to the memory of the real-time system portion, and the destination addresses of the copies are: gAs2, gAs2+Si, Si+2×Si, ..., Si+rN×Si, and the corresponding rN real-time systems are respectively recorded as rtos[1], rtos[2], ..., rtos[i], ..., rtos[rN]; copying the global variable rtFlag rN copies, respectively, copying one copy of the global variable rtFlag to each of the copied real-time systems, and recording the global variable rtFlag in any i-th real-time system rtos[i] as the system global variable rtFlag[i].

[0054] In this embodiment, the startup program portion further includes a global array constant vRtos for recording the address of the real-time system entry program. In step S104, the current processor core enters the real-time system entry program and starts or pauses the real-time system according to the change of the global variable rtflag, including the following steps: S201, the current processor core queries the global array constant vRtos for the position vrIndex of the current processor core number hartId in the global array constant vRtos to obtain the real-time system entry program address Si+vrIndex×Si, where Si is the size of the memory interval allocated by the real-time system; S202, determining the real-time system rtos[vrIndex] corresponding to the position vrIndex Whether the system global variable rtFlag[vrIndex] is 1, if it is 0, the real-time system rtos[vrIndex] is paused and the execution is jumped to S202; otherwise, the real-time system rtos[vrIndex] is started and the execution is jumped to S202 again; in step S104, the start or pause of each real-time system is controlled by the global variable rtflag, including: for any i-th real-time system rtos[i], if the i-th real-time system rtos[i] needs to be paused, the system global variable rtFlag[i] of the i-th real-time system rtos[i] is set to 0; otherwise, the system global variable rtFlag[i] of the i-th real-time system rtos[i] is set to 1.

[0055] If the current processor core in step S104 is a processor core running a general-purpose operating system, booting and running the general-purpose operating system on the current processor core is consistent with a typical Linux system boot. The difference is that the Linux system's reserved memory mechanism is utilized to configure all memory in the real-time system as Linux's reserved memory. After the Linux system boot is complete, unified scheduling and management are performed on each processor (C00, C01, ..., C0n). The execution of each processor (C00, C01, ..., C0n) in subsequent steps represents the execution of Linux. The Linux system runs various management services, including sharing the real-time system's memory using the reserved memory mechanism, thereby accessing and modifying variables within the real-time system. In Linux, the system global variable rtFlag[i] is set to 1 for each real-time system (rtos[i]) to be started, triggering the program running in the C1i processor core to exit the wait loop and enter the main service processing loop. When the real-time system (rtos[i]) needs to be stopped, the real-time system global variable rtFlag[i] is set to 0, triggering the real-time system to enter the wait loop and enter a stopped state. Any real-time system rtos[i] starts or pauses the real-time system based on the value of the real-time system variable rtFlag: the real-time system rtos[i] enters the main business processing loop and begins processing business. After the real-time system rtos[i] completes the main loop business processing, it checks the system global variable rtFlag[i]. If it is 0, it pauses; if it is 1, it starts the next round of business processing in the main loop.

[0056] In summary, the multi-system startup management method based on the multi-core processor in this embodiment is aimed at the demand for startup and operation of multiple operating systems in the field of network processing, and proposes a multi-system startup management method based on the multi-core processor, which can start multiple operating systems in a processor with multiple cores and make them work together, and realize the unified management of the non-cache consistent multi-core processor by the operating system. The method of this embodiment is a startup management method for a Linux system plus multiple real-time systems (RTOS), which runs multiple operating systems in the multi-core processor, and effectively solves the management problem of the multi-core processor in a non-cache consistent environment. It uses the powerful functions of Linux to provide system management capabilities and provides rich management capabilities; it uses the low hardware resource occupancy of the real-time system to prevent the running of multiple operating systems from consuming too many hardware resources; it uses the reserved memory mechanism of the Linux system to realize the memory sharing of the system when the Linux system verifies, and completes the startup control of the real-time system by the Linux system.

[0057] In addition, this embodiment also provides a multi-system boot management system based on a many-core processor, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the aforementioned multi-system boot management method based on a many-core processor.

[0058] In addition, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be programmed or configured by a microprocessor to execute the aforementioned multi-system startup management method based on a many-core processor.

[0059] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions described in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0060] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A multi-system startup management method based on a many-core processor, characterized in that: include: Allocate processor cores and memory space to the general operating system and real-time system respectively, load and run the startup program in the memory space to perform the following steps: S101, determine whether the current processor core is the startup processor core, if the current processor core is the startup processor core, jump to S102, otherwise jump to S103; S102, globally initialize the general operating system and the real-time system, set the global variable flag to 1, and jump to step S104; S103, loop and wait for the global variable flag to become 1. If the global variable flag becomes 1, jump to step S104; S104, determining whether the current processor core is a processor core running a general-purpose operating system. If the current processor core is a processor core running a general-purpose operating system, starting and running the general-purpose operating system on the current processor core, and controlling the start or pause of each real-time system through the global variable rtflag; otherwise, the current processor core enters the real-time system entry program, and starts or pauses the real-time system according to the change of the global variable rtflag; The startup processor core in step S101 refers to the first processor core of the many-core processor; When allocating processor cores and memory space to the general-purpose operating system and the real-time system respectively, allocating processor cores to the general-purpose operating system and the real-time system includes: if the many-core processor includes multiple processor cores with cache coherence, allocating a specified number of processor cores with cache coherence to the general-purpose operating system, and allocating a real-time system to each of the remaining processor cores; if the many-core processor does not include multiple processor cores with cache coherence, allocating an independent processor core to the general-purpose operating system, and allocating a real-time system to each of the remaining processor cores; When allocating processor cores and memory space to the general-purpose operating system and the real-time system respectively, the memory space is divided into three parts: a boot program part, a real-time system part, and a general-purpose operating system part. The boot program part is used to load the boot program of each processor core, and the real-time system part serves as reserved memory for the general-purpose operating system. The real-time system part is composed of memory intervals corresponding to real-time systems, and each memory interval of the real-time system part loads the program of the corresponding real-time system; The general operating system part serves as the running memory of the general operating system.

2. The multi-system startup management method based on a many-core processor according to claim 1, characterized in that: When allocating processor cores and memory space to the general operating system and real-time system respectively, the memory starting address of the startup program part is As1, the memory starting address of the real-time system part is As2, and the memory starting address of the general operating system part is As3, and As3=As2+Si×rN, where Si is the size of the memory interval allocated to the real-time system, and rN is the number of real-time systems.

3. The multi-system startup management method based on a many-core processor according to claim 2, characterized in that: The memory start address As2 is stored as the constant gAs2 in the startup program part, the memory interval size Si allocated by the real-time system is stored as the constant gSi in the startup program part, the global variable flag is stored as the variable flag0 in the startup program part, and the global variable rtflag is stored as the array variable rtflag in the startup program part. Each element of the array variable rtflag corresponds to a real-time system.

4. The multi-system startup management method based on a many-core processor according to claim 1, characterized in that: The global initialization of the general operating system and the real-time system in step S102 includes: copying the program of the general operating system to the memory of the general operating system; copying the program of the real-time system to the memory of the real-time system by rN copies, and the destination addresses of the copies are: gAs2, gAs2+Si, Si+2×Si, ..., Si+(rN-1)×Si, and the corresponding rN real-time systems are respectively recorded as rtos[1], rtos[2], ..., rtos[i], ..., rtos[rN]; copying the global variable rtFlag by rN copies, and copying one copy of the global variable rtFlag to each of the copied real-time systems, and recording the global variable rtFlag in any i-th real-time system rtos[i] as the system global variable rtFlag[i].

5. The multi-system startup management method based on many-core processors according to claim 1, characterized in that: The startup program part is also provided with a global array constant vRtos for recording the address of the real-time system entry program; in step S104, the current processor core enters the real-time system entry program, and starts or pauses the real-time system according to the change of the global variable rtflag, including: S201, the current processor core queries the position vrIndex of the current processor core number hartId in the global array constant vRtos, and obtains the real-time system entry program address Si+vrIndex×Si, where Si is the size of the memory interval allocated by the real-time system; S202, determines the real-time system rtos[vrIndex] corresponding to the position vrIndex Check whether the system global variable rtFlag[vrIndex] is 1. If it is 0, pause the real-time system rtos[vrIndex] and jump to execute S202; otherwise, start the real-time system rtos[vrIndex] and jump to execute S202 again. In step S104, controlling the start or pause of each real-time system through the global variable rtflag includes: for any i-th real-time system rtos[i], if the i-th real-time system rtos[i] needs to be paused, set the system global variable rtFlag[i] of the i-th real-time system rtos[i] to 0; otherwise, set the system global variable rtFlag[i] of the i-th real-time system rtos[i] to 1.

6. A multi-system boot management system based on a multi-core processor, comprising interconnected microprocessors and memories, characterized in that: The microprocessor is programmed or configured to execute the multi-system startup management method based on a many-core processor according to any one of claims 1 to 5.

7. A computer-readable storage medium storing a computer program, wherein: The computer program is used to be programmed or configured by a microprocessor to execute the multi-system startup management method based on a many-core processor according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Real-time system based on Windows driver

    CN102346687A

  • Control method for multiple operating systems of multi-core computer and multi-core computer

    CN102929719A