A method, system, device and storage medium for quickly starting an operating system

By deploying the job scheduler and executor in BootLoader, the job distribution scheduling communication mechanism is implemented, and the problem of BootLoader process simplification in the prior art involves deep function tailoring and customization is solved, and the operating system is quickly started and versatile.

CN119621162BActive Publication Date: 2025-06-27HUAZHI (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411798607.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-06-27
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

The prior art uses the accelerated startup method of simplifying the process of BootLoader, involving deep functional tailoring and customization, and is not versatile.

Method used

Deploy the job scheduler and the job executor in the BootLoader to realize the job distribution scheduling communication mechanism, and execute the job by asynchronously distributing tasks.

Benefits of technology

It realizes rapid startup of the operating system without changing the BootLoader, avoids adjustments to the overall software solution of the chip, improves the feasibility of chip development, and is versatile.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621162B_ABST
    Figure CN119621162B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose a method, system, device, and storage medium for quickly starting an operating system. In the embodiments of the present invention, a job scheduler and a job executor are deployed in the BootLoader to implement a job distribution and scheduling communication mechanism, and the BootLoader is optimized by using the method of asynchronously distributing tasks to execute jobs. In an environment that requires quick response and high efficiency, the embodiments of the present invention can quickly start the operating system without replacing the BootLoader, without involving adjustments to the overall chip software solution, with less dependence on chip manufacturers, greatly improving the feasibility of chip development; at the same time, it does not involve deep function trimming and customization and has generality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of system rapid startup, and in particular to a rapid startup method, system, device and storage medium for an operating system. Background Art

[0002] System rapid startup has important application scenarios in many fields, especially in environments that require fast response and high efficiency, such as: Industrial automation: In industrial human-machine interface, industrial PLC and other scenarios, rapid startup technology can reduce system startup time, improve production efficiency and reduce resource waste; Internet of Things (IoT) devices: IoT gateways and communication management machines and other devices need to start quickly to ensure real-time transmission and processing of data; Embedded systems: In some embedded devices, it can ensure that the device starts and runs business applications in the shortest time.

[0003] System startup involves multiple stages, see Figure 3 After the system is powered on, Bootrom runs first to initialize the CPU, bus, and basic peripherals, and load BootLoader. BootLoader completes further hardware device initialization, loads the subsequent stage OS kernel and related components from the storage device into RAM, and jumps to the OS kernel entry address for execution. The OS kernel is the operating system kernel, which completes the initialization of the operating system and establishes the operating environment. The operating system starts the user application to provide business services.

[0004] Bootrom is usually fixed in the ROM inside the chip and provided by the chip manufacturer. The main work of system startup acceleration can be achieved by optimizing the BootLoader and the operating system.

[0005] The current general BootLoader software initially adopted a single-threaded design for reasons such as simplifying the design and reducing resources. All BootLoader work is executed serially. After the main CPU core (also called boot CPU) is powered on, it executes the main process of BootLoader, and the auxiliary CPU core (also called secondary cpus) enters a waiting state. When the operating system is started, the auxiliary CPU core in the waiting state is awakened to enter the multi-core SMP execution environment.

[0006] With the development of processors and hardware, CPUs are becoming more and more equipped with multiple cores and other resources. The original single-threaded design has gradually become a bottleneck in some scenarios that require fast startup.

[0007] To accelerate the startup, generally two methods are selected: 1) Replace with a BootLoader that supports multi-threading. Different initialization tasks are executed separately through multi-threading; 2) Simplify the process based on the existing BootLoader. The execution time is reduced by simplifying the functions.

[0008] However, replacing the BootLoader involves the adjustment of the overall software solution of the chip and is highly dependent on the chip manufacturer, which is not feasible for the application development of the chip. Simplifying the BootLoader process involves in-depth function trimming and customization and does not have universality. Summary of the Invention

[0009] Therefore, embodiments of the present invention provide a method, system, device, and storage medium for quickly starting an operating system to solve the technical problem that the existing technology of accelerating the startup by simplifying the BootLoader process involves in-depth function trimming and customization and does not have universality.

[0010] To achieve the above object, embodiments of the present invention provide the following technical solutions:

[0011] According to the first aspect of the embodiments of the present invention, a method for quickly starting an operating system is provided. The method is applied to the BootLoader, and a job scheduler and a job executor are deployed in the BootLoader to implement a job distribution and scheduling communication mechanism. The method includes:

[0012] After the operating system is started by accessing the power supply, the BootROM is run and the BootLoader is loaded. The main cpu core initializes the job scheduler, and the auxiliary cpu core enters the waiting state;

[0013] The main cpu core wakes up the auxiliary cpu core through a wake-up mechanism, so that the auxiliary cpu core enters the job executor and waits to execute a job;

[0014] The main cpu core converts the initialization work into a job, distributes the job to the job executor of the auxiliary cpu core through the job scheduler for execution, and returns the execution result to the job scheduler after completion;

[0015] After the execution process ends, the job executor is closed. The main cpu core sends an exit executor command. After receiving the exit executor command, the auxiliary cpu core exits the executor and enters the waiting state to complete the BootLoader;

[0016] The operating system initialization and the running environment establishment are completed through the OS kernel, and the operating system is started.

[0017] Further, the job executor is used to execute the functional functions in the BootLoader.

[0018] Further, the main CPU core wakes up the auxiliary CPU core through a wake-up mechanism, so that the auxiliary CPU core enters the job executor and waits for jobs to be executed, including:

[0019] Obtain a data of the required quantity of auxiliary CPU cores;

[0020] The main CPU core sets each auxiliary CPU core through the data of the required quantity of auxiliary CPU cores and wakes up the auxiliary CPU core.

[0021] Further, the main CPU core converts the initialization work into jobs, distributes the jobs to the job executors of the auxiliary CPU cores through the job scheduler for execution, and returns the execution results to the job scheduler after execution, including:

[0022] Distribute the task function to the job executor of the auxiliary CPU core for execution by calling the interface of the job scheduler;

[0023] Among them, the job distribution process is an asynchronous execution process that is executed multiple times.

[0024] Further, the initialization work includes parallel initialization of each peripheral driver, reading and loading of large files.

[0025] Further, after the execution process ends, the job executor is closed, the main CPU core sends an exit executor command, and after receiving the exit executor command, the auxiliary CPU core exits the executor and enters the waiting state to complete the BootLoader, including:

[0026] The main CPU core triggers the auxiliary CPU core to re-enter the waiting state through the job executor, waiting for the subsequent operating system kernel to re-wake up the auxiliary CPU core.

[0027] Further, the method further includes:

[0028] A queue mechanism based on shared memory is provided between the job scheduler and the job executor for task distribution and status query.

[0029] According to the second aspect of the embodiments of the present invention, a fast startup system for an operating system is provided, and the system includes:

[0030] The BootLoader loading module is used to run the BootROM and load the BootLoader after accessing the power supply to start the operating system. The main CPU core initializes the job scheduler, and the auxiliary CPU core enters the waiting state;

[0031] The auxiliary CPU core wake-up module is used for the main CPU core to wake up the auxiliary CPU core through the wake-up mechanism, so that the auxiliary CPU core enters the job executor and waits to execute the job;

[0032] The job distribution module is used for the main CPU core to convert the initialization work into jobs, and distribute the jobs to the job executor of the auxiliary CPU core through the job scheduler for execution. After the execution is completed, the execution result is returned to the job scheduler;

[0033] The exit executor module is used to close the job executor after the execution process ends. The main CPU core sends an exit executor command. After receiving the exit executor command, the auxiliary CPU core exits the executor and enters the waiting state to complete the BootLoader;

[0034] The OS kernel running module is used to complete the initialization of the operating system and establish the running environment through the OS kernel, and the operating system completes the startup.

[0035] According to the third aspect of the embodiments of the present invention, a device for quickly starting an operating system is provided. The device includes: a processor and a memory;

[0036] The memory is used to store one or more program instructions;

[0037] The processor is used to run one or more program instructions to execute the steps of a method for quickly starting an operating system as described in any one of the above.

[0038] According to the fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of a method for quickly starting an operating system as described in any one of the above are implemented.

[0039] The embodiments of the present invention have the following advantages:

[0040] In the embodiment of the present invention, a job distribution and scheduling communication mechanism is implemented by deploying a job scheduler and a job executor in the BootLoader. The job is executed by using the asynchronous distribution task method to optimize the BootLoader. In the environment that requires quick response and high efficiency, the embodiment of the present invention can quickly start the operating system without replacing the BootLoader, without involving the adjustment of the overall chip software solution, and has less dependence on the chip manufacturer, greatly improving the feasibility of chip development. At the same time, it does not involve deep function trimming and customization and has universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only exemplary, and for those of ordinary skill in the art, without creative efforts, other implementation drawings can be obtained according to the provided drawings.

[0042] The structures, ratios, sizes, etc. shown in this specification are only used to cooperate with the content disclosed in the specification for those who are familiar with this technology to understand and read, and are not used to limit the limited conditions under which the present invention can be implemented. Therefore, they do not have technical substance. Any modification of the structure, change of the proportional relationship or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope that can be covered by the technical content disclosed in the present invention.

[0043] Figure 1 It is a schematic diagram of the logical structure of a fast startup system for an operating system provided by an embodiment of the present invention;

[0044] Figure 2 It is a schematic diagram of the flow of a fast startup method for an operating system provided by an embodiment of the present invention;

[0045] Figure 3 It is a schematic diagram of the operating system startup process in the background technology in a fast startup method for an operating system provided by an embodiment of the present invention;

[0046] Figure 4 It is a schematic diagram of the job processes of the main cpu core and the auxiliary cpu core in a fast startup method for an operating system provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0047] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.

[0048] With the development of current processors and hardware, CPUs have multiple cores and other resources are gradually enriched. The original single-threaded design gradually shows bottlenecks in some scenarios that require quick startup.

[0049] To accelerate startup, generally two methods are selected: 1) Replace with a BootLoader that supports multi-threading. Different initialization tasks are executed separately through multi-threading; 2) Simplify the process based on the existing BootLoader. The execution time is reduced by simplifying the functions.

[0050] However, replacing the BootLoader involves adjustments to the overall software solution of the chip and is highly dependent on the chip manufacturer, which is not feasible for the application development of the chip. Simplifying the BootLoader process involves in-depth function trimming and customization and does not have universality.

[0051] To solve the technical problem that the in-depth function trimming and customization involved in the above-mentioned acceleration startup method by simplifying the BootLoader process do not have universality.

[0052] Reference Figure 1 , an embodiment of the present invention discloses a fast startup system for an operating system, and the system includes: a BootLoader loading module 1; an auxiliary CPU core wake-up module 2; a job distribution module 3; an exit executor module 4; an OS kernel operation module 5.

[0053] Corresponding to the above-disclosed fast startup system for an operating system, an embodiment of the present invention also discloses a fast startup method for an operating system. The following details the fast startup method for an operating system disclosed in the embodiments of the present invention in combination with the above-described fast startup system for an operating system.

[0054] Reference Figure 2 and Figure 4 , the present invention discloses a fast startup method for an operating system. The method is applied to the BootLoader, and a job scheduler and a job executor are deployed in the BootLoader to implement a job distribution, scheduling, and communication mechanism.

[0055] Implement a job scheduler and an execution unit in the bootloader and implement the distribution scheduling communication mechanism for jobs.

[0056] After powering on and starting the operating system, the BootROM is run and the BootLoader is loaded. The main CPU core initializes the job scheduler, and the auxiliary CPU core enters the waiting state.

[0057] After the system is powered on, the main CPU core executes the existing process. The auxiliary CPU core first enters the waiting state. The main CPU core sets and wakes up the auxiliary CPU core to enter the job executor and waits to execute jobs. The number of auxiliary CPU cores to be used specifically can be set by the main CPU core.

[0058] The main CPU core wakes up the auxiliary CPU core through the wake-up mechanism, causing the auxiliary CPU core to enter the job executor and wait to execute jobs. The main CPU core converts the initialization work into a job and distributes the job to the job executor of the auxiliary CPU core through the job scheduler for execution. After execution, the execution result is returned to the job scheduler.

[0059] During the execution of the main CPU, the time-consuming initialization work is triggered as a job for the auxiliary CPU core to execute, and the job execution unit is used for parallel initialization, including: parallel initialization of different peripheral drivers, reading and loading of large files, and other time-consuming initialization work. The software process on the main CPU core distributes the task function to the job execution unit on other CPU cores by calling the job scheduler interface. After the job execution unit finishes execution, it returns the status to the job scheduler, and the main CPU core can check the completion status of the job in the subsequent process.

[0060] After the execution process ends, the job executor is closed. The main CPU core sends an exit executor command. After receiving the exit executor command, the auxiliary CPU core exits the executor and enters the waiting state to complete the BootLoader. The operating system initialization and the establishment of the running environment are completed through the OS kernel, and the operating system is started.

[0061] When the main CPU core starts, it wakes up the auxiliary CPU core from the initial waiting state into the job execution unit. When the bootloader ends, the main CPU core notifies the auxiliary CPU core to exit the execution unit and enter the initial waiting state.

[0062] Implement a job scheduler and a job execution unit in the bootloader. The job execution unit can execute the functional functions in the bootloader.

[0063] Furthermore, the job execution unit is used to execute the functional functions within the BootLoader.

[0064] Furthermore, the main CPU core wakes up the auxiliary CPU core through a wake-up mechanism, enabling the auxiliary CPU core to enter the job execution unit and wait for job execution, including: obtaining a data on the required quantity of auxiliary CPU cores; the main CPU core sets and wakes up each auxiliary CPU core based on the data on the required quantity of auxiliary CPU cores.

[0065] Furthermore, the main CPU core converts the initialization work into jobs, distributes the jobs to the job execution units of the auxiliary CPU cores through the job scheduler for execution, and returns the execution results to the job scheduler after completion, including: distributing the task functions to the job execution units of the auxiliary CPU cores for execution by calling the interface of the job scheduler.

[0066] Among them, the job distribution process is an asynchronous execution process that is executed multiple times.

[0067] Furthermore, the initialization work includes parallel initialization of different peripheral drivers, reading and loading of large files, and other time-consuming initialization work.

[0068] Furthermore, after the execution process ends, the job execution unit is closed. The main CPU core sends an exit executor command, and after receiving the exit executor command, the auxiliary CPU core exits the executor and enters the waiting state, completing the BootLoader, including: the main CPU core triggers the auxiliary CPU core to re-enter the waiting state through the job execution unit, waiting for the subsequent operating system kernel to wake up the auxiliary CPU core again.

[0069] Before the bootloader finishes execution and is about to enter the OS kernel, the main CPU core triggers the auxiliary CPU core to re-enter the waiting state through the job execution unit, waiting for the subsequent operating system kernel to wake it up again.

[0070] Furthermore, the method further includes: a queue mechanism based on shared memory is provided between the job scheduler and the job execution unit for task distribution and status query.

[0071] A queue mechanism based on shared memory is adopted between the scheduler and the executor to implement task distribution and status query.

[0072] The main CPU core distributes time-consuming work to the execution units of the auxiliary CPU through the scheduler for execution. The executor returns the results to the scheduler, and the main CPU core can query the execution status at an appropriate time later.

[0073] In addition, an embodiment of the present invention further provides a device for quickly starting an operating system. The device includes: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a method for quickly starting an operating system as described in any one of the above.

[0074] In addition, an embodiment of the present invention further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of a method for quickly starting an operating system as described in any one of the above are implemented.

[0075] In an embodiment of the present invention, the processor may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0076] The various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and combines its hardware to complete the steps of the above method.

[0077] The storage medium may be a memory, for example, it may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.

[0078] Among them, the non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory.

[0079] The volatile memory can be a Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).

[0080] The storage media described in the embodiments of the present invention are intended to include, but not be limited to, these and any other suitable types of memories.

[0081] Those skilled in the art should be able to realize that in one or more of the above examples, the functions described in the present invention can be implemented by a combination of hardware and software. When applying software, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. The computer-readable medium includes computer storage media and communication media, where the communication media includes any medium that facilitates the transfer of a computer program from one place to another. The storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0082] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it on the basis of the present invention, which will be obvious to those skilled in the art. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection required by the present invention.

Claims

1. A method for quickly starting an operating system, characterized in that: The method is applied to BootLoader, and a job scheduler and a job executor are deployed in BootLoader to implement a job distribution and scheduling communication mechanism. The method includes: After the power is connected to start the operating system, the BootROM is run and the BootLoader is loaded, the main CPU core initializes the job scheduler, and the auxiliary CPU core enters a waiting state; The main cpu core wakes up the auxiliary cpu core through the wake-up mechanism, so that the auxiliary cpu core enters the job executor and waits to execute the job; The main cpu core converts the initialization work into a job, distributes the job to the job executor of the auxiliary cpu core through the job scheduler for execution, and returns the execution result to the job scheduler after the execution is completed; After the execution process is completed, the job executor is closed, and the main cpu core sends an exit executor command. After receiving the exit executor command, the auxiliary cpu core exits the executor and enters a waiting state, completing the BootLoader; The OS kernel completes the initialization of the operating system and the establishment of the operating environment, and the operating system is started.

2. A method for quickly starting an operating system as claimed in claim 1, characterized in that: The job executor is used to execute the functional functions in the BootLoader.

3. A method for quickly starting an operating system as claimed in claim 2, characterized in that: The main cpu core wakes up the auxiliary cpu core through the wake-up mechanism, so that the auxiliary cpu core enters the job executor and waits to execute the job, including: Get the required number of auxiliary CPU cores; The main CPU core sets each auxiliary CPU core and wakes up the auxiliary CPU core according to the auxiliary CPU core required quantity data.

4. A method for quickly starting an operating system as claimed in claim 3, characterized in that: The main cpu core converts the initialization work into a job, distributes the job to the job executor of the auxiliary cpu core through the job scheduler for execution, and returns the execution result to the job scheduler after the execution is completed, including: By calling the interface of the job scheduler, the task function is distributed to the job executor of the auxiliary cpu core for execution; The job distribution process is an asynchronous execution process that is executed multiple times.

5. A method for quickly starting an operating system as claimed in claim 4, characterized in that: The initialization work includes parallel initialization of various peripheral drivers, and reading and loading of large files.

6. A method for quickly starting an operating system as claimed in claim 5, characterized in that: After the execution process is completed, the job executor is closed, and the main cpu core sends an exit executor command. After receiving the exit executor command, the auxiliary cpu core exits the executor and enters a waiting state, completing the BootLoader, including: The main CPU core triggers the auxiliary CPU core to re-enter the waiting state through the job executor, waiting for the subsequent operating system kernel to re-awaken the auxiliary CPU core.

7. A method for quickly starting an operating system as claimed in claim 6, characterized in that: The method further comprises: A queue mechanism based on shared memory is provided between the job scheduler and the job executor for implementing task dispatching and status query.

8. A quick startup system for an operating system, characterized in that: The system is applied to BootLoader, and a job scheduler and a job executor are deployed in BootLoader to implement a job distribution and scheduling communication mechanism, which specifically includes: The BootLoader loading module is used to start the operating system after the power is connected, run the BootROM and load the BootLoader, the main CPU core initializes the job scheduler, and the auxiliary CPU core enters the waiting state; The auxiliary CPU core wake-up module is used for the main CPU core to wake up the auxiliary CPU core through the wake-up mechanism, so that the auxiliary CPU core enters the job executor and waits for the execution of the job; The job distribution module is used for the main CPU core to convert the initialization work into a job, distribute the job to the job executor of the auxiliary CPU core through the job scheduler for execution, and return the execution result to the job scheduler after the execution is completed; The exit executor module is used to close the job executor after the execution process is completed. The main cpu core sends an exit executor command. After receiving the exit executor command, the auxiliary cpu core exits the executor and enters a waiting state to complete the BootLoader. The OS kernel running module is used to complete the initialization of the operating system and the establishment of the operating environment through the OS kernel, and the operating system is started.

9. A fast boot device for an operating system, characterized in that: The device comprises: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a fast startup method for an operating system as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for quickly starting an operating system as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Quick start method and device of embedded operation system

    CN104778066A

  • Embedded system with quick start function, start method, computer equipment and storage medium

    CN117453296A