Baseboard management controller startup method, computer equipment, medium and product
By reading the register value after BMC startup and detecting exceptions, storing the reset cause and abnormal process, the problem of difficulty in switching partitions after BMC restart is solved, and the intelligent partition switching of the BMC system and the system reliability improvement are achieved.
Patent Information
- Application Number
- CN202510705561.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-05-29
AI Technical Summary
After the baseboard management controller (BMC) is restarted, it is difficult to determine whether the partition needs to be switched based on the actual situation, which makes it difficult for the system to realize intelligent switching of the redundant backup system.
By reading the value of the first register, determining the target running partition and environment variables, detecting whether there is an exception in the BMC running stage, and storing the reset cause and exception process in the register, restarting the BMC to achieve partition switching.
It realizes intelligent partition switching in the case of BMC abnormalities, ensures the reliability and availability of the system, avoids long-term downtime caused by exceptions, and improves the system's fault tolerance.
Smart Images

Figure CN120255970B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server management technology, and in particular to a baseboard management controller startup method, computer equipment, medium, and product. Background Art
[0002] The Baseboard Management Controller (BMC) is integrated into the server motherboard. As a dedicated microcontroller independent of the main system, it implements hardware monitoring, remote power management, and out-of-band operations and maintenance. Typically, to improve the reliability and maintainability of the BMC system, two BMC partitions are designed: a primary partition and a backup partition. This ensures rapid system recovery in the event of a firmware update failure or corruption of the primary partition. However, if kernel or application layer anomalies occur during BMC operation, it can be difficult to identify the specific cause of the reboot after the BMC is reset, making it difficult to determine whether partitioning is necessary. Summary of the Invention
[0003] The present application provides a baseboard management controller startup method, computer equipment, medium and product, to at least solve the problem in the related art that it is difficult to switch partitions according to actual conditions after the baseboard management controller is started.
[0004] This application provides a baseboard management controller startup method, comprising:
[0005] After the baseboard management controller is started, a value of a first register is read, and a target running partition and an environment variable are determined based on a specific field of the first register, wherein the environment variable is used to represent the running partition when the baseboard management controller is started, and the specific field of the first register is used to represent at least an operating state of the baseboard management controller, wherein the operating state includes at least a reset reason and an abnormal running process;
[0006] Check whether there are any abnormalities in the baseboard management controller during operation;
[0007] If an exception occurs, the reset reason and the running process where the exception occurs are stored in a specific field of the first register, and the baseboard management controller is restarted.
[0008] The present application also provides a computer device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned baseboard management controller startup methods when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned baseboard management controller startup methods are implemented.
[0010] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned baseboard management controller startup methods when executed by a processor.
[0011] An embodiment of the present invention provides a baseboard management controller startup method, comprising: reading the value of a first register after the baseboard management controller is started, and determining a target operating partition and environment variables based on a specific field of the first register; detecting whether an abnormality occurs during the operation phase of the baseboard management controller; and if an abnormality occurs, storing a reset reason in a specific field of the first register, and restarting the baseboard management controller. The present invention detects whether an abnormality occurs during the operation phase after the baseboard management controller is started, and if an abnormality occurs, stores the reset reason and the operating process in which the abnormality occurred in the first register, and restarts the baseboard management controller. The first register is a register that does not lose data during restart. After startup, the value in the first register is read, combined with the reset reason, to determine whether to partition, thereby achieving intelligent switching of the redundant backup system. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 A flowchart of a baseboard management controller startup method provided in an embodiment of the present application;
[0014] Figure 2 A schematic diagram of the partition switching process provided in an embodiment of the present application;
[0015] Figure 3 A schematic diagram of the baseboard management controller operation phase provided in an embodiment of the present application;
[0016] Figure 4 A schematic diagram of the structure of a baseboard management controller startup device provided in an embodiment of the present application;
[0017] Figure 5 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0019] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0020] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0021] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the baseboard management controller startup method depends, the specific application environment architecture or the specific hardware architecture is described herein.
[0022] A baseboard management controller (BMC) is an independent microcontroller embedded in server or high-end computer hardware. It monitors and manages the physical state of the device. Integrated on the motherboard, it provides remote management capabilities through a separate out-of-band management interface, including power control, temperature monitoring, fan speed control, logging, and fault diagnosis. The BMC maintains operation even when the host operating system crashes, ensuring administrators can access and maintain the device over the network. It is a critical component for efficient operations and maintenance in data centers and cloud computing environments. In BMC systems, designing a flash memory chip with two independent partitions (primary and backup) is a typical redundant architecture designed to enhance system reliability and fault tolerance. The primary partition runs the current BMC firmware, while the backup partition stores a verified stable version or a copy of the last successfully updated firmware. If the primary partition fails due to firmware upgrade errors, data corruption, or hardware failure, the BMC's boot loader automatically detects the error and switches to the backup partition for boot, ensuring continuous system availability. However, if a kernel crash or hang occurs during BMC operation, or if a critical BMC application-layer process fails during operation, the BMC will reboot. After the reboot, the specific cause of the reboot cannot be determined, making it difficult to determine whether a partition switch is necessary. Based on this, the present invention provides a baseboard management controller startup method.
[0023] An embodiment of the present application provides a baseboard management controller startup method, and the method is described in detail in conjunction with the execution flow of the baseboard management controller startup method.
[0024] The embodiment of the present invention provides a baseboard management controller startup method, such as Figure 1 The flowchart of the baseboard management controller startup method shown in FIG. 1 includes the following steps:
[0025] Step S101 : After the baseboard management controller is started, the value of the first register is read, and a target operating partition and an environment variable are determined based on a specific field of the first register.
[0026] The environment variable is used to represent the running partition when the baseboard management controller is started, and the specific field of the first register is used to represent at least the running state of the baseboard management controller, which at least includes the reset reason and the abnormal running process.
[0027] A register is a storage unit in computer hardware used to temporarily store data. In this embodiment, the first register is a register that does not lose data upon restart. It is a specific register whose value is not lost after the baseboard management controller is restarted and reset. Different bits (BIT) in the first register represent different meanings, that is, specific fields represent the operating status of the baseboard management controller.
[0028] Taking a 32-bit register as an example, [0] (bit 1) is a reserved bit with a default value of 0; [2:1] (bits 2-3) use two bits to mark the reset reason, with a default value of 00, 00 indicating normal, 01 indicating kernel abnormality, and 10 indicating BMC abnormality (baseboard management controller abnormality); [7:3] (bits 4-8) use five bits to represent the running process in the running phase, with a default value of 00000, and 00000 indicating a running process with no abnormality. The running process includes kernel decompression and initialization, device driver loading, root file system mounting, user space initialization, and BMC process monitoring service startup. Different running processes correspond to different bits in the five bits. For example, if it is 00001, it means that there is an abnormality in kernel decompression and initialization; [8] (bit 9) uses a bit to mark the image refresh status, 1 indicates that the image is being refreshed, and 0 indicates that the image refresh is completed or not refreshed; [31:9] (bits 10-32) are reserved bits.
[0029] After the baseboard management controller is started, the value stored in the first register is read. Different fields in the first register represent different meanings. By reading the value of a specific field in the first register, the baseboard management controller determines whether the current startup is a reboot. If it is a reboot, the reset reason before the reboot and the running process that experienced the abnormality are determined. This allows the system to determine whether a partition switch is required based on the previous abnormality, including switching to another partition or maintaining the current partition. If switching to another partition, the other partition becomes the target running partition; if maintaining the current partition, the current running partition becomes the target running partition.
[0030] The value of the environment variable is 0 or 1, corresponding to different partitions. After the baseboard management controller is started, the value of the environment variable is first read to start from the corresponding partition. For example, if the value of the environment variable is 0, it starts from partition 0.
[0031] After reading the value of the first register, if it is determined that the partition needs to be switched, the value of the environment variable is modified to achieve the partition switch. If it is not necessary to switch the partition, the original value of the environment variable remains unchanged.
[0032] Specifically, after the baseboard management controller is started, the boot loader (e.g., u-boot) reads the value of the first register. Based on the value of the first register, it determines whether to switch partitions and sets the corresponding environment variables. The boot loader stage primarily initializes the hardware and boots the operating system, including hardware initialization and environment variable setting. During the boot loader stage, the hardware watchdog function is enabled for subsequent process detection.
[0033] Step S102 , detecting whether there is any abnormality in the baseboard management controller during operation.
[0034] The operation phase involves the kernel and BMC user-level phases. Specifically, the kernel phase includes processes such as kernel decompression and initialization, device driver loading, root file system mounting, and user space initialization. The BMC user-level phase includes the BMC process monitoring service auto-start process. Each process is monitored in the kernel and BMC user-level phases, and a watchdog mechanism can be activated during monitoring. The baseboard management controller has a hardware watchdog timer, implemented by a dedicated WDT (Watchdog Timer) hardware module.
[0035] As an example, a timeout threshold can be set. After the baseboard management controller is started, the process in the user layer stage periodically writes a specific value to the WDT register to reset the watchdog counter and feed the dog. If the process fails to feed the dog in time due to a fault, the watchdog counter will continue to accumulate until the preset timeout threshold is reached, which will trigger the hardware reset signal socreset and restart.
[0036] In the kernel stage, you can register a notification function through the callback function registration mechanism. If an abnormal process occurs, the abnormal event will be captured.
[0037] Step S103: If an exception occurs, the reset reason and the running process where the exception occurs are stored in a specific field of the first register, and the baseboard management controller is restarted.
[0038] When an abnormal process is detected during the running stage, the abnormal running process and the corresponding reset reason are written into a specific field of the first register. The reset reason includes the stage of the abnormal running process, including kernel stage abnormality and user layer stage abnormality; the running process includes kernel decompression and initialization, device driver loading, root file system mounting, user space initialization and other processes in the kernel stage, as well as the BMC process monitoring service startup process in the user layer stage.
[0039] As an example, the reset reason is marked as 01, indicating that the kernel stage is abnormal, and the running process is marked as 00001, indicating that the kernel decompression and initialization process is abnormal.
[0040] An embodiment of the present invention provides a baseboard management controller startup method, comprising: reading the value of a first register after the baseboard management controller is started, and determining a target operating partition and environment variables based on a specific field of the first register; detecting whether an abnormality occurs during the operation phase of the baseboard management controller; and if an abnormality occurs, storing a reset reason in a specific field of the first register, and restarting the baseboard management controller. The present invention detects whether an abnormality occurs during the operation phase after the baseboard management controller is started, and if an abnormality occurs, stores the reset reason and the operating process in which the abnormality occurred in the first register, and restarts the baseboard management controller. The first register is a register that does not lose data during restart. After startup, the value in the first register is read, combined with the reset reason, to determine whether to partition, thereby achieving intelligent switching of the redundant backup system.
[0041] In some optional implementations, before reading the value of the first register in step S101, the following steps are further included:
[0042] Step S201, read environment variables;
[0043] Step S202: determining the current running partition based on the environment variables.
[0044] Environment variables are used to indicate the active partition when the baseboard management controller boots. Different environment variables correspond to different active partitions. As an example, the environment variable takes values of 0 and 1. After the baseboard management controller boots, it first reads the environment variable and uses it to determine the current active partition. If the environment variable is 1, the baseboard management controller boots from partition 1, which becomes the current active partition.
[0045] In some optional implementations, after restarting the baseboard management controller, the method further includes:
[0046] The first register is reset, and the specific field of the reset first register indicates that there is no abnormality in the baseboard management controller.
[0047] The first register is reset to clear the previously stored abnormal information, so that the values of the specific fields in the first register are default values, indicating that there is no abnormality in the baseboard management controller.
[0048] In some optional implementations, the first specific field of the first register represents the abnormal running process, and determining the target running partition and the environment variable based on the specific field of the first register in step S101 includes:
[0049] Step S301: If the first specific field indicates that an abnormal running process exists, the environment variable is modified from a first value to a second value, and the current running partition is switched to a target running partition, wherein the first value corresponds to the current running partition and the second value corresponds to the target running partition.
[0050] Taking a 32-bit register as an example, [7:3] (bits 4-8) of the first register use five bits to represent the running process in the run phase. The first specific field corresponds to bits 4-8, indicating the running process that has experienced an exception, and the default value is 00000. When the value of the first specific field is 00000, it indicates that there is no running process with an exception. The running processes in the run phase include kernel decompression and initialization, device driver loading, root file system mounting, user space initialization, and BMC process monitoring service startup in the order of occurrence. Different running processes correspond to different bits in the five bits. For example, if the value is 00001, it indicates that there is an exception in kernel decompression and initialization.
[0051] First, the first specific field in the first register is read. If the value of the first specific field is not the default value (i.e., 00000), it indicates that an abnormal running process has occurred and a partition switch is required. The environment variable corresponding to the current running partition is the first value. By changing the environment variable from the first value to the second value, the current running partition is switched to the target running partition corresponding to the second value.
[0052] Furthermore, determining the target execution partition and the environment variable based on the specific field of the first register in step S101 further includes:
[0053] Step S302: If the first specific field of the first register indicates that there is no abnormal running process, then read the second specific field and the third specific field of the first register, wherein the second specific field indicates the reset reason and the third specific field indicates the image refresh status;
[0054] Step S303: Determine the target execution partition and environment variables based on the read result.
[0055] If the first specific field of the first register is the default value, indicating that there was no abnormal running process in the last startup before the startup, that is, the restart of the baseboard management controller was not caused by the existence of an abnormal running process, then the second specific field and the third specific field of the first register are further read.
[0056] Taking a 32-bit register as an example, [2:1] (bits 2-3) of the first register use two bits to mark the reset cause. The second specific field corresponds to the bit 2-3. The default value of the second specific field is 00. 00 indicates normal, 01 indicates kernel abnormality, and 10 indicates BMC abnormality (baseboard management controller abnormality).
[0057] [8] (bit 9) of the first register uses a BIT bit to mark the image refresh status. The third specific field corresponds to the BIT bit of bit 1. The default value of the third specific field is 0. 0 indicates that the image refresh is completed or not refreshed, and 1 indicates that the image is being refreshed or the image refresh is abnormal.
[0058] Based on the reading results of the second specific field and the third specific field, it is determined whether the current running partition needs to be switched and the environment variables need to be modified.
[0059] Furthermore, the above step S303 includes:
[0060] Step S3031: If the second specific field indicates that there is a reset reason, then read the third specific field of the first register, where the third specific field indicates the image refresh status.
[0061] If the value of the second specific field is not 0, including 01 or 10, it indicates that there is a reset reason, specifically including kernel abnormality and BMC abnormality, and the third specific field is read.
[0062] If the value of the second specific field is 0, it indicates that there is no reset reason, that is, there is no abnormal reset situation during the last startup operation, so there is no need to switch partitions during this startup.
[0063] Step S3032: If the third specific field indicates that the image refresh is abnormal, the current running partition is determined as the target running partition.
[0064] If the value of the third specific field is not 0, it indicates that there was an image refresh exception during the previous startup process. Therefore, there is no need to switch partitions or modify environment variables during this startup process, and the current running partition is used as the target running partition.
[0065] Furthermore, after reading the third specific field of the first register in step S3031, the method: if the third specific field indicates that there is no abnormality in the controller during image refresh, the environment variable is modified from the first value to the second value, and the current running partition is switched to the target running partition.
[0066] If the value of the third specific field is 0, it indicates that there were no abnormalities during the image refresh during the previous boot, and a partition switch is required. The environment variable is modified, changing the current first value to the second value, thereby switching the current running partition corresponding to the first value to the target running partition corresponding to the second value. The next boot reads the modified environment variable and boots from the target running partition.
[0067] In this embodiment, the partition switching logic is fully described. Figure 2 The following is a schematic diagram of the partition switching process. After the baseboard management controller boots up, it reads the value of the first register. First, it reads the first specific field to determine whether the register value during the run phase is non-zero. If so, the environment variable is modified from the first value to the second value. If not, it further determines whether a reset reason has occurred. If the value corresponding to the reset reason is 0, the system is normal and no partition switch is required. If the value corresponding to the reset reason is non-zero, indicating an abnormal reset, it further determines whether an image refresh error has occurred. If the value is 1, it indicates an image refresh error, meaning an error occurred during the previous boot and operation, possibly indicating corruption in the other partition image. Therefore, the partition switch is not performed and the current partition is retained. If the image refresh is normal, the partition switch is performed. Optionally, a rollback mechanism can be implemented. If a dual-image backup is used, the damaged target partition is marked as "invalid," and the previous complete image is re-pulled from a remote server or local backup storage, overwritten with the damaged partition. The image integrity is verified (e.g., by hashing). If the integrity is verified, the image refresh flag is cleared. This method allows for rapid recovery in the event of an image refresh failure, minimizing the risk of service interruption.
[0068] In some optional implementations, the running phase includes a kernel phase, and step S102 includes:
[0069] Step S401 : detecting whether there is any abnormal process in the kernel phase of the baseboard management controller.
[0070] When running in the kernel phase, monitor the running status of the kernel phase process. Specifically, you can use the notification function to capture the panic exception event in the callback. If an exception event is captured, it indicates that the corresponding process has an exception.
[0071] Step S402: If there is an abnormal process, it is determined that there is an abnormality in the kernel stage of the baseboard management controller.
[0072] If there is an abnormal process in this stage, it is determined that there is an abnormality in the kernel stage and the reset cause is the kernel abnormality.
[0073] Furthermore, if it is determined that there is an abnormality in the kernel stage of the baseboard management controller, the reset reason and the running process where the abnormality occurs are stored in the specific field of the first register in step S103, including: modifying the first specific field and the second specific field of the first register, the modified first specific field indicates that there is an abnormality in the process at the kernel stage, and the modified second specific field indicates that the reset reason of the baseboard management controller is the kernel abnormality.
[0074] If an abnormal process is detected during the kernel phase, the value of the first register is modified accordingly. Specifically, using a 32-bit register as an example, bits [7:3] (bits 4-8) of the first register use five bits to represent the running processes during the runtime phase. The first special field corresponds to bits 4-8 and identifies the abnormal running process. The default value is 00000. When the value of the first special field is 00000, it indicates that there is no abnormal running process. The running processes during the kernel phase include, in order of occurrence, kernel decompression and initialization, device driver loading, root file system mounting, and user space initialization. For example, if the value is 00001, it indicates an abnormal kernel decompression and initialization. Bits [2:1] (bits 2-3) of the first register use two bits to indicate the reset cause. The second special field corresponds to bits 2-3. The default value of the second special field is 00. 00 indicates normal operation, 01 indicates a kernel abnormality, and 10 indicates a BMC abnormality.
[0075] In some optional implementations, the operation phase includes a user layer phase, and step S102 includes:
[0076] Step S403: Detect whether there is any abnormal process in the user layer stage.
[0077] The user layer stage is the environment in which applications run. In the baseboard management controller, the user layer stage refers to the stage in which various applications running on the baseboard management controller are executing. Detect whether there are any abnormalities in the processes in the user layer stage. Specifically, the CPU usage, memory usage, disk I / O, etc. of the process can be monitored. If a process occupies too many resources for a long time, it may indicate that the process has an abnormality, such as a memory leak or an infinite loop. Detect anomalies by analyzing the behavior patterns of the process. For example, a normal management process should perform tasks according to the predetermined logic and frequency. If the behavior pattern of a process does not match expectations, it may indicate that the process has an abnormality. Check the log files and error reports of the process. Abnormal processes usually leave error messages or warnings in the logs.
[0078] Specifically, step S403 includes: detecting whether the process in the user layer phase has timed out based on a preset counter; if so, determining that an abnormal process exists.
[0079] Step S404: If there is an abnormal process in the user layer stage, it is determined that there is an abnormality in the baseboard management controller in the user layer stage.
[0080] The preset counter is the WDT counter, and a timeout threshold is set. When the baseboard management controller enters the user layer, the user layer daemon periodically writes a specific value to the WDT register to reset the timer and feed the watchdog. If a process anomaly fails to feed the watchdog in time, a timeout occurs. The preset counter value continues to accumulate until the preset time threshold is reached. After the timeout, a hardware reset signal is triggered, and the restart operation is performed.
[0081] If an abnormal process is detected in the user layer stage, the criterion determines that an abnormality exists in the user layer stage, that is, the reset cause is an abnormality of the baseboard management controller.
[0082] Further, if it is determined that the baseboard management controller has an abnormality in the user layer stage, the reset reason and the running process where the abnormality occurs are stored in the specific field of the first register in step S103, including: modifying the first specific field and the second specific field of the first register, the modified first specific field indicates that there is an abnormality in the process in the user layer stage, and the modified second specific field indicates that the reset reason of the baseboard management controller is the baseboard management controller abnormality.
[0083] If an abnormal process is detected in the user layer, the value of the first register is modified accordingly. Specifically, using a 32-bit register as an example, bits [7:3] (bits 4-8) of the first register use five bits to represent the running process in the run layer. The first special field corresponds to bits 4-8 and identifies the running process with an abnormality. The default value is 00000. When the value of the first special field is 00000, it indicates that there are no abnormal running processes. The running processes in the user layer include the startup of the BMC process monitoring service. If an abnormality exists, the corresponding value is 10000. Bits [2:1] (bits 2-3) of the first register use two bits to mark the reset cause. The second special field corresponds to bits 2-3. The default value of the second special field is 00. 00 indicates normal operation, 01 indicates a kernel abnormality, and 10 indicates a BMC abnormality (baseboard management controller abnormality).
[0084] An embodiment of the present invention provides a method for starting a baseboard management controller. Figure 3 This is a diagram of the baseboard management controller operation phase. Described in chronological order, after the baseboard management controller is started, the operation phase includes:
[0085] From the time the system boots up, completes its initialization tasks, and prepares to load the kernel (the Boot phase), it first reads the value of the environment variable and determines the current running partition based on the value of the environment variable. For example, if the current value of the environment variable is 0, the system boots from partition 0. It then reads the value of the first register and, based on the result, determines whether a partition switch is necessary. If so, the corresponding environment variable is set. The specific partition switching logic includes: first, reading the first specific field to determine whether the register value during the run phase is non-zero. If so, the environment variable is modified from the first value to the second value. If not, it further determines whether a reset reason exists. If the value corresponding to the reset reason is 0, the system is normal and no partition switch is required. If the value corresponding to the reset reason is non-zero, indicating an abnormal reset, it further determines whether an image refresh error occurred. If the value is 1, it indicates an image refresh error, meaning that an error occurred during the previous boot operation, possibly indicating corruption in the image of the other partition. Therefore, the partition switch is not performed and the current partition is used. If the image refresh is normal, the partition switch is performed.
[0086] In the kernel phase, including kernel decompression and initialization, device driver loading, root file system mounting, and user space initialization phases, a panic notification function is registered through the notifier mechanism (a function or mechanism triggered in a program or operating system kernel when an unrecoverable error or exception occurs. This function performs a series of operations, such as recording error information, attempting to clean up resources, notifying users or administrators, and ultimately causing the program or system to stop running). The Panic event is captured in the callback to detect whether there is an abnormal process. If so, the reset reason and abnormal process in the first register are modified to restart the baseboard management controller. After the restart, the running partition is modified accordingly by reading the value of the first register. In the callback function, the value of the register is set.
[0087] In the BMC user layer, the BMC process monitoring service is configured to automatically start and periodically write a specific value to the WDT count restart register, restarting the WDT counter to detect critical processes. If an abnormal process is detected, the reset cause is stored as a BMC abnormality in the first register and the baseboard management controller is restarted. After the restart, the running partition is modified accordingly by reading the value of the first register.
[0088] The method provided in an embodiment of the present invention achieves fault detection and automatic recovery through coordinated monitoring between a hardware watchdog timer (WDT) and an application-layer daemon, preventing prolonged system downtime due to kernel / BMC anomalies. When a watchdog timeout triggers a hardware reset (socreset), the system can be forced to restart and resume operation based on a preset policy, ensuring service continuity. By accurately recording the BIT bit flag in the BMC restart-unlost register (the first register), the reset cause (e.g., kernel anomaly, BMC anomaly) and the stage of the fault occurrence are accurately recorded, providing critical data for subsequent fault diagnosis. The boot partition is automatically selected based on the reset cause and environment variables, enabling intelligent switching between redundant backup systems and improving system availability. The hardware watchdog is deeply integrated with the BootLoader, enabling monitoring at the initial system startup, covering the entire system lifecycle. Dynamic control of the boot partition through environment variables, combined with a dual-partition redundancy design, reduces the impact of single-point failures on the system.
[0089] This method allocates bits in the first register to store relevant information, including reset reasons and running processes. Because the first register persists across BMC restarts, it enables persistent storage of hardware-level fault information. By starting the watchdog timer and setting the appropriate timeout threshold upon BMC startup, the monitoring scope extends to the initial system startup phase. This breaks the limitation of traditional monitoring that only operates at the application layer. The collaborative mechanism between the application-layer daemon and the hardware WDT ensures real-time status feedback during normal system operation.
[0090] Through the dynamic partition switching mechanism of environment variables, dynamic control of dual partition startup is achieved by setting environment variables. Combined with the BMC reset cause judgment logic, automatic isolation of faulty partitions and seamless switching of backup partitions are achieved.
[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0092] The embodiment of the present application also provides a baseboard management controller starting device, such as Figure 4 Shown, including:
[0093] a partition determination module configured to, after the baseboard management controller is started, read a value of a first register and determine a target running partition and an environment variable based on a specific field of the first register, wherein the environment variable is used to represent the running partition when the baseboard management controller is started, and the specific field of the first register is used to represent at least an operating state of the baseboard management controller, wherein the operating state includes at least a reset reason and an abnormal running process;
[0094] The operation detection module is used to detect whether there is any abnormality in the operation phase of the baseboard management controller;
[0095] The restart module is used to store the reset reason and the running process where the exception occurs in a specific field of the first register if an exception occurs, and restart the baseboard management controller.
[0096] In some optional embodiments, the device further comprises:
[0097] Variable reading module, used to read environment variables;
[0098] The current partition determination module is used to determine the current running partition based on the environment variables.
[0099] In some optional implementations, the first specific field of the first register represents the running process in which the exception occurs, and the partition determination module includes:
[0100] The first switching unit is used to modify the environment variable from the first value to the second value if the first specific field indicates that there is an abnormal running process, and switch the current running partition to the target running partition, the first value corresponds to the current running partition, and the second value corresponds to the target running partition.
[0101] In some optional implementations, the partition determination module further includes:
[0102] a first reading unit, configured to read a second specific field and a third specific field of the first register if the first specific field of the first register indicates that there is no abnormal running process, wherein the second specific field indicates a reset reason and the third specific field indicates an image refresh status;
[0103] The partition determination unit is used to determine the target running partition and environment variables based on the reading result.
[0104] In some optional implementations, the partition determination unit includes:
[0105] a second reading subunit, configured to read a third specific field of the first register if the second specific field indicates that a reset reason exists, wherein the third specific field indicates a mirror refresh state;
[0106] The partition switching subunit is configured to determine the current running partition as the target running partition if the third specific field indicates that the image refresh is abnormal.
[0107] In some optional implementations, the partition determination unit includes:
[0108] The value modification subunit is configured to modify the environment variable from the first value to the second value and switch the current running partition to the target running partition if the third specific field indicates that there is no abnormality in the controller during image refresh.
[0109] In some optional implementations, the running stage includes a kernel stage, and the running detection module includes:
[0110] A core process detection unit, configured to detect whether there is an abnormal process in the core stage of the baseboard management controller;
[0111] The core abnormality unit is configured to determine that an abnormality exists in the core stage of the baseboard management controller if an abnormal process exists.
[0112] In some optional implementations, if it is determined that the baseboard management controller has an abnormality in the kernel stage, restarting the module includes:
[0113] The first modification unit is used to modify the first specific field and the second specific field of the first register, the modified first specific field indicates that there is an abnormality in the process at the kernel stage, and the modified second specific field indicates that the reset reason of the baseboard management controller is the kernel abnormality.
[0114] In some optional implementations, the operation phase includes a user layer phase, and the operation detection module includes:
[0115] A user layer detection unit is used to detect whether there is an abnormal process in the user layer stage;
[0116] The user layer abnormality unit is configured to determine that an abnormality exists in the baseboard management controller during the user layer phase if an abnormal process exists during the user layer phase.
[0117] In some optional implementations, if it is determined that the baseboard management controller is abnormal in the user layer stage, restarting the module includes:
[0118] The second modification unit is used to modify the first specific field and the second specific field of the first register, the modified first specific field indicates that there is an abnormality in the process at the user layer stage, and the modified second specific field indicates that the reset reason of the baseboard management controller is the baseboard management controller abnormality.
[0119] In some optional implementations, the user layer detection unit includes:
[0120] A timeout detection subunit, configured to detect whether a process in the user layer phase has timed out based on a preset counter;
[0121] The timeout determination subunit is used to determine whether an abnormal process exists if the timeout occurs.
[0122] In some optional embodiments, the device further comprises:
[0123] The reset module is configured to reset the first register, wherein a specific field of the first register after reset indicates that there is no abnormality in the baseboard management controller.
[0124] For the description of the features in the embodiment corresponding to the baseboard management controller startup device, reference can be made to the relevant description of the embodiment corresponding to the baseboard management controller startup method, which will not be repeated here.
[0125] The embodiment of the present application also provides a computer device, such as Figure 5 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above-mentioned baseboard management controller startup method embodiments.
[0126] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned baseboard management controller startup method embodiments when running.
[0127] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0128] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned baseboard management controller startup method embodiments are implemented.
[0129] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned baseboard management controller startup method embodiments.
[0130] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0131] The above is a detailed introduction to a baseboard management controller startup method provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A baseboard management controller startup method, characterized in that: include: After the baseboard management controller is started, a value of a first register is read, and a target running partition and an environment variable are determined based on a specific field of the first register, wherein the environment variable is used to represent the running partition when the baseboard management controller is started, and the specific field of the first register is used to represent at least an operating state of the baseboard management controller, wherein the operating state includes at least a reset reason and an abnormal running process; Check whether there are any abnormalities in the baseboard management controller during operation; If an exception occurs, the reset reason and the running process where the exception occurs are stored in a specific field of the first register, and the baseboard management controller is restarted; The determining of the target running partition and the environment variables based on the specific field of the first register includes: if the first specific field of the first register indicates that there is no abnormal running process, reading the second specific field and the third specific field of the first register, wherein the second specific field indicates a reset reason, and the third specific field indicates an image refresh status; and determining the target running partition and the environment variables based on the reading result includes: If the second specific field indicates that there is a reset reason, then reading the third specific field of the first register, where the third specific field indicates an image refresh status; If the third specific field indicates that the image refresh is abnormal, the current running partition is determined as the target running partition.
2. The controller startup method according to claim 1, characterized in that: Before reading the value of the first register, the method further includes: Read environment variables; The current running partition is determined based on the environment variable.
3. The controller startup method according to claim 2, characterized in that: The first specific field of the first register represents the abnormal running process, and determining the target running partition and the environment variable based on the specific field of the first register includes: If the first specific field indicates that there is an abnormal running process, the environment variable is modified from the first value to the second value, and the current running partition is switched to the target running partition, the first value corresponds to the current running partition, and the second value corresponds to the target running partition.
4. The controller startup method according to claim 1, characterized in that: After reading the third specific field of the first register, the method further includes: If the third specific field indicates that there is no abnormality in the controller during image refresh, the environment variable is modified from the first value to the second value, and the current running partition is switched to the target running partition.
5. The controller startup method according to claim 1, characterized in that: The operation phase includes a kernel phase, and detecting whether there is an abnormality in the baseboard management controller during the operation phase includes: Detecting whether there is an abnormal process in the process of the baseboard management controller in the kernel stage; If an abnormal process exists, it is determined that an abnormality occurs in the kernel stage of the baseboard management controller.
6. The controller startup method according to claim 5, characterized in that: If it is determined that the baseboard management controller has an abnormality in the kernel stage, storing the reset reason and the running process in which the abnormality occurs in the specific field of the first register includes: The first specific field and the second specific field of the first register are modified, the modified first specific field indicating that there is an abnormality in the process at the kernel stage, and the modified second specific field indicating that the reset reason of the baseboard management controller is the kernel abnormality.
7. The controller startup method according to claim 1, characterized in that: The operation phase includes a user layer phase, and detecting whether there is an abnormality in the baseboard management controller operation phase includes: Detect whether there are abnormal processes in the user layer stage; If there is an abnormal process in the user layer stage, it is determined that there is an abnormality in the baseboard management controller in the user layer stage.
8. The controller startup method according to claim 7, characterized in that: If it is determined that the baseboard management controller has an abnormality in the user layer stage, storing the reset reason and the running process where the abnormality occurs in the specific field of the first register includes: The first specific field and the second specific field of the first register are modified, the modified first specific field indicates that there is an abnormality in the process at the user layer stage, and the modified second specific field indicates that the reset reason of the baseboard management controller is the baseboard management controller abnormality.
9. The controller startup method according to claim 7, characterized in that: The detecting whether there is an abnormal process in the user layer stage includes: Detecting whether the process in the user layer phase has timed out based on a preset counter; If it times out, it is determined that there is an abnormal process.
10. The controller startup method according to claim 1, characterized in that: After restarting the baseboard management controller, the method further includes: The first register is reset, and a specific field of the reset first register indicates that there is no abnormality in the baseboard management controller.
11. A computer device, characterized in that: include: memory for storing computer programs; A processor is configured to implement the steps of the baseboard management controller startup method according to any one of claims 1 to 10 when executing the computer program.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the baseboard management controller startup method according to any one of claims 1 to 10 are implemented.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the baseboard management controller startup method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Embedded system restarting method and device, electronic equipment and readable storage medium
CN117667258A