Quick starting method, system and equipment of operating system and storage medium

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.

CN119621162AActive Publication Date: 2025-03-14HUAZHI (BEIJING) TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411798607.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-14
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 CN119621162A_ABST
    Figure CN119621162A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a quick starting method, system and equipment of an operating system and a storage medium, according to the embodiment of the invention, a distribution scheduling communication mechanism of jobs is realized by deploying a job scheduler and a job executor in BootLoader, and the jobs are executed in an asynchronous task distribution mode, so that the BootLoader is optimized. According to the embodiment of the invention, the operating system can be quickly started in an environment needing quick response and high efficiency, the BootLoader does not need to be replaced, the adjustment of an overall software scheme of the chip is not involved, the dependence on a chip manufacturer is small, and the feasibility of chip development is greatly improved; and meanwhile, depth function tailoring customization is not involved, and universality is achieved.
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] In order to speed up the boot process, two methods are generally used: 1) Replace the BootLoader with one that supports multithreading. Use multithreading to perform different initialization tasks separately; 2) Simplify the process based on the existing BootLoader. Reduce the execution time by simplifying the functions.

[0008] However, replacing the BootLoader involves adjusting the overall chip software solution, which is heavily dependent on the chip manufacturer and is not feasible for chip application development. Simplifying the BootLoader process involves deep functional tailoring and customization, which is not universal. Summary of the invention

[0009] To this end, the 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 prior art accelerates the startup by simplifying the BootLoader process, which involves deep function tailoring and customization, and is not universal.

[0010] In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions:

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

[0012] 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;

[0013] 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;

[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 the execution is completed;

[0015] 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;

[0016] The OS kernel completes the initialization of the operating system and the establishment of the operating environment, and the operating system is started.

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

[0018] Furthermore, 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 the job, including:

[0019] Get the required number of auxiliary CPU cores;

[0020] 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.

[0021] Furthermore, the main cpu core converts the initialization work into a job, distributes the job to the job executor of the auxiliary cpu core for execution through the job scheduler, and returns the execution result to the job scheduler after the execution is completed, including:

[0022] By calling the interface of the job scheduler, the task function is distributed to the job executor of the auxiliary cpu core for execution;

[0023] The job distribution process is an asynchronous execution process that is executed multiple times.

[0024] Furthermore, the initialization work includes parallel initialization of various peripheral drivers, and reading and loading of large files.

[0025] Furthermore, after the execution process is completed, the job executor is closed, the main cpu core sends an exit executor command, and the auxiliary cpu core exits the executor and enters a waiting state after receiving the exit executor command, completing 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-awaken the auxiliary CPU core.

[0027] Furthermore, the method further comprises:

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

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

[0030] The BootLoader loading module is used to run the BootROM and load the BootLoader after the power supply is connected to start the operating system, the main CPU core initializes the job scheduler, and the auxiliary CPU core enters a 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 for the execution of the job;

[0032] 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;

[0033] 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.

[0034] 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.

[0035] According to a third aspect of an embodiment of the present invention, there is provided a fast startup device for an operating system, the device comprising: 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 items.

[0038] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. 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 items are implemented.

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

[0040] The embodiment of the present invention implements the distribution and scheduling communication mechanism of the job by deploying the job scheduler and the job executor in the BootLoader, and optimizes the BootLoader by using the asynchronous distribution task method to execute the job. The embodiment of the present invention can quickly start the operating system in an environment requiring fast response and high efficiency, without replacing the BootLoader, without involving the adjustment of the overall chip software solution, with less dependence on chip manufacturers, and greatly improving the feasibility of chip development; at the same time, it does not involve deep function tailoring and customization, and has universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0042] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0043] Figure 1 A schematic diagram of the logical structure of a quick startup system of an operating system provided by an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of a flow chart of a method for quickly starting an operating system provided by an embodiment of the present invention;

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

[0046] Figure 4 A schematic diagram of the operation flow of a main CPU core and an auxiliary CPU core in a fast startup method of an operating system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are 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 are within the scope of protection of the present invention.

[0048] 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.

[0049] In order to speed up the boot process, two methods are generally used: 1) Replace the BootLoader with one that supports multithreading. Use multithreading to perform different initialization tasks separately; 2) Simplify the process based on the existing BootLoader. Reduce the execution time by simplifying the functions.

[0050] However, replacing the BootLoader involves adjusting the overall chip software solution, which is heavily dependent on the chip manufacturer and is not feasible for chip application development. Simplifying the BootLoader process involves deep functional tailoring and customization, which is not universal.

[0051] In order to solve the technical problem that the above-mentioned accelerated startup method by simplifying the BootLoader process involves deep function tailoring and customization, and is not universal.

[0052] refer to Figure 1 The embodiment of the present invention discloses a fast startup system of an operating system, which includes: a BootLoader loading module 1; an auxiliary CPU core wake-up module 2; a job distribution module 3; an exit executor module 4; and an OSkernel running module 5.

[0053] Corresponding to the above disclosed operating system quick startup system, the embodiment of the present invention further discloses an operating system quick startup method. The following describes in detail the operating system quick startup method disclosed in the embodiment of the present invention in combination with the above described operating system quick startup system.

[0054] refer to Figure 2 and Figure 4 The present invention discloses a method for quickly starting an operating system. The method is applied to BootLoader, and a job scheduler and a job executor are deployed in BootLoader to realize a distribution and scheduling communication mechanism of jobs.

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

[0056] After the power supply is connected and the operating system is started, 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.

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

[0058] 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 execution is completed.

[0059] During the execution of the main CPU, the time-consuming initialization work is used as a job to trigger the execution of the auxiliary CPU core, 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 is executed, the status is returned to the job scheduler. The main CPU core can check the completion status of the job in the subsequent process.

[0060] 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 operating system is initialized and the operating environment is established through the OSkernel, 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 and enters 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 the job scheduler and executor (Job ExecutionUnit) in the bootloader. The job executor can execute the functional functions in the bootloader.

[0063] Furthermore, the job executor is used to execute the functional functions in the BootLoader.

[0064] Furthermore, 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: obtaining auxiliary cpu core required quantity data; the main cpu core sets each auxiliary cpu core according to the auxiliary cpu core required quantity data and wakes up the auxiliary cpu core.

[0065] Furthermore, the main CPU core converts the initialization work into a job, distributes the job to the job executor of the auxiliary CPU core for execution through the job scheduler, and returns the execution result to the job scheduler after execution, including: distributing the task function to the job executor of the auxiliary CPU core for execution by calling the interface of the job scheduler.

[0066] 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 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 to complete the BootLoader, including: the main cpu core triggers the auxiliary cpu core through the job executor to re-enter the waiting state, waiting for the subsequent operating system kernel to re-wake up the auxiliary cpu core.

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

[0070] Furthermore, the method also includes: a queue mechanism based on shared memory is provided between the job scheduler and the job executor, for implementing task delivery and status query.

[0071] A shared memory-based queue mechanism is used between the scheduler and the executor to implement task delivery and status query.

[0072] The main CPU core distributes the time-consuming work to the execution unit of the auxiliary CPU through the scheduler for execution. The executor returns the result 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 also provides a quick startup device for an operating system, the device comprising: 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 quick startup method for an operating system as described in any of the above items.

[0074] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. 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 items are implemented.

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

[0076] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field 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 completes the steps of the above method in combination with its hardware.

[0077] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0078] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0079] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM).

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

[0081] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, 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. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0082] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed 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 comprises: 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

  • Task scheduling control method, task scheduler and task processing device

    CN111026523A

  • Starting method and device of embedded equipment, embedded equipment and storage medium

    CN115237480A

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

    CN117453296A