Multi-core operating system starting method, device, equipment, medium and product
After the multi-core controller is powered on, the main core initializes and increases the clock frequency, turns on the cache function, and optimizes the slave core startup process, it solves the problem of the multi-core operating system startup time and achieves faster controller startup.
Patent Information
- Application Number
- CN202411258495.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-26
AI Technical Summary
The startup time of a multi-core operating system is too long, which causes the controller to start timeout, mainly because the main core starts too long and the redundant part of the slave core start process.
After powering on the multi-core controller, the main core executes preset startup code to initialize, improves the main core clock frequency, turns on the enable cache function, and initializes the system random access memory to complete the startup of the main core and slave core. , optimize the start process of the kernel and remove redundant operations.
It effectively shortens the startup time of the multi-core operating system, improves the execution speed of operation instructions, and solves the problem of controller startup timeout.
Smart Images

Figure CN119025170A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a multi-core operating system startup method, device, equipment, medium and product. Background Art
[0002] With the development of automobile intelligence and electrification, the demand for automotive-grade chips in complete vehicles has exploded.
[0003] The domestic MCU chip selected for the power domain controller has a total of three available CPU cores, which are referred to as core 0, core 1, and core 2 for ease of description. Due to chip hardware limitations, core 0 and core 1 are slave cores, and core 2 is the master core. The operating system uses a domestic multi-core operating system that supports the AUTOSAR standard, which provides better performance and more efficient task processing capabilities.
[0004] However, during the actual project development process, it was found that the startup of the main core (core 2) chip took too long and there were redundant parts in the startup process of the slave core (core 0 and core 1) chip, which resulted in the multi-core real-time operating system taking too long to start, and eventually caused the controller startup time to time out. Summary of the invention
[0005] The present invention provides a multi-core operating system startup method, device, equipment, medium and product to shorten the startup time of the multi-core operating system.
[0006] According to a first aspect of the present invention, a multi-core operating system startup method is provided, which is applied to a multi-core controller, wherein the multi-core controller includes a master core and at least two slave cores, and the method includes:
[0007] When the multi-core controller is powered on, the main core executes a preset startup code to initialize the main core related devices so that the clock frequency of the main core reaches a frequency setting value;
[0008] Enable the cache function.
[0009] Initializing the system random access memory SRAM to complete the startup of the main core;
[0010] Initialize the main core operating system, and start the slave cores and the initialized main core operating system;
[0011] The slave core executes the preset startup code to complete the startup of the slave core and controls the slave core operating system to start up.
[0012] According to a second aspect of the present invention, a multi-core operating system startup device is provided, which is applied to a multi-core controller, wherein the multi-core controller includes a master core and at least two slave cores, and the device includes:
[0013] A main core initialization module, used for, when the multi-core controller is powered on, the main core executes a preset startup code to initialize the main core related devices so that the clock frequency of the main core reaches a frequency setting value;
[0014] The cache opening module is used to open and enable the cache function;
[0015] A main core startup module, used for initializing the system random access memory SRAM to complete the startup of the main core;
[0016] A main core system startup module, used to execute the initialization of the main core operating system, and start each of the slave cores and the initialized main core operating system;
[0017] The slave core startup module is used for the slave core to execute the preset startup code to complete the startup of the slave core and control the slave core operating system to start.
[0018] Optionally, the main core initialization module is specifically used to:
[0019] Turn off the internal watchdog;
[0020] Initializing the core register based on preset initial parameters;
[0021] The main core clock is initialized based on the initial parameters.
[0022] Optionally, the cache opening module is specifically used to:
[0023] Turn on the Enable Instruction Cache function and Enable Data Cache function in the Enable Cache function.
[0024] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0025] at least one multi-core controller; and
[0026] A memory communicatively connected to the at least one multi-core controller; wherein,
[0027] The memory stores a computer program that can be executed by the at least one multi-core controller, and the computer program is executed by the at least one multi-core controller so that the at least one multi-core controller can execute the multi-core operating system startup method described in any embodiment of the present invention.
[0028] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a multi-core controller to implement the multi-core operating system startup method described in any embodiment of the present invention when executed.
[0029] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a multi-core controller, the multi-core operating system startup method of any embodiment of the present invention is implemented.
[0030] The technical solution of the embodiment of the present invention is applied to a multi-core controller, which includes a main core and at least two slave cores. The method includes: when the multi-core controller is powered on, the main core executes a preset startup code, initializes the main core related devices so that the clock frequency of the main core reaches the frequency setting value; turns on the enable cache function; initializes the system random access memory SRAM to complete the startup of the main core; executes the initialization of the main core operating system, and starts each slave core and the initialized main core operating system; the slave core executes the preset startup code to complete the startup of the slave core, and controls the slave core operating system to start. When the main core executes the startup process, it increases the main frequency and turns on the enable cache, and executes the most time-consuming startup operation. The execution speed of the operation instruction is improved to achieve the purpose of shortening the startup time of the multi-core operating system, and solves the problem of controller startup timeout.
[0031] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 is a flowchart of a multi-core operating system startup method provided according to Embodiment 1 of the present invention;
[0034] Figure 2 is a flowchart of a multi-core operating system startup method provided according to Embodiment 2 of the present invention;
[0035] Figure 3 This is an example flow chart of a multi-core operating system startup method provided according to Embodiment 2 of the present invention;
[0036] Figure 4 This is a schematic diagram of the structure of a multi-core operating system startup device provided according to Embodiment 3 of the present invention;
[0037] Figure 5 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] Embodiment 1
[0041] Figure 1 A flowchart of a multi-core operating system startup method is provided for the first embodiment of the present invention. This embodiment is applicable to the startup optimization of multi-core chips. The method can be executed by a multi-core operating system startup device. The multi-core operating system startup device can be implemented in the form of hardware and / or software and applied to a multi-core controller. The multi-core controller includes a master core and at least two slave cores. The multi-core operating system startup device can be configured in an electronic device.
[0042] like Figure 1 As shown, the method includes:
[0043] S110 , when the multi-core controller is powered on, the main core executes a preset startup code to initialize the main core related devices so that the clock frequency of the main core reaches a set frequency value.
[0044] Among them, the frequency setting value is 200MHz.
[0045] In this embodiment, the multi-core controller can be understood as the controller where the multi-core chip is located, which has multiple processing cores and provides multi-threaded task processing capabilities. Multiple independent sub-cores can be set on a chip, and each core can execute threads and tasks independently. This multi-core design greatly improves the parallel processing capability of the CPU, allowing multiple applications to run simultaneously or multiple tasks to be processed simultaneously, thereby improving work efficiency and response speed. The multiple independent sub-cores can be divided into a main core and multiple slave cores. The main core can be understood as the main thread for running the operating system, which can handle multi-task concurrency and high-performance application programs. The slave core can be understood as a low-power core that can be used to perform some background tasks and low-intensity work.
[0046] In this embodiment, the preset startup code (i.e., startup code) can be understood as the code executed at startup, which is used for initializing system resources, setting environment variables, and loading configuration files. The main core-related devices can be understood as devices related to the main core initialization, for example, they may include core registers and main core clocks. The clock frequency can be understood as the operating frequency of the core that executes instructions, which determines how many operations the processor can perform per second. The higher the clock frequency, the more operations that can be executed per second, so the performance is better. The frequency setting value can be understood as the set clock frequency. The main core frequency of domestic chips is usually only 16MHz, and the corresponding processing speed is slow. The frequency setting value can be set to 200MHz, and the execution speed of subsequent instructions can be increased by increasing the main core frequency.
[0047] Specifically, when the multi-core controller is powered on, the master core starts first compared to other slave cores, and is responsible for system initialization and loading of core services, etc. First, the master core executes the preset startup code, and initializes the devices related to each master core through the preset configuration file and the set order, so that the clock frequency of the master core reaches the frequency setting value.
[0048] S120, turn on the cache enable function.
[0049] In this embodiment, enabling the cache function can be understood as providing a function of storing frequently accessed data and instructions through a high-speed memory, which is located between the processor and the main memory. By enabling the cache function, the number of accesses to the main memory is reduced, thereby improving system performance. Enabling the cache function can be divided into multiple cache types, such as instruction cache type (Instruction Cache, I-Cache) and data cache type (Data Cache, D-Cache), so as to adapt to different scenarios through different types of cache functions.
[0050] Specifically, the main core may enable the cache function by initializing and configuring the device corresponding to the cache enable function.
[0051] S130 , initializing the system random access memory SRAM to complete the startup of the main core.
[0052] In this embodiment, the system random access memory (SRAM) can be understood as a high-speed memory used to temporarily store running programs and data. It has a fast read and write speed for shared access by the main core and the slave core, and the access speed of each core is consistent.
[0053] Specifically, the main core can initialize the system random access memory SRAM. Since the SRAM is usually configured with an error checking and correction mechanism, in order to ensure the normal reading and writing of the subsequent SRAM, the mechanism needs to be initialized first. Secondly, the SRAM initial value is loaded to ensure the correctness and stability of the initial state after the multi-core controller is started. The preset startup code is executed and the startup of the main core is completed.
[0054] S140, executing the initialization of the main core operating system, and starting each slave core and the initialized main core operating system.
[0055] In this embodiment, the main core operating system can be understood as a vehicle control operating system, which is a real-time operating system that complies with the AUTOSAR standard and supports multiple functions such as task scheduling, terminal management, resource management, CAN, LIN communication services, diagnostic services, calibration measurement, storage management, IO drivers and complex drivers. It can provide a unified service interface for applications (AUTOSAR ASW), allowing developers to focus on application layer development without having to pay attention to the underlying code implementation.
[0056] Specifically, the master core may jump to the function part for initializing the operating system in the preset startup code, initialize the devices associated with the master core operating system, start all slave cores at the same time, and start the initialized master core operating system.
[0057] S150, the slave core executes a preset startup code to complete the startup of the slave core and control the slave core operating system to start.
[0058] In this embodiment, the slave core operating system can be understood as the operating system corresponding to the slave core, which is usually responsible for processing specific tasks, such as power management, sensor monitoring, etc. Its functions are relatively simple, mainly focusing on the execution and management of specific tasks, and its functions and interfaces are relatively limited. The main core operating system and the slave core operating system work together through a certain communication mechanism to jointly achieve efficient operation of the entire system.
[0059] Specifically, after the slave core is started, the slave core can execute the preset startup code to initialize the slave core related devices to complete the startup of the slave core, and jump to the preset startup code to initialize the function corresponding to the slave core operating system, initialize the slave core operating system related devices, and start the slave core operating system to complete the startup of the multi-core operating system.
[0060] The technical solution of the embodiment of the present invention is applied to a multi-core controller, which includes a main core and at least two slave cores. The method includes: when the multi-core controller is powered on, the main core executes a preset startup code, initializes the main core related devices so that the clock frequency of the main core reaches the frequency setting value; turns on the enable cache function; initializes the system random access memory SRAM to complete the startup of the main core; executes the initialization of the main core operating system, and starts each slave core and the initialized main core operating system; the slave core executes the preset startup code to complete the startup of the slave core, and controls the slave core operating system to start. When the main core executes the startup process, it increases the main frequency and turns on the enable cache, and executes the most time-consuming startup operation. The execution speed of the operation instruction is improved to achieve the purpose of shortening the startup time of the multi-core operating system, and solves the problem of controller startup timeout.
[0061] Embodiment 2
[0062] Figure 2 This is a flowchart of a multi-core operating system startup method provided in Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 2 As shown, the method includes:
[0063] S201. When the multi-core controller is powered on, the main core turns off the internal watchdog.
[0064] In this embodiment, the internal watchdog can be understood as a mechanism for detecting and recovering from system failures. The main function of the internal watchdog is to monitor the operating status of the system and trigger a reset operation when an abnormality or failure is detected.
[0065] It can be known that the internal watchdog works as follows: Initialization: When the system starts, the internal watchdog will be configured with a specific timeout period, which is usually fixed, but can also be set as needed. Feeding the Watchdog: During normal system operation, a signal (called "feeding the watchdog") needs to be sent to the internal watchdog periodically to indicate that the system is still working properly. This signal can be a simple write operation, or the execution of a specific function call.
[0066] Specifically, when the multi-core controller is powered on, the main core is started first, and the internal watchdog is turned off by the main core to avoid chip reset due to untimely feeding of the watchdog, thereby affecting the startup of the multi-core operating system.
[0067] S202: Initialize the core register based on the preset initial parameters.
[0068] In this embodiment, the initial parameters can be understood as parameters used to configure the operation of the main core related devices, which can be obtained in the form of configuration files. The core registers can be understood as key information used to store and process the execution of instructions.
[0069] Specifically, the main core can obtain the configuration file and initialize the core registers based on the initial parameters pre-set in the configuration file. The core registers must be initialized before use, otherwise the register values of the lock-step cores and cores in the lock-step mode will be different random values, which will cause lock-step errors.
[0070] S203: Initialize the main core clock based on the initial parameters.
[0071] In this embodiment, the main core clock can be understood as a reference clock signal provided by the congratulatory letter, which is used to synchronize and control its internal operations.
[0072] Specifically, the main core may initialize the main core clock through the initial parameters so that the clock frequency of the main core reaches the frequency setting value of 200 MHz.
[0073] S204: Turn on the enable instruction cache function and the enable data cache function in the enable cache function.
[0074] In this embodiment, enabling the instruction cache function can be understood as being used to cache instructions to be executed, and enabling the data cache function can be understood as being used to store recently accessed data.
[0075] It can be known that the multi-core operating system in the prior art reads instructions through the flash memory, which has a slow speed. Putting the instructions into the enable cache can improve the subsequent SRAM read and write speed.
[0076] Specifically, the main core can turn on the enable instruction cache function and the enable data cache function in the enable cache function to increase the speed of accessing instructions, reduce the number of accesses to the main memory, and increase the access speed of data by temporarily storing data, thereby improving system performance.
[0077] S205 . Write a pre-generated random number into the SRAM to initialize the error checking and correction function of the SRAM.
[0078] In this embodiment, the random number can be understood as a number randomly generated within a certain range, which can usually be generated by a random number generator. The error checking and correction (ECC) function can be understood as an algorithm technology for detecting and correcting errors in SRAM, which can realize single-bit error correction and multi-bit error correction.
[0079] Specifically, the main core can write a pre-generated random number into the SRAM to initialize the SRAM ECC function. The SRAM must be written before the read operation, otherwise it will cause an ECC error.
[0080] S206: Load the initial variable values in the flash memory into the initialized SRAM.
[0081] In this embodiment, the flash memory Flash can be understood as a memory that can still maintain stored data information in the case of power failure. Usually, the initial values of all global variables are stored in the flash memory Flash. The initial variable value can be understood as a parameter used for state initialization of the SRAM.
[0082] Specifically, before the main core operating system is started, the main core may load the initial variable values in the flash memory Flash into the SRAM to ensure the correctness and stability of the initial state after the controller is started.
[0083] S207, jump to the main function, initialize the main core operating system clock, main core peripheral driver and main core operating system.
[0084] In this embodiment, the main function can be understood as the main logic of the execution program, such as initializing variables, etc. The main core operating system clock can be understood as the clock corresponding to the main core operating system. The main core peripheral driver can be understood as the driver of the external device corresponding to the function completed by the main core operating system.
[0085] Specifically, the main core can jump to the main function to initialize the main core operating system clock, the main core peripheral driver, and the main core operating system.
[0086] S208 , starting each slave core, and setting a slave core starting address of each slave core.
[0087] In this embodiment, the slave core startup address may be understood as an entry point address for jumping to a preset startup code during the startup process.
[0088] Specifically, the master core may start each slave core and set a slave core start address of the slave core so that the slave core is configured.
[0089] S209: Start the main core operating system.
[0090] Specifically, the main core can start the main core operating system.
[0091] S210. The slave core turns off the internal watchdog.
[0092] Specifically, after the slave core is started, it executes a preset startup code according to the slave core startup address and turns off the internal watchdog.
[0093] S211, initialize the slave core register of the slave core to complete the startup of the slave core.
[0094] In this embodiment, the slave core register may be understood as a core register corresponding to the slave core.
[0095] Specifically, the slave core may initialize the slave core register corresponding to the slave core, thereby completing the startup of the slave core.
[0096] S212, jump to the main function, initialize the slave core driver and slave core operating system of the slave core.
[0097] Specifically, after the slave core is started, it jumps to the main function to initialize the slave core driver and the slave core operating system of the slave core.
[0098] S213, start the slave core operating system.
[0099] Optionally, after starting the main core operating system, the method further includes:
[0100] Enable the multi-core synchronization function and wait for the slave core to start up.
[0101] In this embodiment, the multi-core synchronization function can be understood as.
[0102] Specifically, after starting the main core operating system, the main core may enter the multi-core synchronization function and wait for the slave core operating system of the slave core to start.
[0103] Optionally, after starting the slave core operating system, the method further includes:
[0104] Turn on the multi-core synchronization function to synchronize with the main core.
[0105] Specifically, after the slave core operating system is started, the slave core may enable a multi-core synchronization function to synchronize with the master core, thereby achieving multi-core synchronization between the master core and the slave core.
[0106] The technical solution of the embodiment of the present invention can greatly improve the execution speed of SRAM operation instructions by increasing the main core frequency from the default 16MHz to 200MHz before the main core starts the most time-consuming operation (initializing SRAM, loading SRAM initial values), and ultimately achieve the purpose of reducing the startup time of the controller. The execution speed of operation instructions is improved to achieve the purpose of shortening the startup time of the multi-core operating system and solve the problem of controller startup timeout. Before the main core starts the most time-consuming operation (initializing SRAM, loading SRAM initial values), the enable instruction cache function and the enable data cache function are turned on. The enable instruction cache function can improve the instruction reading speed, and the enable data cache function can improve the data reading speed, and ultimately achieve the purpose of reducing the startup time of the controller. The slave core execution startup process removes redundant operations and deletes redundant time-consuming operation parts (such as initializing SRAM ECC and SRAM initial value loading processes). Due to the deletion of redundant processes, the slave core startup time can be shortened, and ultimately achieves the purpose of reducing the startup time of the multi-core controller.
[0107] For example, in order to facilitate understanding of the present invention, a specific example is used for demonstration. For example, a multi-core controller includes a master core and two slave cores. The master core is represented by core 2, and the slave cores are represented by core 0 and core 1. Figure 3 This is an example flow chart of a multi-core operating system startup method provided in Embodiment 2 of the present invention, such as Figure 3 As shown, the steps may include:
[0108] S301, when powered on, core 2 turns off the internal watchdog;
[0109] S302, core 2 initializes the main core register;
[0110] S303, core 2 initializes the main core clock to increase the main core frequency to 200 MHz;
[0111] S304, core 2 turns on the cache function;
[0112] S305, core 2 writes a pre-generated random number into the SRAM to initialize the SRAM ECC;
[0113] S306, core 2 loads the initial variable value in the flash memory into the initialized SRAM;
[0114] S307, core 2 jumps to the main function, initializes the main core operating system clock, main core peripheral driver and main core operating system;
[0115] S308, core 2 starts each slave core and starts the main core operating system;
[0116] S309, core 2 starts multi-core synchronization;
[0117] S310, core 1 turns off the internal watchdog;
[0118] S311, core 1 initializes the slave core register of the slave core;
[0119] S312, core 1 jumps to the main function;
[0120] S313, core 1 initializes the slave core driver and slave core operating system of the slave core;
[0121] S314, core 1 starts multi-core synchronization;
[0122] S315, core 0 turns off the internal watchdog;
[0123] S316, core 0 initializes the slave core register of the slave core;
[0124] S317, core 0 jumps to the main function;
[0125] S318, core 0 initializes the slave core driver and slave core operating system of the slave core;
[0126] S319, core 0 starts multi-core synchronization.
[0127] Embodiment 3
[0128] Figure 4 The schematic diagram of the structure of a multi-core operating system startup device provided in the third embodiment of the present invention. The device is applied to a multi-core controller, wherein the multi-core controller includes a master core and at least two slave cores, such as Figure 4 As shown, the device comprises:
[0129] A main core initialization module 41 is used for, when the multi-core controller is powered on, the main core executes a preset startup code to initialize the main core related devices so that the clock frequency of the main core reaches a set frequency value;
[0130] The cache opening module 42 is used to open and enable the cache function;
[0131] A main core startup module 43, used for initializing the system random access memory SRAM to complete the startup of the main core;
[0132] The main core system startup module 44 is used to execute the initialization of the main core operating system and start each of the slave cores and the initialized main core operating system;
[0133] The slave core startup module 45 is used for the slave core to execute the preset startup code to complete the startup of the slave core and control the slave core operating system to start.
[0134] The technical solution of the embodiment of the present invention is applied to a multi-core controller, which includes a main core and at least two slave cores. The method includes: when the multi-core controller is powered on, the main core executes a preset startup code, initializes the main core related devices so that the clock frequency of the main core reaches the frequency setting value; turns on the enable cache function; initializes the system random access memory SRAM to complete the startup of the main core; executes the initialization of the main core operating system, and starts each slave core and the initialized main core operating system; the slave core executes the preset startup code to complete the startup of the slave core, and controls the slave core operating system to start. When the main core executes the startup process, it increases the main frequency and turns on the enable cache, and executes the most time-consuming startup operation. The execution speed of the operation instruction is improved to achieve the purpose of shortening the startup time of the multi-core operating system, and solves the problem of controller startup timeout.
[0135] Furthermore, the main core related devices include an internal watchdog, a main core register and a main core clock, and the main core initialization module 41 is specifically used for:
[0136] Turn off the internal watchdog;
[0137] Initializing the core register based on preset initial parameters;
[0138] The main core clock is initialized based on the initial parameters.
[0139] Furthermore, the cache opening module 42 is specifically used for:
[0140] Turn on the Enable Instruction Cache function and Enable Data Cache function in the Enable Cache function.
[0141] Furthermore, the main core startup module 43 includes:
[0142] Writing a pre-generated random number into the SRAM to initialize an error checking and correction function of the SRAM;
[0143] The initial variable values in the flash memory are loaded into the initialized SRAM.
[0144] Furthermore, the main core system startup module 44 includes:
[0145] Jump to the main function to initialize the main core operating system clock, main core peripheral driver and main core operating system;
[0146] Starting each of the slave cores, and setting a slave core starting address of each of the slave cores;
[0147] Start the main core operating system.
[0148] Optionally, the device also includes: a main core synchronization module.
[0149] The main core synchronization module is specifically used to: after starting the main core operating system, enable the multi-core synchronization function and wait for the completion of the slave core startup.
[0150] Furthermore, the slave core startup module 45 is specifically used for:
[0151] Disable the internal watchdog;
[0152] Initializing the slave core register of the slave core to complete the startup of the slave core;
[0153] Jump to the main function to initialize the slave core driver and slave core operating system of this slave core;
[0154] Start the slave kernel operating system.
[0155] Optionally, the device also includes: a slave core synchronization module.
[0156] The slave core synchronization module is specifically used to enable the multi-core synchronization function after starting the slave core operating system to synchronize with the master core.
[0157] The multi-core operating system startup device provided in the embodiment of the present invention can execute the multi-core operating system startup method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0158] Embodiment 4
[0159] Figure 5 A schematic diagram of an electronic device 50 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0160] like Figure 5As shown, the electronic device 50 includes at least one multi-core controller 51, and a memory connected to the at least one multi-core controller 51, such as a read-only memory (ROM) 52, a random access memory (RAM) 53, etc., wherein the memory stores a computer program that can be executed by at least one multi-core controller, and the multi-core controller 51 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 52 or the computer program loaded from the storage unit 58 to the random access memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 50 can also be stored. The multi-core controller 51, the ROM 52, and the RAM 53 are connected to each other through a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0161] A number of components in the electronic device 50 are connected to the I / O interface 55, including: an input unit 56, such as a keyboard, a mouse, etc.; an output unit 57, such as various types of displays, speakers, etc.; a storage unit 58, such as a disk, an optical disk, etc.; and a communication unit 59, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 59 allows the electronic device 50 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0162] The multi-core controller 51 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the multi-core controller 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various multi-core controllers running machine learning model algorithms, digital signal multi-core controllers (DSPs), and any appropriate multi-core controllers, controllers, microcontrollers, etc. The multi-core controller 51 performs the various methods and processes described above, such as a multi-core operating system startup method.
[0163] In some embodiments, the multi-core operating system startup method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 58. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 50 via the ROM 52 and / or the communication unit 59. When the computer program is loaded into the RAM 53 and executed by the multi-core controller 51, one or more steps of the multi-core operating system startup method described above can be performed. Alternatively, in other embodiments, the multi-core controller 51 can be configured to execute the multi-core operating system startup method by any other appropriate means (for example, by means of firmware).
[0164] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable multi-core controller, which can be a dedicated or general-purpose programmable multi-core controller that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0165] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a multi-core controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the multi-core controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0166] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 of the foregoing.
[0167] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0168] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0169] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0170] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the multi-core operating system startup method of any embodiment of the present invention when executed by a multi-core controller.
[0171] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can 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 server. In the case of a remote computer, the remote computer can 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 can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0173] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for starting a multi-core operating system, characterized in that: Applied to a multi-core controller, the multi-core controller includes a master core and at least two slave cores, the method includes: When the multi-core controller is powered on, the main core executes a preset startup code to initialize the main core related devices so that the clock frequency of the main core reaches the frequency setting value; Enable the cache function. Initializing the system random access memory SRAM to complete the startup of the main core; Initialize the main core operating system, and start the slave cores and the initialized main core operating system; The slave core executes the preset startup code to complete the startup of the slave core and controls the slave core operating system to start up.
2. The method according to claim 1, characterized in that The main core related devices include an internal watchdog, a main core register and a main core clock, and the main core related devices are initialized, including: Turn off the internal watchdog; Initializing the core register based on preset initial parameters; The main core clock is initialized based on the initial parameters.
3. The method according to claim 1, characterized in that: The enabling cache function includes: Turn on the Enable Instruction Cache function and Enable Data Cache function in the Enable Cache function.
4. The method according to claim 1, characterized in that: The initializing of the system random access memory SRAM comprises: Writing a pre-generated random number into the SRAM to initialize an error checking and correction function of the SRAM; The initial variable values in the flash memory are loaded into the initialized SRAM.
5. The method according to claim 1, characterized in that The initialization of the main core operating system and starting each of the slave cores and the initialized main core operating system include: Jump to the main function to initialize the main core operating system clock, main core peripheral driver and main core operating system; Starting each of the slave cores, and setting a slave core starting address of each of the slave cores; Start the main core operating system.
6. The method according to claim 5, characterized in that After starting the main core operating system, the method further includes: Enable the multi-core synchronization function and wait for the slave core to start up.
7. The method according to claim 1, characterized in that The executing the preset startup code to complete the startup of the slave core and control the slave core operating system to start, includes: Disable the internal watchdog; Initializing the slave core register of the slave core to complete the startup of the slave core; Jump to the main function to initialize the slave core driver and slave core operating system of this slave core; Start the slave kernel operating system.
8. The method according to claim 7, characterized in that After starting the slave core operating system, the method further includes: The multi-core synchronization function is turned on to synchronize with the main core.
9. The method according to claim 1, characterized in that: The frequency setting value is 200 MHz.
10. A multi-core operating system startup device, characterized in that: Applied to a multi-core controller, the multi-core controller includes a master core and at least two slave cores, the device includes: A main core initialization module, used for, when the multi-core controller is powered on, the main core executes a preset startup code to initialize the main core related devices so that the clock frequency of the main core reaches a frequency setting value; The cache opening module is used to open and enable the cache function; A main core startup module, used for initializing the system random access memory SRAM to complete the startup of the main core; A main core system startup module, used to execute the initialization of the main core operating system, and start each of the slave cores and the initialized main core operating system; The slave core startup module is used for the slave core to execute the preset startup code to complete the startup of the slave core and control the slave core operating system to start.
11. The device according to claim 10, characterized in that The main core related devices include an internal watchdog, a main core register and a main core clock, and the main core initialization module is specifically used for: Turn off the internal watchdog; Initializing the core register based on preset initial parameters; The main core clock is initialized based on the initial parameters.
12. The device according to claim 10, characterized in that The cache opening module is specifically used for: Turn on the Enable Instruction Cache function and Enable Data Cache function in the Enable Cache function.
13. An electronic device, characterized in that: The electronic device comprises: at least one multi-core controller; and A memory communicatively connected to the at least one multi-core controller; wherein, The memory stores a computer program that can be executed by the at least one multi-core controller, and the computer program is executed by the at least one multi-core controller so that the at least one multi-core controller can execute the multi-core operating system startup method described in any one of claims 1-9.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the multi-core controller to implement the multi-core operating system startup method described in any one of claims 1-9 when executed.
15. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a multi-core controller, implements the multi-core operating system startup method according to any one of claims 1 to 9.
Citation Information
Cited By
Starting method and device, electronic equipment and storage medium
CN119806659A
