A firmware startup method based on multi-core technology
By dividing UEFI startup tasks into parallel subtasks and using a lightweight scheduler, the startup process is optimized for multi-core CPUs, reducing delays and enhancing efficiency and adaptability.
Patent Information
- Application Number
- CN202411950768.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The existing UEFI startup process fails to fully utilize parallel processing capabilities in a multi-core CPU environment, resulting in long startup time and inefficient efficiency.
After the SEC stage, the initialization task is divided into multiple parallel subtasks, and a lightweight parallel task scheduler and resource monitoring module are introduced, and a multi-core CPU is used for dynamic scheduling and synchronization, and resource allocation is optimized.
Significantly shortens the system startup time, improves startup efficiency, and has good adaptability and resource utilization efficiency.
Smart Images

Figure CN119883554B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Unified Extensible Firmware Interface (UEFI), and more particularly to a firmware startup method based on multi-core technology. Background Art
[0002] Currently, as the mainstream hardware startup method, UEFI (Unified Extensible Firmware Interface) provides a relatively complete startup process and functions. However, in today's era of the increasing popularity of multi-core CPUs, its serial execution startup steps fail to fully utilize the multi-core parallel processing capabilities of modern hardware. This results in unnecessary time delays during startup, affecting the overall efficiency of system startup and user experience.
[0003] The existing UEFI startup process includes six main steps:
[0004] SEC: Primarily responsible for initializing the CPU and some basic hardware resources, such as the memory controller. It also sets up a temporary stack and loads the initial code for the next stage (PEI);
[0005] PEI: Responsible for initializing the basic hardware resources of the system, including setting up the RAM and making it available for subsequent stages. This stage also includes initializing necessary peripheral devices, such as the USB controller, to enable access to additional storage devices, and then transferring control to DXE.
[0006] DXE: Initializes the DXE base services, schedules the execution of DXE drivers, and then transfers control to BDS.
[0007] BDS: Executes the startup policy, initializes the console device, loads necessary device drivers, and loads and executes startup items.
[0008] TSL: Executed by the operating system loader, and the system resources are still controlled by the UEFI kernel until the RT stage is entered after calling ExitBootServices.
[0009] RT: The control of the system is transferred from the UEFI kernel to the OS loader, and various resources occupied by UEFI are reclaimed by the OS loader, and only the UEFI runtime services are reserved for the OS loader and the OS to use.
[0010] The main drawback of the existing UEFI startup process is that its serial execution method fails to fully utilize the parallel processing capabilities of multi-core CPUs, resulting in a long startup time and low efficiency. Summary of the Invention
[0011] In view of the above problems, the present invention is proposed to provide a firmware startup method based on multi-core technology that overcomes or at least partially solves the above problems.
[0012] According to one aspect of the present invention, there is provided a firmware startup method based on multi-core technology, and the firmware startup method includes:
[0013] After the SEC stage is completed, divide the initialization tasks into multiple parallelizable subtasks;
[0014] Dynamically allocate and schedule the parallel subtasks.
[0015] Optionally, the step of dividing the initialization tasks into multiple parallelizable subtasks after the SEC stage is completed specifically includes:
[0016] After the SEC stage is completed, divide the initialization tasks of the PEI, DXE, and BDS stages into parallelizable subtasks and execute them simultaneously using a multi-core CPU.
[0017] Optionally, the step of dynamically allocating and scheduling the parallel subtasks specifically includes:
[0018] Introduce a lightweight parallel task scheduler to dynamically allocate and schedule parallel tasks, ensuring correct synchronization and dependency relationships between tasks.
[0019] Optionally, the step of introducing a lightweight parallel task scheduler to dynamically allocate and schedule parallel tasks, ensuring correct synchronization and dependency relationships between tasks specifically includes:
[0020] Establish a computing resource monitoring module for recording and monitoring the scheduling policy, resource usage, and startup time of each scheduling;
[0021] And use machine learning algorithms to summarize the data of each task execution and retrain the startup scheduling policy prediction model.
[0022] Optionally, the method of the task scheduler includes: after each CPU is initialized, start the scheduler on CPU0;
[0023] Initialize the mutex of the parallel resource initialization list and store it in the shared level-1 cache;
[0024] Each CPU executes the resource initialization scheduling task in parallel, and realizes synchronous access to the parallel resource initialization list through the mutex of the parallel resource initialization list;
[0025] For the resource initialization scheduling task, under the premise of meeting the priority and the precondition resource scheduling, arrange the scheduling tasks of each CPU's resources through the resource configuration prediction model to complete the CPU resource arrangement of the initialization tasks;
[0026] According to the resource arrangement, each CPU completes the hardware resource initialization in parallel;
[0027] The resource monitoring module records the monitoring results of this startup;
[0028] After the machine starts up, the resource monitoring module transmits the data of this startup to the intelligent scheduling model training module, regenerates a new scheduling model, and updates it for generating the next scheduling policy.
[0029] Optionally, the monitoring results include: power consumption, resource utilization rate, and final startup time.
[0030] Optionally, the data of this startup includes the resource allocation table generated by the scheduling policy, the resource consumption situation, and the startup time.
[0031] A firmware startup method based on multi-core technology provided by the present invention, the firmware startup method includes: after the SEC stage is completed, dividing the initialization tasks into multiple parallelizable subtasks; dynamically allocating and scheduling the parallel subtasks. By redesigning the startup process, the steps that can be executed in parallel can run simultaneously in a multi-core environment, and an intelligent scheduling module and a resource monitoring module are introduced, greatly shortening the system startup time, improving the startup efficiency, and at the same time ensuring that the startup policy has good self-adaptability.
[0032] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are specifically exemplified below. Brief Description of the Drawings
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0034] Figure 1 It is a flowchart of parallel hardware resource startup provided by an embodiment of the present invention;
[0035] Figure 2 It is a schematic diagram of an intelligent scheduler provided by an embodiment of the present invention. Detailed Embodiments
[0036] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be completely conveyed to those skilled in the art.
[0037] In the embodiments of the specification, claims and drawings of the present invention, the terms "comprising", "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, including a series of steps or units.
[0038] The following will further describe the technical solutions of the present invention in detail with reference to the drawings and embodiments.
[0039] The present invention proposes a multi-core parallel UEFI startup process, which specifically includes:
[0040] As Figure 1 shown, parallel initialization: After the SEC stage is completed, the initialization tasks of stages such as PEI, DXE, and BDS are divided into parallel subtasks and executed simultaneously using a multi-core CPU. For example, memory initialization (PEI part) and device driver loading (DXE part) are carried out in parallel, and the startup policy execution (BDS part) starts after these initialization tasks are completed, but also runs in parallel with other non-conflicting tasks.
[0041] Dynamic scheduling and synchronization: Introduce a lightweight parallel task scheduler responsible for dynamically allocating and scheduling parallel tasks to ensure correct synchronization and dependency relationships between tasks and avoid data competition and deadlocks.
[0042] Introduce a computing resource monitoring module for recording and monitoring the scheduling policies, resource usage, and startup times of each time. And use machine learning algorithms to summarize the data of each task execution and retrain the startup scheduling policy prediction model.
[0043] As Figure 2 shown, the basic steps of the dynamic scheduler are as follows: After each CPU is initialized, start the scheduler on CPU0:
[0044] Initialize the "parallel resource initialization list". This list stores the initialization status of each hardware resource (RAM, USB, PCIE), all of which are 0. This table is also the basis table for the scheduling policy. The "parallel resource initialization list" is stored in the shared level-1 cache.
[0045] Parallel resource initialization list
[0046]
[0047]
[0048] Initialize the mutex of the resource "parallel resource initialization list". This lock is also stored in the shared level-1 cache.
[0049] Each CPU executes the resource initialization scheduling task in parallel, and realizes the synchronous access to the "parallel resource initialization list" through the mutex of the "parallel resource initialization list".
[0050] The resource initialization scheduling task arranges the scheduling tasks of each CPU resource through the resource configuration prediction model on the premise of meeting the priority and the previous resource scheduling, and completes the CPU resource arrangement of the initialization task.
[0051] According to the resource arrangement, each CPU completes the hardware resource initialization in parallel.
[0052] The resource monitoring module records the monitoring results of this startup (power consumption, resource utilization rate, final startup time, etc.).
[0053] After the machine starts up, the resource monitoring module transmits the data of this startup (including the resource allocation table generated by the scheduling policy, resource consumption, startup time) to the intelligent scheduling model training module to regenerate a new scheduling model and update it for generating the next scheduling policy.
[0054] Through the above closed-loop iterative method, the startup performance of the hardware is continuously improved, and it has good self-adaptability to the scenario of newly added hardware.
[0055] Resource optimization and management: Optimize the resource allocation and management during the UEFI startup process to ensure the efficient utilization of resources during multi-core parallel execution, and at the same time reserve enough resources for the subsequent operating system loader (OS loader) to use.
[0056] During the multi-CPU scheduling process, by configuring the content of the "parallel resource initialization list", the OS loader is also managed as a special resource, and its execution resources are ensured by solidifying its initialized CPU.
[0057] And through the priority, ensure that it can start to execute after the smallest set of previous hardware is started up.
[0058] Parallel resource initialization list
[0059]
[0060]
[0061] Beneficial effects: Significantly improve the startup speed: By multi-core parallel execution, the system startup time is greatly shortened, and the user experience is improved.
[0062] Efficient resource utilization: Make full use of the processing power of multi-core CPUs to improve the resource utilization efficiency during startup.
[0063] Good self - adaptability: The designed intelligent parallel task scheduler and resource management mechanism have good scalability and self - adaptability. When the hardware resources change, the startup strategy can automatically complete the adaptive adjustment of the startup strategy at the next startup according to the analysis of the previous rounds of hardware monitoring and startup data.
[0064] The above - mentioned specific implementation manners have further detailed the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above are only the specific implementation manners of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A firmware startup method based on multi-core technology, characterized in that The firmware startup method includes: After the SEC stage is completed, divide the initialization tasks into multiple parallelizable subtasks; Dynamically allocate and schedule parallel subtasks, including: Introduce a lightweight parallel task scheduler to dynamically allocate and schedule parallel tasks, ensuring correct synchronization and dependency relationships between tasks, including: Establish a computing resource monitoring module for recording and monitoring the scheduling policy, resource usage, and startup time of each scheduling; And use machine learning algorithms to summarize the data of each task execution and retrain the startup scheduling policy prediction model; The method of the task scheduler includes: after each CPU is initialized, start the scheduler on CPU0; Initialize the mutex of the parallel resource initialization list and store it in the shared level-1 cache; Each CPU executes the resource initialization scheduling task in parallel and realizes synchronous access to the parallel resource initialization list through the mutex of the parallel resource initialization list; The resource initialization scheduling task, under the premise of meeting the priority and the previous resource scheduling, arranges the scheduling tasks of each CPU resource through the resource configuration prediction model to complete the CPU resource arrangement of the initialization task; According to the resource arrangement, each CPU completes the hardware resource initialization in parallel; The resource monitoring module records the monitoring results of this startup; After the machine starts up, the resource monitoring module transmits the data of this startup to the intelligent scheduling model training module to regenerate a new scheduling model and update it for generating the next scheduling policy.
2. The firmware startup method based on multi-core technology according to claim 1, wherein The specific content of dividing the initialization tasks into multiple parallelizable subtasks after the SEC stage is completed includes: After the SEC stage is completed, divide the initialization tasks of the PEI, DXE, and BDS stages into parallelizable subtasks and use multiple-core CPUs to execute them simultaneously.
3. The firmware startup method based on multi-core technology according to claim 1, characterized in that, The monitoring results include: power consumption, resource utilization rate, and final startup time.
4. A firmware startup method based on multi-core technology according to claim 1, characterized in that, The data of this startup includes the resource allocation table generated by the scheduling policy, the resource consumption situation, and the startup time.
Citation Information
Patent Citations
Dynamic load balancing method for CPU+GPU CPPC
CN103902387A
Firmware boot task distribution for implementing low latency boot performance
CN114296750A