Computer device startup methods, computer device startup devices, media and program products
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2026-05-29
- Publication Date
- 2026-06-30
AI Technical Summary
During the PXE boot process, computing devices may experience a random boot crash, mainly due to the boot image and boot firmware having the same running priority during network driver exit and network configuration operations, leading to a deadlock.
By adjusting the execution priority of the boot image's exit procedure to be higher than that of the interrupt procedure, deadlock can be avoided by ensuring that the exit procedure runs before the interrupt procedure.
It effectively prevents the boot image from intercepting the network server's response messages, ensures the boot firmware exits normally, solves the boot crash problem, and improves the boot success rate of computing devices.
Smart Images

Figure CN122308941A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to computer device startup methods, computer device startup devices, media, and program products. Background Technology
[0002] PXE (Preboot Execution Environment) booting refers to the process by which a computing device establishes a communication connection with a network server and completes the boot process based on the bootloader and system-related files obtained from the network server. Here, "computing device" refers to a device with computing capabilities, such as a server or personal computer.
[0003] Currently, in some PXE boot technologies, computing devices can boot by running UEFI (Unified Extensible Firmware Interface) firmware, downloading iPXE firmware from a network server, and then running the iPXE firmware. iPXE firmware is an enhanced version of UEFI, theoretically greatly improving the flexibility and efficiency of computing device booting. However, in some network environments, boot crashes occur intermittently. Therefore, it is necessary to investigate the causes of boot crashes and provide relevant solutions. Summary of the Invention
[0004] This application provides a method for starting a computing device, a device for starting a computing device, an electronic device, a computer-readable storage medium, and a computer program product, to at least solve the problem of probabilistic startup crashes during PXE startup in related technologies.
[0005] This application provides a method for starting a computing device, including: In response to receiving a device boot command, the first network driver of the boot firmware is run, and the boot image is obtained through the network card of the computing device; The second network driver of the boot image is run, and the exit procedure of the first network driver is triggered. The second network driver includes an interrupt routine, which is used to acquire the data received by the network card. If the interrupt routine and the exit routine have the same running priority, then the running priority of the exit routine is adjusted so that the exit routine runs before the interrupt routine; The exit procedure is run to cause the first network driver to exit operation, and the interrupt procedure based on the second network driver interacts with the network server to start the computing device.
[0006] This application also provides a computer device startup device, comprising: The firmware execution module is used to respond to the received device boot command, run the first network driver of the boot firmware, and obtain the boot image through the network card of the computing device; The image execution module is used to run the second network driver of the boot image and trigger the exit program of the first network driver. The second network driver includes an interrupt routine, which is used to acquire the data received by the network card. The priority adjustment module is used to adjust the running priority of the exit program if the interrupt program and the exit program have the same running priority, so that the exit program runs before the interrupt program. The device startup module is used to run the exit program to cause the first network driver to exit, and to interact with the network server based on the interrupt program of the second network driver to start the computing device.
[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of the above-described computing device startup method when executing the computer program.
[0008] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described computing device startup method.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described computing device startup method.
[0010] In some embodiments of this application, the first network driver running the boot firmware can obtain the boot image through the network card of the computing device. The second network driver running the boot image can obtain data received by the network card through the interrupt routine of the second network driver. After the exit routine of the first network driver is triggered, if the interrupt routine and the exit routine of the first network driver have the same running priority, the running priority of the exit routine is adjusted so that the exit routine runs before the interrupt routine. In this way, the boot image can be prevented from intercepting the response message returned by the network server to the boot firmware through the interrupt routine, and the normal exit of the first network driver can be guaranteed. This can avoid deadlock problems between the boot engine and the boot firmware, and thus solve the problem of computing device startup freezing caused by deadlock problems. Attached Figure Description
[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram of the PXE network architecture; Figure 2 A flowchart illustrating a computing device startup method provided for some embodiments of this application; Figure 3 A schematic diagram of a computing device startup apparatus provided for some embodiments of this application; Figure 4 A schematic diagram of the modules of an electronic device provided for some embodiments of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0014] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] See also Figure 1 This is a schematic diagram of the PXE network architecture. Figure 1In this context, each computing device may include, but is not limited to, network interface cards (NICs), central processing units (CPUs), graphics processing units (GPUs), peripheral component interconnect express (PCIe), basic input / output systems (BIOS), and storage media (such as memory and hard drives). The network server may include, but is not limited to, DHCP (Dynamic Host Configuration Protocol) service components, file service components, and network interface modules. The DHCP service component can perform the following operations: listening on UDP (User Datagram Protocol) ports, managing DUIDs (DHCP Unique Identifiers), assigning network addresses to computing devices, and providing PXE boot options. The file service component can store and manage the following files: the PXEboot file, the iPXE boot image, the GRUB2 (GRand Unified Bootloader version 2) boot directory, and the kernel file. The network interface module can be used to listen on DHCP ports and allows binding of multiple GUAs (Global Unicast Addresses), ULAs (Unique Local Addresses), multicast group subscriptions, etc. Based on Figure 1 The network architecture shown below, using UEFI as the boot firmware, will be used to describe the PXE boot process of some computing devices.
[0017] After the central processing unit of a computing device receives the device boot instruction, it can run the basic input / output system and enter the computing device boot process. Specifically, the computing device boot process includes, but is not limited to, the SEC (Security Phase), PEI (Pre-EFI Initialization), DXE (Driver Execution Environment), and BDS (Boot Device Selection). Each phase is described below.
[0018] During the SEC phase, the CPU reads the boot firmware UEFI from a fixed memory address (e.g., 0xFFFFFFF0) of the computing device and checks whether the boot firmware UEFI has been tampered with. If the boot firmware UEFI has not been tampered with, the CPU runs the boot firmware UEFI, which can perform memory initialization and establish a temporary cache stack, and then execute the operations of subsequent stages.
[0019] During the PEI phase, the central processing unit (CPU) performs hardware initialization. This includes tasks such as memory controller configuration, CPU microcode updates, register settings, and basic PCIe bus initialization.
[0020] During the DXE phase, the central processing unit (CPU) can enumerate the PCIe devices of the computing device, such as network interface controllers and accelerators. Simultaneously, it can perform deep initialization on each PCIe device. Deep initialization includes, but is not limited to, the following: 1) Read device information from the PCI configuration space of the PCIe device, and read device firmware from the Option ROM (Optional Read-Only Memory) of the PCIe device, and verify the PXE compatibility of the device firmware.
[0021] Specifically, the PCI configuration space is a fixed-size memory area within a PCIe device. This memory area contains pre-programmed device information, such as device ID, manufacturer, and device type. Based on the device information in the PCI configuration space, if the PCIe device is determined to be a network card, the central processing unit (CPU) can read the network card firmware from the network card's Option ROM and load it into the computing device's memory for execution. During the execution of the network card firmware, the CPU can control the network card, enabling it to function normally, such as sending and receiving network messages. The aforementioned verification of the device firmware's PXE compatibility essentially verifies whether the device firmware supports both the PXE and UEFI protocols.
[0022] 2) For network cards supporting both PXE and UEFI protocols, the UEFI network driver in the boot firmware is bound to the network card, and a UEFI network protocol stack is established. The UEFI network protocol stack can include, but is not limited to, ICMPv6 (Internet Control Message Protocol version 6). The central processing unit running the UEFI boot firmware can communicate with the network server through the network card. For example, it can send messages to the network server, receive data from the network server, or receive responses from the network server.
[0023] During the BDS phase, the CPU, based on the PCIe device's device information and boot configuration, identifies the target network interface card (NIC) in the computing device used for PXE boot and instantiates the UEFI network protocol stack for the target NIC. For example, taking IPv6 communication as an example, the CPU uses the ICMPv6 Neighbor Discovery protocol to perform RS (Router Solicitation) and RA (Router Advertisement) interactions to complete the link-local address configuration and obtain network parameters. Then, it initiates a DHCPv6 handshake process similar to the following: 1) Send a Solicit message to the multicast address to probe for at least one available network server.
[0024] 2) Parse the Advertise messages returned by each network server, and based on the parsing results, confirm the identity and available configuration of each network server.
[0025] 3) Send a Request message to the specified network server to request specific network configuration and startup file information.
[0026] 4) Receive the Reply message returned by the designated network server to complete the PXE service registration. This establishes a communication connection between the computing device and the network server.
[0027] After completing the above handshake process, the central processing unit runs the boot firmware UEFI stored in the storage medium, obtains and runs the boot image iPXE from the network server. The specific execution steps are as follows: 1) Obtain the iPXE boot image from the network server via the PXE network card.
[0028] 2) Call the LoadImage() function to load the boot image iPXE into the memory of the computing device, and call the StartImage() function to run the boot image iPXE.
[0029] 3) Run the boot image iPXE to complete the startup of the computing device.
[0030] The iPXE boot image is an enhanced version of the UEFI boot firmware, which theoretically can greatly improve the flexibility and efficiency of computing device startup. However, in IPv6 network environments, it occasionally causes startup crashes. Therefore, it is necessary to find the cause of the startup crashes and provide relevant solutions.
[0031] Specifically, technical personnel analyzed the startup logs of computing devices, network server operation logs, and the iPXE boot process in the IPv6 network environment. They discovered that when the CPU runs the iPXE boot image, it simultaneously performs iPXE network configuration operations and UEFI network driver exit operations. After successfully executing these two operations, the UEFI network driver in the boot firmware exits, and the iPXE network driver in the boot image can take over and exclusively use the network card. However, during the simultaneous execution of these two operations, the iPXE boot image and the UEFI boot firmware compete for the network card's usage rights, and deadlocks may occur probabilistically, leading to boot crashes. The specific causes of this problem are analyzed in detail below.
[0032] Specifically, through analysis, technicians discovered that the above iPXE network configuration operation includes the following steps: 1) Perform iPXE initialization and call the InstallProtocolInterface() function to register a custom SNP (Simple Network Protocol) interface with the UEFI network protocol stack. Subsequently, the central processing unit can communicate with the network server through this SNP interface.
[0033] 2) Reset the PXE network card's DMA (Reset NIC DMA Engine, Direct Memory Access) engine. Specifically, the DMA engine is a hardware module within the PXE used to perform data transfer. After the UEFI network driver in the boot firmware uses the DMA engine for data transfer, the DMA engine may have cached memory addresses and transfer states. If the boot image iPXE directly uses these memory addresses and transfer states, it will cause data transfer problems. Therefore, resetting the DMA engine can clear the cached memory addresses and transfer states, ensuring the correctness of subsequent data transfers.
[0034] 3) Reconfigure the descriptor ring. Specifically, the descriptor ring is a circular linked list located in the memory of the computing device. The circular linked list is used to record the addresses of multiple buffers. By reconfiguring the descriptor ring, a new descriptor ring can be created, avoiding the influence of the old descriptor ring.
[0035] 4) Update MAC (Media Access Control) filter settings. In this step, the boot image iPXE can modify the register values of the PXE network card and update the filtering rules. This eliminates the influence of the old filter settings.
[0036] 5) Trigger the interrupt routine. When the interrupt routine runs, the boot image iPXE can obtain data from the network card.
[0037] The above UEFI network driver exit operation includes the following steps: 1) Send a driver exit command to the boot firmware UEFI to control the UEFI's network driver to exit operation. This allows the iPXE network driver in the boot image to completely take control of the network hardware and exclusively use the PXE network card. After receiving the driver exit command, the boot firmware UEFI must strictly execute the following steps before controlling its network driver to exit operation: 11) Construct a Release message containing IAID (Identity Association Identifier) and DUID (DHCP Unique Identifier).
[0038] 12) Set the transaction ID to match the session that sent the Release message mentioned above.
[0039] 13) Send the Release message to the network server via the PXE network card.
[0040] 14) Run a loop polling program to query data from the network card in a loop to determine whether a response message has been received from the network server. If a response and message are received from the network server, control the network driver to exit operation.
[0041] 2) Trigger UEFI environment cleanup. This includes, but is not limited to, releasing memory allocated to the boot firmware UEFI network driver (such as receive / transmit buffers), disabling interrupt listening to the PXE network card by the boot firmware UEFI network driver, disabling timers created by the boot firmware UEFI network driver, and releasing UDP ports occupied by the boot firmware UEFI network driver. By performing driver cleanup operations, hardware resources occupied by the boot firmware UEFI network driver can be released in a timely manner, ensuring the normal operation of the boot image iPXE.
[0042] Based on the above description, the root cause of the boot crash is that when the CPU performs iPXE network configuration operations, it runs an interrupt routine to obtain data from the network card. Similarly, when performing UEFI network driver exit operations, it runs a loop polling routine to obtain response messages from the network server. Since the iPXE network configuration and UEFI network driver exit operations occur simultaneously, the order in which the CPU runs the loop polling routine and the interrupt routine is uncertain. The CPU may run the interrupt routine first, followed by the loop polling routine, or vice versa. Furthermore, because the loop polling routine and the interrupt routine have the same priority (both at the TPL_CALLBACK level), they cannot interrupt each other. That is, if the CPU runs either of these programs, it must wait for that program to finish before it can run the other. For example, if the CPU runs the loop polling routine first, it must wait for the loop polling routine to finish before it can run the interrupt routine. For example, if the central processing unit runs the interrupt routine first, the loop polling routine can only run after the interrupt routine has finished running.
[0043] Furthermore, technicians discovered that if the CPU runs the interrupt routine first, the boot image iPXE may intercept the response messages returned by the network server to the boot firmware UEFI. This can prevent the UEFI network driver from exiting execution, leading to deadlock and boot crashes. For clarity, an example is provided below.
[0044] For example, suppose the central processing unit performs the following operations according to points in time: At 11:30:20, the boot firmware UEFI was run, and a Release message was sent to the network server. The interrupt routine for running the iPXE boot image was triggered at 11:30:21. The loop polling program was triggered at 11:30:22.
[0045] At the same time, the network card received a response message from the network server at 11:20:23 regarding the boot firmware UEFI.
[0046] Based on the above assumptions, if the interrupt routine finishes running at 11:30:25, then at 11:30:23, the loop polling routine is still in a waiting state and has not actually started. In this case, the boot image iPXE, through the interrupt routine, can obtain the response message returned by the network server to the boot firmware UEFI from the network card at 11:20:23, which is equivalent to intercepting the response message returned by the network server to the boot firmware UEFI. Since this response message is not returned to the boot image iPXE, the boot image iPXE will fail to parse the response message and discard it. Consequently, when the CPU runs the loop polling routine at 11:30:25 and obtains the response message returned by the network server from the network card, because this response message has been intercepted by the interrupt routine of the boot image iPXE, the boot firmware UEFI cannot obtain the response message through the loop polling routine. Therefore, the network driver of the boot firmware UEFI cannot exit, resulting in a deadlock and a boot crash.
[0047] Based on the above description, this application provides a method for booting a computing device, which can solve the aforementioned problems. This method for booting a computing device can be applied to the central processing unit (CPU) in a computing device. (See also...) Figure 2 This is a flowchart illustrating a computing device startup method provided in some embodiments of this application. Figure 2 The computer device startup method includes the following steps: Step S201: In response to receiving the device boot command, the first network driver of the boot firmware is run, and the boot image is obtained through the network card of the computing device.
[0048] Specifically, the central processing unit (CPU) in a computing device can receive device startup commands in various ways. For example, the computing device may include a baseboard management controller (BMC). The BMC is connected to the CPU. Maintenance personnel can issue device startup commands through the BMC's control interface. The CPU can receive these commands from the maintenance personnel via the BMC. Alternatively, the BMC in the computing device may be connected to a cloud management platform. The CPU can receive device startup commands from the cloud management platform via the BMC. Another example is that the computing device may include a hardware startup button. When the CPU detects that the hardware startup button has been triggered, it indicates that it has received a device startup command. This application does not limit the method of receiving device startup commands.
[0049] In this embodiment, the boot firmware is the aforementioned UEFI firmware, and the boot image is the aforementioned iPXE image. The boot image is stored on the network server. During the execution of the first network driver, the central processing unit can perform the first configuration of the network card and establish a first communication connection with the network server through the network card. During the execution of the UEFI firmware, it can communicate with the network server based on the first communication connection and obtain the boot image from the network server.
[0050] Step S202: Run the second network driver of the boot image and trigger the exit program of the first network driver. The second network driver includes an interrupt routine, which is used to acquire data received by the network card.
[0051] In this embodiment, during the execution of the second network driver, the central processing unit can perform a second configuration of the network card and establish a second communication connection with the network server through the network card. During the execution of the interrupt routine, the boot image can interact with the network server through the second communication connection, obtain data sent by the network server, and then complete the startup of the computing device.
[0052] Simultaneously, during the establishment of the second communication connection, the exit procedure of the first network driver can also be triggered. Triggering refers to generating execution instructions for the exit procedure. After triggering the exit procedure, it may not run immediately; for example, it can run after executing step S203 below. The exit procedure is used to perform the aforementioned UEFI network driver exit operation, causing the first network driver to exit operation. After the first network driver exits operation, the boot image can exclusively occupy the network card connected to the network server and complete the boot of the computing device through the second communication connection.
[0053] Step S203: If the interrupt program and the exit program have the same running priority, the running priority of the exit program is adjusted so that the exit program runs before the interrupt program.
[0054] Before explaining step S203, the program's execution priority will be explained first.
[0055] In this embodiment, the program's execution priority can be divided into four levels: TPL_APPLICATION, TPL_NOTIFY, TPL_CALLBACK, and TPL_HIGH_LEVEL. The order of priority among these four levels is as follows: TPL_HIGH_LEVEL>TPL_NOTIFY>TPL_CALLBACK>TPL_APPLICATION.
[0056] Generally, for any two programs A and B, if program A has a higher execution priority than program B, then program A runs before program B, and program A can interrupt program B's execution. If program A has a lower execution priority than program B, then program A runs after program B, and program A cannot interrupt program B's execution. If program A has the same execution priority as program B, then program A and program B run according to the principle of "whoever is triggered first runs first" and "the first program cannot preempt the next program." For example, if program A is triggered first, then program A runs first. During the execution of program A, program B cannot interrupt program A. After program A completes its execution, program B can continue running. Similarly, if program B is triggered first, then program B runs first. During the execution of program B, program A cannot interrupt program B. After program B completes its execution, program A can continue running.
[0057] Based on the above description, in this embodiment, both the exit procedure and the interrupt procedure have the TPL_CALLBACK execution priority. As described above, since iPXE network configuration and UEFI network driver exit operations are performed simultaneously during the startup process of a computing device, the exit procedure and the interrupt procedure may deadlock each other if they have the same execution priority, leading to a startup crash. Therefore, this application proposes a solution: in response to the exit procedure being triggered, the execution priority of the exit procedure is adjusted so that it runs before the interrupt procedure.
[0058] Specifically, an elevation operation can be performed on the running priority of an exiting program. The elevation operation adjusts the exiting program's running priority to the first running priority, which is higher than the exiting program's running priority before the elevation operation. For example, assuming the exiting program's running priority was TPL_CALLBACK before the elevation operation, its running priority can be adjusted to the first running priority TPL_HIGH_LEVEL. The first running priority TPL_HIGH_LEVEL is higher than the exiting program's running priority TPL_CALLBACK before the elevation operation.
[0059] Based on the task execution logic between the different execution priorities described above, it can be understood that, since the execution priority of the exit program is equal to that of the interrupt program before the promotion operation, the execution priority of the exit program will be higher than that of the interrupt program after the promotion operation. Therefore, the execution of the interrupt program can be interrupted or prevented before or during the execution of the exit program. In this way, during the UEFI network driver exit operation, the boot engine can be prevented from intercepting the response message returned by the network server to the boot firmware through the interrupt program, thus ensuring the normal exit of the first network driver and resolving the boot crash problem.
[0060] Step S204: Run the exit program to shut down the first network driver and enable the interrupt program based on the second network driver to interact with the network server to start the computing device.
[0061] Specifically, after adjusting the execution priority of the exit program in step S203, the execution of the interrupt program can be effectively prevented before or during the exit program's execution. Consequently, the exit program can obtain the response message returned by the network server, causing the first network driver to exit. After the first network driver exits, the aforementioned first communication connection is broken, and the exit program also exits accordingly. The second network driver of the boot engine can then exclusively use the network card connected to the network server. At this point, the second network driver can interact with the network server based on its interrupt program to start the computing device.
[0062] In summary, in some embodiments of this application, the first network driver running the boot firmware can obtain the boot image through the network card of the computing device. The second network driver running the boot image can obtain data received by the network card through its interrupt routine. After triggering the exit routine of the first network driver, if the interrupt routine and the exit routine of the first network driver have the same running priority, the running priority of the exit routine is adjusted so that the exit routine runs before the interrupt routine. This prevents the boot image from intercepting the response message returned by the network server to the boot firmware through the interrupt routine and ensures the normal exit of the first network driver, thereby avoiding deadlock between the boot engine and the boot firmware, and thus solving the problem of computing device startup freezing caused by deadlock.
[0063] Furthermore, in practical applications, technicians have found that when modifying the execution priority of an exit program, adjustments must be made in ascending order of priority for the changes to take effect. For example, changing the execution priority of an exit program from TPL_CALLBACK to TPL_HIGH_LEVEL will take effect, but changing it from TPL_HIGH_LEVEL to TPL_CALLBACK will not.
[0064] Therefore, in some embodiments, adjusting the running priority of the exit program in step S203 includes: The exit program's running priority is sequentially boosted, downgraded, and restored. The boosting operation adjusts the exit program's running priority to the first running priority, the downgrade operation adjusts the exit program's running priority to the second running priority, and the restore operation restores the exit program's running priority. The first running priority is higher than the exit program's running priority before the boosting operation, and the second running priority is lower than the exit program's running priority before the boosting operation.
[0065] For example, suppose that before the promotion operation, the exit program's running priority is at the TPL_CALLBACK level. By performing a promotion operation, the exit program's running priority can be raised to the TPL_APPLICATION or TPL_NOTIFY level. By performing a downgrade operation, the exit program's running priority can be downgraded to the TPL_APPLICATION level. By performing a restore operation, the exit program's running priority can be readjusted back to the TPL_CALLBACK level.
[0066] In the above embodiments, the downgrade operation is performed first, followed by the recovery operation. This allows the running priority of the exiting program to be adjusted in order from low to high priority, thereby ensuring the effectiveness of the running priority adjustment and improving the reliability of the solution.
[0067] In some embodiments, the method of this application further includes: After performing the promotion, demotion, and recovery operations, check the running status of the interrupt routine; If the interrupt routine is not executed, then the exit routine will be executed. If the interrupt routine is running, then pause and exit the routine.
[0068] Specifically, the central processing unit (CPU) may include a status register. At the entry point of an interrupt routine, a first status setter function can be set, and at the exit point, a second status setter function can be set. When the interrupt routine is triggered and runs, the value in the status register can be modified to the first value based on the first status setter function. After the interrupt routine ends, the value in the status register can be modified to the second value based on the second status setter function. After performing promotion, downscaling, and restoration operations, the value in the status register can be checked. If the value in the status register is the first value, it indicates that the interrupt routine is running; if the value in the status register is the second value, it indicates that the interrupt routine is not currently running.
[0069] If the interrupt routine is not running, an exit routine can be run to cause the first network driver to exit. However, if the exit routine is running while the interrupt routine is in progress, the response message from the network server to the boot firmware may be intercepted by the boot image, potentially causing the boot process to freeze. To avoid this, the exit routine can be paused, and the value in the status register can be checked every first specified time interval (e.g., 0.1 seconds) to see if it has reached the second value. If the value in the status register changes from the first value to the second value, it indicates that the interrupt routine has stopped running, and the exit routine can then be run. This prevents the boot image from intercepting response messages through the interrupt routine. If, after a second specified time interval (e.g., 2 seconds), the value in the status register remains the first value, a boot error log can be generated to help technicians locate the boot failure problem.
[0070] In the above embodiments, the running status of the interrupt routine is detected after performing the promotion, reduction, and recovery operations. This avoids the problem of the interrupt routine remaining running due to abnormal conditions, improves the reliability of the solution, and further reduces the probability of startup freezes.
[0071] In some embodiments, the interrupt routine needs to be registered before it can be run. Based on this, the method of this application further includes: Within a preset time after registering the interrupt routine, the promotion, demotion, and recovery operations are performed. The preset time is less than the interrupt routine's startup time.
[0072] Specifically, since the interrupt routine runs after registration, it quickly executes promotion, demotion, and recovery operations within a preset timeframe after registration, triggering the exit routine. This allows the exit routine to run before the interrupt routine itself. If a run instruction for the interrupt routine is received after the exit routine has finished running, the interrupt routine can only be triggered after the exit routine has finished. By this time, the exit routine has already received its response message; therefore, the execution of the interrupt routine will not cause a startup freeze.
[0073] In the above embodiments, within a preset time period after the interrupt routine is registered, the promotion, demotion, and recovery operations are executed quickly. This allows the exit routine to run before the interrupt routine itself. Since the exit routine has the same running priority as the interrupt routine, the interrupt routine can only continue running after the exit routine has finished. That is, the interrupt routine will not run during the exit routine's execution. This greatly reduces the risk of the interrupt routine and exit routine locking up, thereby improving the startup success rate of the computing device.
[0074] In some embodiments, the method of this application further includes: Locate the first register used to store the execution priority; When performing promotion, downgrade, and recovery operations, the running priority is modified in the first register; The program will exit based on the execution priority in the first register.
[0075] Specifically, the execution priority in the first register is used to store the execution priority of the currently running program. For example, when running an interrupt routine, the first register stores the execution priority of the interrupt routine. When running an exit routine, the first register stores the execution priority of the exit routine. In other words, the value in the first register can be overwritten. For example, when running an interrupt routine, the execution priority of the interrupt routine can overwrite the original execution priority in the first register; when running an exit routine, the execution priority of the exit routine can overwrite the original execution priority in the first register. When the central processing unit (CPU) runs a program, it can determine the execution priority of the currently running program based on the value in the first register. When modifying the execution priority in the first register, it must be modified in order from low to high priority to ensure the effectiveness of the modification.
[0076] Based on the above description, when the running priority in the first register is the same as the running priority of the exit program, the following operations can be performed sequentially: modify the running priority in the first register to the first running priority, modify the running priority in the first register to the second running priority, and modify the running priority in the first register to the running priority of the exit program before the promotion operation. After performing the above operations, the exit program can be triggered.
[0077] In the above embodiments, on the one hand, storing the program's running priority in a first register facilitates the central processing unit's reading or modification of the running priority, improving the flexibility of the solution implementation. On the other hand, when the running priority in the first register is the same as the running priority of the exiting program, performing the above operations sequentially on the running priorities in the first register ensures the effectiveness of the running priority modification.
[0078] In some embodiments, modifying the running priority in the first register includes: If the running priority in the first register is lower than or equal to the running priority of the exit program, then the following operations are performed in sequence: modify the running priority in the first register to the highest running priority, modify the running priority in the first register to the lowest running priority, and modify the running priority in the first register to the running priority of the exit program before the promotion operation.
[0079] Specifically, if the execution priority in the first register is lower than or equal to the execution priority of the exit program, the execution of the interrupt program cannot be interrupted or prevented. Therefore, it is necessary to first raise the execution priority in the first register, then lower the execution priority in the first register, and then adjust the execution priority in the first register to the execution priority of the exit program before the raising operation. In this way, the execution of the interrupt program can be interrupted or prevented.
[0080] In these embodiments, the first running priority is the highest running priority, and the second running priority is the lowest running priority. Taking the four levels TPL_APPLICATION, TPL_NOTIFY, TPL_CALLBACK, and TPL_HIGH_LEVEL as examples, the highest running priority is TPL_HIGH_LEVEL, and the lowest running priority is TPL_APPLICATION.
[0081] In the above embodiments, on the one hand, when performing an upgrade operation, updating the running priority in the first register to the highest running priority ensures that the exit program has the highest running priority, thus allowing the exit program to run first and effectively interrupting or preventing the execution of the interrupted program. On the other hand, when performing a downgrade operation, updating the running priority in the first register to the lowest running priority ensures the effectiveness of the running priority adjustment and improves the reliability of the scheme.
[0082] In some embodiments, the method of this application further includes: If the running priority in the first register is higher than the running priority of the exit program, then the running priority in the first register will not be modified.
[0083] Specifically, if the execution priority in the first register is higher than the execution priority of the exit program, the execution of the interrupt program can be interrupted or prevented. Therefore, it is not necessary to modify the execution priority in the first register. This reduces the amount of data modification and improves the performance of the computing device.
[0084] In some embodiments, the method of this application further includes: Before modifying the running priority in the first register, obtain the running priority in the first register as the original running priority; Save the original running priority to the second register; After the program exits and finishes running, the running priority in the first register is restored based on the original running priority in the second register.
[0085] Specifically, the initial execution priority is the execution priority of the previous program. The previous program refers to the program that ran before the exit program. The previous program can be an interrupt routine or a program other than an interrupt routine. After the execution priority of the exit program is raised to the highest execution priority, the execution of the previous program will be interrupted, and after the execution of the exit program ends, the execution of the previous program will continue. When the previous program continues to run, based on the initial execution priority in the second register, the execution priority in the first register can be updated to the execution priority of the previous program. This allows the central processing unit to continue running the previous program based on the execution priority in the first register.
[0086] In the above embodiments, before performing the promotion, demotion, and restoration operations, the original running priority in the first register is saved to the second register. This backs up the original running priority and prevents data loss. After the program exits, the running priority in the first register is restored based on the original running priority in the second register, thus avoiding the problem of incorrect running priority in the previous program.
[0087] In some embodiments, restoring the running priority in the first register includes: Perform the following operations in sequence: change the running priority in the first register to the lowest running priority, and change the running priority in the first register back to the original running priority.
[0088] Specifically, by modifying the running priority in the first register to the lowest running priority, and then modifying it back to the original running priority, the running priority can be modified in order from low to high, thus ensuring the effectiveness of the running priority modification.
[0089] In some embodiments, the boot firmware includes a pre-configured priority adjustment function and a priority recovery function. Modifying the running priority in the first register as described above includes: The priority adjustment function of the boot firmware is called to modify the running priority in the first register.
[0090] And, the aforementioned restoration of the running priority in the first register includes: The priority recovery function in the boot firmware is called to restore the running priority in the first register.
[0091] Specifically, during the execution of the priority adjustment function, the following operations can be performed sequentially: modify the running priority in the first register to the highest running priority, modify the running priority in the first register to the lowest running priority, and modify the running priority in the first register to the running priority before the program exits and the promotion operation.
[0092] During the execution of the priority recovery function, the following operations can be performed sequentially: modify the running priority in the first register to the lowest running priority, and modify the running priority in the first register back to the original running priority.
[0093] In the above embodiments, by setting priority adjustment and priority restoration functions in the boot firmware, the boot firmware's running priority can be adjusted and restored through function calls. This simplifies the code implementation for running priority adjustment and restoration.
[0094] In some embodiments, the method of this application further includes: During the running of the boot image, scheduling instructions are generated. These instructions are used to trigger the main control program of the boot firmware. During the running of the main control program, promotion, downgrade, and recovery operations are triggered, as well as the exit program is triggered.
[0095] Specifically, based on scheduling instructions, the main control program can first call the aforementioned priority adjustment function to adjust the running priority of the exit program in the first register, then control the exit program to run, and after the exit program has finished running, call the aforementioned priority recovery function to restore the running priority in the first register.
[0096] In the above embodiments, the main control program of the boot firmware generates scheduling instructions, which are then executed sequentially to adjust the running priority, control the exit of the program, and restore the running priority. Essentially, in the software program of the boot image, only the generation of scheduling instructions is required; the subsequent control logic is implemented by the main control program of the boot firmware. This simplifies the control logic of the boot image, reduces the size of the boot image package, and consequently, shortens the boot image acquisition time in step S201, thereby improving the startup efficiency of the computing device.
[0097] In some embodiments, the method of this application further includes: If the upgrade, downgrade, or recovery operation fails, or if the exit procedure fails to run successfully, a message indicating that the first network driver has failed to exit will be generated.
[0098] Specifically, if the first network driver still has not exited after the first preset time of calling the priority adjustment function, or after the second preset time of calling the priority recovery function, or after the third preset time of running the exit program, a prompt message indicating that the first network driver has failed to exit can be generated to prompt the technicians.
[0099] Specifically, the central processing unit can send the prompt information to the baseboard management controller of the computing device, and display the prompt information through the human-machine interface of the baseboard management controller.
[0100] See also Figure 3 This is a schematic diagram of a computing device startup device provided in some embodiments of this application. Figure 3 In this context, the computing device startup mechanism includes: Firmware execution module 301 is used to respond to receiving a device boot command, run the first network driver of the boot firmware, and obtain the boot image through the network card of the computing device; The image execution module 302 is used to run the second network driver for booting the image and trigger the exit program of the first network driver. The second network driver includes an interrupt routine, which is used to acquire data received by the network card. The priority adjustment module 303 is used to adjust the running priority of the exit program if the interrupt program and the exit program have the same running priority, so that the exit program runs before the interrupt program. The device startup module 304 is used to run an exit program to cause the first network driver to exit, and to interact with the network server based on the interrupt program of the second network driver to start the computing device.
[0101] In some embodiments, the priority adjustment module 303 is used for: The exit program's running priority is sequentially boosted, downgraded, and restored. The boosting operation adjusts the exit program's running priority to the first running priority, the downgrade operation adjusts the exit program's running priority to the second running priority, and the restore operation restores the exit program's running priority. The first running priority is higher than the exit program's running priority before the boosting operation, and the second running priority is lower than the exit program's running priority before the boosting operation.
[0102] In some embodiments, the priority adjustment module 303 is used for: After performing the promotion, demotion, and recovery operations, check the running status of the interrupt routine; If the interrupt routine is not executed, then the exit routine will be executed. If the interrupt routine is running, then pause and exit the routine.
[0103] In some embodiments, the priority adjustment module 303 is used for: Locate the first register used to store the execution priority; When performing promotion, downgrade, and recovery operations, the running priority is modified in the first register; The program will exit based on the execution priority in the first register.
[0104] In some embodiments, the priority adjustment module 303 is used for: If the running priority in the first register is lower than or equal to the running priority of the exit program, then the following operations are performed in sequence: modify the running priority in the first register to the highest running priority, modify the running priority in the first register to the lowest running priority, and modify the running priority in the first register to the running priority of the exit program before the promotion operation.
[0105] In some embodiments, the priority adjustment module 303 is used for: If the running priority in the first register is higher than the running priority of the exit program, then the running priority in the first register will not be modified.
[0106] In some embodiments, the priority adjustment module 303 is used for: The priority adjustment function of the boot firmware is called to modify the running priority in the first register.
[0107] In some embodiments, the priority adjustment module 303 is used for: Before modifying the running priority in the first register, obtain the running priority in the first register as the original running priority; Save the original running priority to the second register; After the program exits and finishes running, the running priority in the first register is restored based on the original running priority in the second register.
[0108] In some embodiments, the priority adjustment module 303 is used for: Perform the following operations in sequence: change the running priority in the first register to the lowest running priority, and change the running priority in the first register back to the original running priority.
[0109] In some embodiments, the priority adjustment module 303 is used for: The priority recovery function in the boot firmware is called to restore the running priority in the first register.
[0110] In some embodiments, the priority adjustment module 303 is used for: During the running of the boot image, scheduling instructions are generated. These instructions are used to trigger the main control program of the boot firmware. During the running of the main control program, promotion, downgrade, and recovery operations are triggered, as well as the exit program is triggered.
[0111] In some embodiments, the priority adjustment module 303 is used for: If the upgrade, downgrade, or recovery operation fails, or if the exit procedure fails to run successfully, a message indicating that the first network driver has failed to exit will be generated.
[0112] In some embodiments, the firmware execution module 301 is used for: During the execution of the first network driver, the network card is configured and a first communication connection is established between the network card and the network server. Based on the first communication connection, the boot image is obtained from the network server.
[0113] In some embodiments, the device startup module 304 is used for: Construct the first message and send it to the network server via the network card; If a response message is received from the network server through the network card, a driver cleanup operation is performed on the first network driver to cause the first network driver to exit operation and disconnect the first communication connection.
[0114] In some embodiments, the driver cleanup operation includes one or more of the following operations: Release the memory allocated for the first network driver; Disable the first network driver's listening to the network card; Close the timer created by the first network driver; Release the UDP port occupied by the first network driver.
[0115] In some embodiments, the device startup module 304 is used for: During the execution of the second network driver, the network card is configured a second time, and a second communication connection is established between the network card and the network server. During the execution of the boot firmware, communication with the network server is established via a second communication connection to boot the computing device.
[0116] See also Figure 4 Embodiments of this application also provide an electronic device, including a memory 10 and a processor 20, wherein the memory 10 stores a computer program and the processor 20 is configured to run the computer program to perform the steps in any of the above-described communication method embodiments.
[0117] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described communication method embodiments when it is run.
[0118] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0119] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described communication method embodiments.
[0120] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described communication method embodiments.
[0121] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] The foregoing has provided a detailed description of a computing device startup method, a computing device startup method, and a storage system provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for starting a computing device, characterized in that, include: In response to receiving a device boot command, the first network driver of the boot firmware is run, and the boot image is obtained through the network card of the computing device; The second network driver of the boot image is run, and the exit procedure of the first network driver is triggered. The second network driver includes an interrupt routine, which is used to acquire the data received by the network card. If the interrupt routine and the exit routine have the same running priority, then the running priority of the exit routine is adjusted so that the exit routine runs before the interrupt routine; The exit procedure is run to cause the first network driver to exit operation, and the interrupt procedure based on the second network driver interacts with the network server to start the computing device.
2. The method according to claim 1, characterized in that, The adjustment of the execution priority of the exit program includes: The running priority of the exited program is sequentially boosted, downgraded, and restored. The boosting operation is used to adjust the running priority of the exited program to a first running priority, the downgrading operation is used to adjust the running priority of the exited program to a second running priority, and the restoration operation is used to restore the running priority of the exited program. The first running priority is higher than the running priority of the exited program before the boosting operation, and the second running priority is lower than the running priority of the exited program before the boosting operation.
3. The method according to claim 2, characterized in that, The method further includes: After performing the boosting operation, the downsizing operation, and the recovery operation, the running status of the interrupt program is detected; If the interrupt procedure is not executed, then the exit procedure is executed; If the interrupt procedure is running, then the exit procedure is paused.
4. The method according to claim 2, characterized in that, The method further includes: Locate the first register used to store the execution priority; When performing the promotion operation, the downgrade operation, and the recovery operation, the running priority is modified in the first register; The exit procedure is executed according to the running priority in the first register.
5. The method according to claim 4, characterized in that, Modifying the running priority in the first register includes: If the running priority in the first register is lower than or equal to the running priority of the exit program, then the following operations are performed in sequence: modify the running priority in the first register to the highest running priority, modify the running priority in the first register to the lowest running priority, and modify the running priority in the first register to the running priority of the exit program before the promotion operation.
6. The method according to claim 5, characterized in that, The method further includes: If the running priority in the first register is higher than the running priority of the exit program, then the running priority in the first register is not modified.
7. The method according to claim 4, characterized in that, Modifying the running priority in the first register includes: The priority adjustment function of the boot firmware is called to modify the running priority in the first register.
8. The method according to claim 4, characterized in that, The method further includes: Before modifying the running priority in the first register, obtain the running priority in the first register as the original running priority; Save the original running priority to the second register; After the exit program finishes running, the running priority in the first register is restored according to the original running priority in the second register.
9. The method according to claim 8, characterized in that, The process of restoring the running priority in the first register includes: Perform the following operations in sequence: modify the running priority in the first register to the lowest running priority, and modify the running priority in the first register back to the original running priority.
10. The method according to claim 9, characterized in that, The process of restoring the running priority in the first register includes: The priority recovery function in the boot firmware is called to restore the running priority in the first register.
11. The method according to claim 2, characterized in that, The method further includes: During the running of the boot image, a scheduling instruction is generated. The scheduling instruction is used to trigger the main control program of the boot firmware. During the running of the main control program, the promotion operation, the downgrade operation, and the recovery operation are triggered, as well as the exit program is triggered.
12. The method according to claim 2, characterized in that, The method further includes: If the boosting operation, the downsizing operation, and the recovery operation fail, or if the exit procedure fails to run, a prompt message indicating that the first network driver has failed to exit is generated.
13. The method according to claim 1, characterized in that, The first network driver that runs the boot firmware and obtains the boot image through the network card of the computing device includes: During the execution of the first network driver, the network card is configured and a first communication connection is established between the network card and the network server. Based on the first communication connection, the boot image is obtained from the network server.
14. The method according to claim 13, characterized in that, Running the exit procedure to cause the first network driver to exit operation includes: A first message is constructed and sent to the network server via the network interface card; If a response message is received from the network server through the network card, a driver cleanup operation is performed on the first network driver to cause the first network driver to exit operation and disconnect the first communication connection.
15. The method according to claim 14, characterized in that, The driver cleanup operation includes one or more of the following operations: Release the memory allocated for the first network driver; Disable the first network driver's listening to the network card; Turn off the timer created by the first network driver; Release the UDP port occupied by the first network driver.
16. The method according to claim 14, characterized in that, The method further includes: During the operation of the second network driver, the network card is configured in a second way, and a second communication connection is established between the network card and the network server. During the execution of the boot firmware, communication is established with the network server via the second communication connection to boot the computing device.
17. A computer device startup device, characterized in that, include: The firmware execution module is used to respond to the received device boot command, run the first network driver of the boot firmware, and obtain the boot image through the network card of the computing device; The image execution module is used to run the second network driver of the boot image and trigger the exit program of the first network driver. The second network driver includes an interrupt routine, which is used to acquire the data received by the network card. The priority adjustment module is used to adjust the running priority of the exit program if the interrupt program and the exit program have the same running priority, so that the exit program runs before the interrupt program. The device startup module is used to run the exit program to cause the first network driver to exit, and to interact with the network server based on the interrupt program of the second network driver to start the computing device.
18. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the computing device startup method as described in any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the computing device startup method as described in any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the computing device startup method as described in any one of claims 1 to 16.