System, device and storage medium for booting watchdog

By loading a preset boot whitelist during BIOS startup to automatically control the watchdog function, the problem of manual operation during server production testing and filling processes is solved, simplifying the process and improving ease of use.

CN117667252BActive Publication Date: 2026-11-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311607477.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2026-11-20
Estimated Expiration
2043-11-28

AI Technical Summary

Technical Problem

In existing technologies, the OS loader watchdog function needs to be manually turned on and off during server production testing and filling processes, which increases the complexity of the production process and the difficulty of R&D testing. Furthermore, systems that do not support the OS loader watchdog may cause system restarts.

Method used

By loading a preset boot whitelist during BIOS startup, obtaining and comparing boot parameter types, and automatically controlling the enabling and disabling of the watchdog function, the production testing and R&D testing process is simplified.

Benefits of technology

It enables automatic control of the watchdog function's activation and deactivation during the BIOS boot process, simplifying the production process in server production testing and improving ease of use during server R&D and customer maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667252B_ABST
    Figure CN117667252B_ABST
Patent Text Reader

Abstract

The application provides a system boot watchdog starting method, system, device and storage medium. The method comprises the following steps: loading a preset starting white list at the time of starting; obtaining each starting parameter corresponding to the starting parameter type in the preset starting white list before starting the system boot; and determining the watchdog function starting of the system boot according to the preset starting white list and the obtained each starting parameter. The application aims to simplify the production procedure of the server production detection link, and improve the ease of use of the server research and development stage and the customer maintenance stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer equipment technology, and in particular to a method, system, device and storage medium for enabling a system boot watchdog. Background Technology

[0002] In the field of cloud computing data centers, the requirements for server stability, reliability, and serverability are very stringent. The system must be as reliable as possible, preventing unexpected crashes, restarts, or even physical damage. This means that a reliable system must be able to self-correct minor errors and isolate uncorrectable errors to ensure the normal operation of the rest of the system. When a server encounters a serious failure during system operation that causes a system crash, a watchdog mechanism from the OS (Operating System) is needed to restore system operation. Additionally, if a serious firmware failure (such as a CPU core or critical bus UCE) occurs during the server BIOS boot process, causing the firmware to hang, the BIOS boot watchdog function also needs to intervene, resetting the motherboard / powering it back on after a BIOS boot timeout. Similarly, the BIOS booting and loading of the OS may also encounter serious failures leading to a crash; to ensure server recovery, the OS loader watchdog function typically monitors this stage.

[0003] The OS loader watchdog function will encounter the following problems in actual use: (1) During the server production process, the production testing system does not support the OS loader watchdog function. Before production testing, the OS loader watchdog needs to be turned off and then turned on after production testing is completed, which increases the production process and procedures; (2) The OS loader watchdog is usually not fed during the OS installation process. When installing the system, the OS loader watchdog needs to be turned off before installation can be performed, which increases the complexity of system installation; (3) The server may load an OS system that does not support the OS loader watchdog. If the OS loader watchdog is not turned off, the system will keep restarting. A common scenario is that different types of OS systems will be loaded for testing during R&D testing. Summary of the Invention

[0004] In view of this, this application provides a method, system, device, and storage medium for enabling a system boot watchdog timer. The aim is to simplify the production process in server production testing and improve usability during server R&D and customer maintenance phases.

[0005] In a first aspect of this application, a method for enabling a system boot watchdog timer is provided, applied to a BIOS, the method comprising:

[0006] Load the preset startup whitelist at startup;

[0007] Before initiating the system boot process, obtain each boot parameter corresponding to the boot parameter type in the preset boot whitelist;

[0008] Based on the preset startup whitelist and the obtained startup parameters, the watchdog function of the system boot is enabled.

[0009] Optionally, the startup parameter types include startup medium slot information, startup medium, and startup path.

[0010] Optionally, determining whether the watchdog function for system boot is enabled based on the preset boot whitelist and the obtained boot parameters includes:

[0011] The obtained startup parameters are compared with the whitelist startup parameters under the corresponding startup parameter type in the preset startup whitelist to obtain the comparison results;

[0012] If the boot parameters for each type of boot parameter obtained by the comparison results include the target boot parameters that exist in the preset boot whitelist, then the watchdog function of the system boot is enabled.

[0013] Optionally, when the boot parameter type is boot media slot information, before starting the system boot, obtaining each boot parameter corresponding to the boot parameter type in the preset boot whitelist includes:

[0014] During the driver execution environment phase, PCIe devices are enumerated to obtain the enumeration results;

[0015] Based on the PCIe devices in the enumeration results, generate the device path of the PCIe device;

[0016] Based on the device path of the PCIe device, determine the boot media slot information of the PCIe device.

[0017] Optionally, when the boot parameter type is boot media, the step of obtaining each boot parameter corresponding to the boot parameter type in the preset boot whitelist before booting the system includes:

[0018] During the driver execution environment phase, PCIe devices are enumerated to obtain the enumeration results;

[0019] Based on the PCIe devices in the enumeration results, generate the device path of the PCIe device;

[0020] During the device selection phase, the PCIe device is accessed through its device path, and the class id in the PCIe device's configuration space is read.

[0021] The boot medium of the PCIe device is determined based on the class id in the configuration space of the PCIe device.

[0022] Optionally, when the boot parameter type is boot path, the step of obtaining each boot parameter corresponding to the boot parameter type in the preset boot whitelist before starting the system boot includes:

[0023] By searching through various storage paths, the storage path where the startup file is located can be obtained;

[0024] The storage path where the startup item file is located is determined as the startup path.

[0025] Optionally, before loading the preset startup whitelist at startup, the method further includes:

[0026] The pre-built preset boot whitelist is set as the default whitelist within the BIOS;

[0027] Alternatively, the pre-built default boot whitelist can be configured into the BIOS setup.

[0028] Optionally, if the pre-built preset boot whitelist is configured in the BIOS setup, the method further includes:

[0029] Update the preset startup whitelist;

[0030] Configure and save the updated default boot whitelist through BIOS setup;

[0031] After restarting the BIOS, enable the updated default boot whitelist.

[0032] In a second aspect of this application, a system for unlocking a system-booted watchdog timer is provided, the system comprising:

[0033] The preset startup whitelist acquisition module is used to load the preset startup whitelist at startup.

[0034] The startup parameter acquisition module is used to acquire each startup parameter corresponding to the startup parameter type in the preset startup whitelist before starting the system boot process;

[0035] The watchdog function control module is used to determine whether the watchdog function of the system boot is enabled based on the preset boot whitelist and the obtained boot parameters.

[0036] In a third aspect of this application, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the computer program, when executed by the processor, implements the steps in the system boot watchdog activation method as described in the first aspect of this application.

[0037] In a third aspect of the embodiments of this application, this application provides a computer non-volatile readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the system boot watchdog activation method described in the first aspect of this application.

[0038] Compared with prior art, this application has the following advantages:

[0039] This application provides a method for enabling a system boot watchdog timer. The method is applied to a BIOS (Basic Input Output System). First, when starting the system boot process (i.e., starting the OS loader), a pre-built preset boot whitelist is obtained. During the system boot process, each boot parameter corresponding to the boot parameter type in the preset boot whitelist is obtained. Based on the preset boot whitelist and the obtained boot parameters, it is determined whether each boot parameter meets the conditions for enabling the system boot watchdog function. If it does, the system boot watchdog function is enabled. Therefore, by introducing a pre-built preset boot whitelist, relevant boot parameters are obtained during the BIOS booting OSloader process. The obtained boot parameters are compared with the boot parameters in the preset boot whitelist. Based on the comparison result, the BIOS determines whether the current OSloader boot scenario meets the conditions for enabling the OSloader watchdog function. Based on the determination result, the OSloader watchdog function is enabled or disabled. This eliminates the need for engineers to enable or disable the OSloader watchdog function according to the actual OSloader boot scenario. As a result, the production process in the server production testing stage can be simplified, and the usability of the server R&D stage and customer maintenance stage can be improved.

[0040] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0042] Figure 1 A flowchart illustrating a method for enabling a system boot watchdog timer, provided as an embodiment of this application;

[0043] Figure 2 The diagram illustrates the logical relationships between the various units in a system boot watchdog activation method provided in an embodiment of this application.

[0044] Figure 3 Another flowchart illustrating a method for enabling a system boot watchdog timer, provided in an embodiment of this application;

[0045] Figure 4 A schematic diagram of a system boot watchdog activation system provided in this application embodiment;

[0046] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] The exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings.

[0048] Before describing this application, the relevant terms used thereafter will be explained to facilitate understanding of the implementation methods.

[0049] UEFI: Unified Extensible Firmware Interface, is a personal computer system specification used to define the software interface between the operating system and system firmware. It is a new type of BIOS. The Extensible Firmware Interface is responsible for Power-On Self-Test (POST), communicating with the operating system, and providing an interface for connecting the operating system and hardware. The traditional BIOS is legacy.

[0050] OS loader: The process of loading the operating system.

[0051] NVMe: NVM Express (NVMe), or Non-Volatile Memory Host Controller Interface Specification (NVMHCIS), is a logical device interface specification. Similar to AHCI, it's a bus transport protocol specification based on a device logical interface (equivalent to the application layer in communication protocols) used to access non-volatile memory media attached via the PCI Express (PCIe) bus.

[0052] PXE: Preboot Execution Environment (PXE), also known as a pre-execution environment, provides a mechanism for booting a computer using a network interface. This mechanism allows the computer to boot without relying on local data storage devices (such as hard drives) or a locally installed operating system.

[0053] PCI-Express (peripheral component interconnect express) is a high-speed serial computer expansion bus standard.

[0054] Figure 1 A flowchart illustrating a method for enabling a system boot watchdog timer, as provided in this application embodiment, is shown below. Figure 1 As shown, this method is applied to BIOS (Basic Input Output System), and the method includes:

[0055] Step S1: Load the preset startup whitelist at startup.

[0056] In this embodiment, the startup of the operating system in the device requires the BIOS to load the operating system bootloader (i.e., the OS loader) to control the operating system startup. After the BIOS is powered on, a pre-built preset boot whitelist is loaded. This preset boot whitelist stores whitelist boot parameters of at least one type of boot parameter, which are used to determine whether the current operating system startup process meets the conditions for enabling the watchdog function of the OS loader.

[0057] Step S2: Before starting the system boot process, obtain each boot parameter corresponding to the boot parameter type in the preset boot whitelist.

[0058] In this embodiment, when starting the system boot (i.e., the OS loader), it is necessary to determine whether the BIOS needs to control the OS loader's watchdog function. Therefore, before starting the system boot, the BIOS obtains all boot parameters of the same type as those in the preset boot whitelist. For example, if the preset boot whitelist includes whitelisted boot parameters of types a and b, the BIOS obtains all boot parameters belonging to type a and all boot parameters belonging to type b.

[0059] Step S3: Based on the preset startup whitelist and the obtained startup parameters, determine whether the watchdog function of the system boot is enabled.

[0060] In this embodiment, after loading the preset boot whitelist and obtaining boot parameters of the same type as those in the preset boot whitelist through steps S1 and S2, the BIOS determines whether the system boot watchdog function needs to be enabled based on the relationship between the obtained boot parameters and the whitelist boot parameters. If the BIOS determines that the system boot watchdog function needs to be enabled, it directly enables the system boot watchdog function; otherwise, if the BIOS determines that the system boot watchdog function does not need to be enabled, it directly disables the system boot watchdog function.

[0061] This application provides a method for enabling a system boot watchdog timer. This method is applied to the BIOS (Basic Input Output System). First, during the system boot process (i.e., OSloader), a pre-built preset boot whitelist is obtained. During the boot process, various boot parameters corresponding to the boot parameter types in the preset boot whitelist are obtained. Based on the preset boot whitelist and the obtained boot parameters, it is determined whether to enable the system boot watchdog function. Therefore, by introducing a pre-built preset boot whitelist, relevant boot parameters are obtained during the BIOS OSloader boot process. These obtained boot parameters are compared with the boot parameters in the preset boot whitelist. Based on the comparison result, the BIOS determines whether the OSloader watchdog function needs to be enabled for the current OSloader boot scenario. This eliminates the need for engineers to manually enable or disable the OSloader watchdog function based on the actual OSloader boot scenario, thus simplifying the production process in server production testing and improving usability during server R&D and customer maintenance.

[0062] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog. In this method, the boot parameter types in the preset boot whitelist include boot media slot information, boot media, and boot path.

[0063] In this embodiment, the boot parameter types included in the pre-built boot whitelist in this application preferably include boot media slot information, boot media, and boot path simultaneously. Boot media refers to various media required for operating system startup, including but not limited to USB boot media, SSD / HDD boot media, PXE boot media, CDROM boot media, etc., with SSD / HDD further including SAS / SATA HDD drives and NVMe SSD drives. Boot media slot information refers to various hardware ports on the server that can serve as boot media access ports for the OS (operating system). For example, a server may have 3 USB ports, 2 m.2 NVMe slots, and multiple network ports supporting PXE functionality. These ports have corresponding slot codes, and the OS (operating system) boot media can boot the OS through these ports. For instance, if the boot media is USB, the USB boot media can boot the OS through the USB interface. The boot path refers to the storage path corresponding to the boot entry file of the OS loader, such as: / EFI / redhat / osloader_wdt / grubx64.efi. For example, the boot parameter types included in the pre-built boot whitelist in this application include boot media slot information, boot media, and boot path. PXE boot media and NVMe boot media are stored in the pre-built boot whitelist as whitelisted boot media, the slot information of the first slot of the two m.2 boot media slot information is stored in the pre-built boot whitelist as whitelisted boot media slot information, and the boot path " / EFI / redhat / osloader_wdt / grubx64.efi" is stored in the pre-built boot whitelist as whitelisted boot path. These whitelisted boot media, whitelisted boot media slot information, and whitelisted boot path are all referred to as whitelisted boot parameters.

[0064] In this embodiment, the startup parameter types included in the preset startup whitelist pre-built in this application can also include only one of the three: startup media slot information, startup media, and startup path, or only any two of the three: startup media slot information, startup media, and startup path.

[0065] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog timer. In this method, step S3 may include steps S31 to S32:

[0066] Step S31: Compare the obtained startup parameters with the whitelist startup parameters of the corresponding startup parameter type in the preset startup whitelist to obtain the comparison results.

[0067] In this embodiment, the startup parameter types in the preset startup whitelist can include only one of the startup media slot information, startup media, and startup path, or only any two of the startup media slot information, startup media, and startup path, or all three of the startup media slot information, startup media, and startup path.

[0068] In this embodiment, when comparing the obtained startup parameters with the whitelisted startup parameters in the preset startup whitelist, the comparison is made for startup parameters of the same type, such as comparing the obtained startup medium with the whitelisted startup medium in the preset startup whitelist, comparing the obtained startup medium slot information with the whitelisted startup medium slot information in the preset startup whitelist, and comparing the obtained startup path with the whitelisted startup path in the preset startup whitelist.

[0069] If the boot parameter type in the preset boot whitelist includes boot media, the boot media for booting the operating system will be obtained before the BIOS boots the system. This can be any one of USB boot media, PXE boot media, NVMe SSD boot media, etc.

[0070] When the boot parameter type in the preset boot whitelist includes boot media slot information, the boot media slot information will be obtained before the BIOS boots the system. In x86 system servers, the boot media port is usually a PCIe device port. Therefore, this application uses the BDF information of the PCIe device as the slot information to uniquely identify different boot media slots in the server. The BDF information of the PCIe device consists of PCIe Bus, PCIe Device, and Functions. For example, BDF information of 0000:01:00.0 indicates a PCIe device located in slots Bus0, Device1, and Func0.

[0071] If the boot parameter type in the preset boot whitelist includes the boot path, the corresponding boot path will be obtained before the BIOS boots the system. This boot path is the storage path where the boot item file is located.

[0072] In this embodiment, when the boot parameter types in the preset boot whitelist include boot media, the boot media obtained before the BIOS boots the system are compared with each whitelisted boot media included in the preset boot whitelist to obtain the corresponding comparison results.

[0073] For example, the whitelist of boot media included in the default boot whitelist includes PXE boot media and NVMe boot media. Before the BIOS boots the system, the boot media obtained include USB boot media and PXE boot media. At this time, the obtained USB boot media and PXE boot media are compared with the PXE boot media and NVMe boot media in the default boot whitelist to obtain the comparison results.

[0074] In this embodiment, when the boot parameter types in the preset boot whitelist include boot media slot information, the boot media slot information obtained before the BIOS boots the system is compared with the boot media slot information of each whitelist included in the preset boot whitelist to obtain the corresponding comparison results.

[0075] For example, a typical server will have 3 USB port slots, 2 m.2 NVMe slots, and multiple network port slots supporting PXE. In this example, the slot information of the first of the two m.2 NVMe slots and the slot information of all the network port slots are identified as the whitelisted boot media slot information in the preset boot whitelist. Before the BIOS boots the system, the boot media slot information obtained includes the slot information of the second of the two m.2 NVMe slots and the slot information of one network port slot. At this point, the obtained slot information of the second of the two m.2 NVMe slots and the slot information of the one network port slot are compared with the whitelisted boot media slot information in the preset boot whitelist to obtain the comparison results.

[0076] In this embodiment, when the boot parameter types in the preset boot whitelist include boot paths, the boot path obtained before the BIOS boots the system is compared with each whitelist boot path in the preset boot whitelist to obtain the corresponding comparison results.

[0077] For example, a server can boot an operating system in different ways via BIOS, such as booting a local operating system via BIOS, booting an operating system using a network interface based on a PXE boot medium via BIOS, or booting an operating system based on an NVMe boot medium via BIOS. When the BIOS boots the corresponding operating system in different ways, the storage paths of the boot files will also be different. Therefore, by excluding the storage paths of some boot files from the preset boot whitelist, the BIOS can automatically control the boot method that uses these boot files to boot the operating system without enabling the watchdog function for system booting. In this example, the boot path " / EFI / redhat / osloader_wdt / grubx64.efi" is determined as a whitelisted boot path in the preset boot whitelist. The boot path obtained by the BIOS before booting the system is " / EFI / redhat / osloader_wdt / grubx64.efi". At this point, the obtained boot path is compared with the whitelisted boot paths in the preset boot whitelist to obtain the corresponding comparison result.

[0078] Step S32: If the startup parameters for each startup parameter type obtained by the comparison results include the target startup parameters that exist in the preset startup whitelist, enable the watchdog function of the system boot.

[0079] In this embodiment, when the boot parameter types in the preset boot whitelist only include one type (such as only boot media, only boot media slot information, or only boot path), and when the target boot parameter existing in the preset boot whitelist is included among the boot parameters obtained by comparison results, the watchdog function of the BIOS automatic control system boot is enabled.

[0080] For example, the default boot whitelist only includes the boot parameter type "boot media," and the whitelisted boot media are PXE boot media and NVMe SSD boot media. However, the boot media obtained by the BIOS before booting the system are USB boot media and PXE boot media. At this time, the obtained USB boot media and PXE boot media are compared with each whitelisted boot media in the default boot whitelist. The comparison result shows that the obtained two boot media include PXE boot media that exists in the default boot whitelist. This PXE boot media is the target boot media. At this time, the OS loader's boot media identifier is changed from the default false to true. The BIOS automatically controls and enables the watchdog function for system boot.

[0081] For example, the default boot whitelist only includes the boot media slot information as a boot parameter type. The whitelist boot media slot information includes the first slot of the server's two m.2 NVMe slots and all network port slots. The boot media slot information obtained by the BIOS before booting the system includes one network port slot and the second slot of the two m.2 NVMe slots. This information is then compared with the whitelisted boot media slot information. Since all network port slot information is in the default boot whitelist, the comparison result shows that the obtained boot media slot information includes network port slots in the default boot whitelist. This network port slot information is the target boot media slot information. The OS loader's boot media slot information flag is then changed from the default false to true, and the BIOS automatically enables the watchdog function for system booting.

[0082] For example, the default boot whitelist only includes the boot path as a boot parameter type, and the whitelist boot path is " / EFI / redhat / osloader_wdt / grubx64.efi". The boot path obtained by the BIOS before booting the system is " / EFI / redhat / osloader_wdt / grubx64.efi". At this time, the obtained boot path is compared with each whitelist boot path in the default boot whitelist. The comparison result shows that the obtained boot path exists in the default boot whitelist. At this time, the OS loader boot path identifier is changed from the default false to true. The BIOS automatically controls and enables the watchdog function of system boot.

[0083] In this embodiment, when the startup parameter types in the preset startup whitelist include three or any two startup parameter types, and when the startup parameters under each startup parameter type obtained by comparison result characterization include the target startup parameters existing in the preset startup whitelist, the watchdog function guided by the IOS automatic control system is enabled.

[0084] For example, the boot parameter types in the preset boot whitelist include boot media and boot media slot information. The whitelisted boot media are PXE boot media and NVMe SSD boot media, and the whitelisted boot media slot information is the slot information of the first slot out of two m.2 NVMe slots. However, the boot media obtained before the BIOS boots the system are NVMe SSD boot media and USB boot media, and the obtained boot media slot information is the slot information of the first slot out of two m.2 NVMe slots and the slot information of one Ethernet slot. At this point, the obtained NVMe SSD boot media and USB boot media are compared with the whitelisted boot media in the preset boot whitelist, and the obtained slot information of the first slot out of two m.2 NVMe slots and the slot information of one Ethernet slot are compared with the whitelisted boot media slot information in the preset boot whitelist. The comparison results show that among the multiple boot media obtained, there is an NVMe SSD boot media that exists in the preset boot whitelist. This NVMe SSD boot media is the target boot parameter for this boot parameter type that exists in the preset boot whitelist. Simultaneously, among the multiple boot media slot information obtained, there is the slot information of the first slot among the two m.2 NVMe slots that exists in the preset boot whitelist. This first slot information is the target boot parameter for this boot parameter type that exists in the preset boot whitelist. Therefore, the OSloader's boot media identifier is set from the default false to true, and the OS loader's boot media slot information identifier is also set from the default false to true. Since the identifiers corresponding to both boot parameter types included in the preset boot whitelist are both true, the BIOS automatically enables the system boot watchdog function. If any of the boot parameter types in the preset boot whitelist have a false identifier, the BIOS will not enable the system boot watchdog function.

[0085] In this embodiment, when the preset startup whitelist includes multiple startup parameter types, the various startup parameter types being compared can be performed in a specific order. For the startup parameter type being compared first (it should be understood that the startup parameter type being compared first can be any type), after obtaining each startup parameter of the startup parameter type being compared first, each startup parameter is compared with the whitelist startup parameters of the same startup parameter type in the preset startup whitelist to obtain a comparison result. If the obtained comparison result indicates that the obtained startup parameters do not include the target startup parameter existing in the preset startup whitelist, then the subsequent comparison operation can be ended, and it can be directly determined that the watchdog function of system boot is not enabled. The order of operations can be freely combined and is not specifically limited. For example, when the boot parameter types in the preset boot whitelist include boot media, boot media slot information, and boot path, the order could be: first, compare the obtained boot media with the whitelisted boot media; then, compare the obtained boot media slot information with the whitelisted boot media slot information; and finally, compare the obtained boot path with the whitelisted boot path. Alternatively, the order could be: first, compare the obtained boot path; then, compare the obtained boot media; and finally, compare the obtained boot media slot information. When the preset boot whitelist includes multiple boot parameter types, the comparison operations for each type can be performed simultaneously. The system boot watchdog function is then determined based on the combined comparison results for each boot parameter type. For example, if all the identifiers for each boot parameter type are obtained, it is determined whether all identifiers are true. Only when all identifiers are true is the BIOS controlling the system boot watchdog function enabled.

[0086] For example, to facilitate understanding of the implementation method, an example is provided here. The preset boot whitelist includes whitelisted boot parameters a1, a2, and a3 of boot parameter type A, whitelisted boot parameters b1, b2, and b3 of boot parameter type B, and whitelisted boot parameters c1, c2, and c3 of boot parameter type C. Before booting the system, the BIOS obtains boot parameters of type A including a1 and a4, boot parameters of type B including b2 and b4, and boot parameters of type C including c1 and a5. Since the obtained boot parameters a1 and a4 include a1, which is in the preset boot whitelist, the OS loader's A boot parameter type flag is set from the default false to true. Similarly, since the obtained boot parameters b2 and b4 include b2, which is in the preset boot whitelist, the OS loader's B boot parameter type flag is set from the default false to true. Furthermore, since the obtained boot parameters c1 and c5 include c1, which is in the preset boot whitelist, the OS loader's C boot parameter type flag is set from the default false to true. Ultimately, all three boot parameter type flags are true, therefore the BIOS automatically enables the watchdog timer function for system booting.

[0087] In this embodiment, during server production, the production testing system does not support the OS loader watchdog function. The OS loader watchdog needs to be disabled before production testing and then enabled after testing, increasing the production process and procedures. Since the production testing system typically boots the operating system from a USB boot medium, the system boot watchdog enabling method provided in this application includes boot medium as a boot parameter type when constructing the preset boot whitelist, while excluding USB boot media. Therefore, when the production testing system boots the operating system from a USB boot medium during server testing, the BIOS will not enable the corresponding watchdog function when controlling system boot. This process is automatically completed by the BIOS after the preset boot whitelist is constructed and placed inside the BIOS, eliminating the need for engineers to disable the watchdog function for each production test, effectively simplifying the server production testing process.

[0088] In this embodiment, the OS loader watchdog is typically not fed during the OS installation process. Disabling the OS loader watchdog before system installation increases the complexity of the process. Since OS installation usually uses PXE, USB, or CD-ROM boot media, the system boot watchdog enabling method provided in this application includes boot media as a boot parameter type when building the preset boot whitelist, while excluding PXE, USB, and CD-ROM boot media. Therefore, during OS installation, because these boot media are not in the preset boot whitelist, the BIOS will not enable the corresponding watchdog function when controlling system boot, thus not affecting OS installation. This process is automatically completed by the BIOS after the preset boot whitelist is built and placed inside the BIOS, eliminating the need for engineers to disable the watchdog function for each OS installation, effectively improving usability during server development.

[0089] In this embodiment, for servers that may load OS systems that do not support OS loader watchdogs, failure to disable the OS loader watchdog will cause the system to continuously restart. A common scenario is the issue of loading different types of OS systems for testing during R&D. Different operating systems generally have uniformity in their boot paths. For example, for the same OS system that does not support OS loader watchdogs, its boot path is generally consistent. The system boot watchdog enabling method provided in this application, when constructing the preset boot whitelist, first ensures that the preset boot whitelist includes the boot path as a boot parameter type, and simultaneously excludes the boot path of the OS system that does not support OS loader watchdogs from the preset boot whitelist. When the server loads this OS system that does not support OS loader watchdogs, the BIOS will, based on the preset boot whitelist, control the system boot process without enabling the watchdog function, thereby preventing continuous system restarts. This process is automatically completed by the BIOS after the preset boot whitelist is constructed and placed in the BIOS, effectively improving usability during customer maintenance.

[0090] In this embodiment, the system boot watchdog enabling method provided in this application ensures that the OS Loader watchdog is enabled only for OS systems with the OS Loader enabled and OS systems inserted into specific boot media slots. For example, if the OS Loader watchdog is enabled for a customer's product operating system (with a different boot path than other common OSs), then the boot path of that operating system is added to the preset boot whitelist. If the OS is installed in an NVMe system disk in the m.2_0 slot, then the m.2_0 boot media slot and the NVMe boot media are excluded from the preset boot whitelist. This method solves the above-mentioned problems during OS installation (OS installation is usually done through storage boot systems such as USB flash drives, PXE media, and CD-ROM media), solves the above-mentioned production testing problems, and solves the above-mentioned system boot loading problems that do not support the OS loader watchdog.

[0091] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog. In this method, if the boot parameter type in the preset boot whitelist includes boot media slot information, step S2 may include steps S21 to S23:

[0092] Step S21: Enumerate PCIe devices during the driver execution environment phase and obtain the enumeration results.

[0093] In this embodiment, the implementation method for the BIOS to obtain the boot media slot information before booting the system is as follows: The boot process of the operating system is controlled by the BIOS. The whole process involves multiple stages. The determination of the boot media slot information is carried out in the DXE (Driver Execution Environment) stage, which is the stage of the driver execution environment. In this stage, the BIOS enumerates the PCIe devices and obtains the enumeration results. The enumeration results represent the PCIe devices that need to be enabled.

[0094] Step S22: Generate the device path of the PCIe device based on the PCIe devices in the enumeration result.

[0095] In this embodiment, the device path of each PCIe device is generated based on the enumeration results.

[0096] Step S23: Determine the boot media slot information of the PCIe device based on the device path of the PCIe device.

[0097] In this embodiment, the Device Path of each PCIe device contains the slot information of the corresponding PCIe device, which is the BDF information. The BIOS obtains the Device Path of each PCIe device and extracts the BDF information, i.e., the slot information, from the corresponding Device Path, thereby obtaining the boot media slot information of each PCIe device. The boot media slot information connected to the boot media of the operating system to be booted is also present in the obtained boot media slot information of each PCIe device.

[0098] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog. In this method, if the boot parameter type in the preset boot whitelist includes boot media, step S2 may include steps S201 to S204:

[0099] Step S201: Enumerate PCIe devices during the driver execution environment phase and obtain the enumeration results.

[0100] In this embodiment, the implementation method for the BIOS to obtain the boot medium before booting the system is as follows: The boot process of the operating system is controlled by the BIOS. The whole process involves multiple stages. The determination of the boot medium is carried out in the DXE (Driver Execution Environment) and BDS (Boot Device Select) stages, which are the stages of driver execution environment and boot device selection. In the driver execution environment stage, the BIOS enumerates PCIe devices and obtains the enumeration results. The enumeration results represent the PCIe devices that need to be enabled.

[0101] Step S202: Generate the device path of the PCIe device based on the PCIe devices in the enumeration result.

[0102] In this embodiment, the device path of each PCIe device is generated based on the enumeration results.

[0103] Step S203: During the device selection phase, the PCIe device is accessed through the device path of the PCIe device, and the class id in the configuration space of the PCIe device is read.

[0104] In this embodiment, during the device selection phase, the BIOS accesses each PCIe device through its device path and reads the class ID in the PCIe configuration space of each PCIe device.

[0105] Step S204: Determine the boot medium of the PCIe device based on the class id in the configuration space of the PCIe device.

[0106] In this embodiment, the class ID in the PCIe configuration space of a PCIe device is a data structure defined by the PCIe standard protocol. The relevant information in this data structure corresponds to the specific type of boot media. Therefore, based on the class ID in the PCIe configuration space of each PCIe device, the boot media type of each PCIe device can be determined, such as whether it is a USB boot media, a PXE boot media, or an NVMe SSD boot media. Thus, by obtaining the class ID in the configuration space of each PCIe device and identifying the corresponding class ID through the BIOS, the boot media type of each PCIe device can be determined. The boot media of the operating system to be booted also exists within the obtained boot media types of each PCIe device.

[0107] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog. In this method, if the boot parameter type in the preset boot whitelist includes a boot path, step S2 may include steps S211 to S212:

[0108] Step S211: Obtain the storage path where the startup file is located by searching each storage path.

[0109] In this embodiment, there are many types of operating systems, such as Windows and Linux. Linux systems include many open-source or commercial systems, such as Red Hat, CentOS, KylinOS, and Ubuntu. Currently, operating systems all support the UEFI specification and place UEFI boot files in a specific boot path. Therefore, the implementation method of the BIOS obtaining the boot path before booting the system in this application is as follows: The operating system boot process is controlled by the BIOS, and this control process involves the boot files required for booting the system. Therefore, during the BIOS-controlled operating system boot process, the boot files are searched in the boot medium. When a boot file is found, its storage path is obtained.

[0110] Step S212: Determine the storage path where the startup item file is located as the startup path.

[0111] In this embodiment, the storage path where the startup item file is located is determined as the startup path, which is used to determine whether the watchdog function for system booting should be enabled in the subsequent process.

[0112] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog. In this method, the method further includes step S01: setting the pre-built preset boot whitelist as a default whitelist within the BIOS; or, configuring the pre-built preset boot whitelist into the BIOS setup.

[0113] In this embodiment, the pre-built preset boot whitelist can be set directly inside the BIOS as the default whitelist, or the pre-built preset boot whitelist can be configured in the BIOS setup interface.

[0114] In conjunction with the above embodiments, in one implementation, this application also provides a method for enabling a system boot watchdog. In this method for enabling the system boot watchdog, when the pre-built preset boot whitelist is configured in the BIOS setup, the method further includes steps S011 to S013:

[0115] Step S011: Update the preset startup whitelist.

[0116] In this embodiment, configuring the pre-built preset boot whitelist in the BIOS setup interface facilitates updating and adjusting the preset boot whitelist. First, engineers can build a new preset boot whitelist or update the original preset boot whitelist.

[0117] Step S012: Configure and save the updated preset boot whitelist through BIOS setup.

[0118] In this embodiment, the newly constructed preset boot whitelist, or the preset boot whitelist obtained by updating the original preset boot whitelist, is configured and saved in the BIOS setup interface. Simultaneously, the setup includes options for enabling the OS loader watchdog and setting the OS loader watchdog timeout.

[0119] Step S013: After restarting the BIOS, enable the updated default boot whitelist.

[0120] In this embodiment, after restarting the BIOS, the newly constructed preset boot whitelist is enabled, or the preset boot whitelist obtained by updating the original preset boot whitelist is enabled.

[0121] In this embodiment, the method for enabling the watchdog function varies depending on the server design. This application uses a CPLD (Complex Programmable Logic Device) to implement the watchdog mechanism, with a default watchdog timeout of 5 minutes. The OS Loader watchdog is enabled by setting the watchdog enable register provided by the CPLD through the CPLD IIC channel. Furthermore, when using an OS Loader watchdog based on the IPMI (Intelligent Platform Management Interface) standard, an enable command for the OS Loader watchdog can be sent to the BMC via IPMI commands. Figure 2 As shown, Figure 2 The diagram shows the logical relationship between the various units in a system boot watchdog activation method provided in an embodiment of this application, as follows: Figure 2 As shown, the BIOS controls the opening and closing of the OS Loader's watchdog function by changing the data in the register based on the CPLD. Based on the on / off state of the watchdog function, the OS Loader boots the operating system. During this process, the operating system can be booted when the watchdog function is on or off.

[0122] In this embodiment, after the operating system boots to kernel init, it is determined that the operating system has been successfully started, and the OS loader watchdog function is disabled. The disabling method varies depending on the server design. This application uses a CPLD to implement the watchdog mechanism, and disables the OS Loader watchdog by setting the watchdog disable register provided by the CPLD through the CPLD IIC channel. Alternatively, when using the IPMI standard OS loader watchdog, a command to disable the OS Loader watchdog can be sent to the BMC via IPMI instructions.

[0123] In this embodiment, when the UEFI BIOS crashes during the boot process of the product system OS after booting the OS, and the OS fails to reach the stage of disabling the OS loader watchdog after kernel init, the OS loader watchdog will time out. At this time, the CPLD or BMC will restart the system to recover.

[0124] This application provides a method for enabling a system boot watchdog. By designing a preset boot whitelist including three boot parameter types, it filters the conditions for enabling the OS loader watchdog function. This ensures that the OS loader watchdog function is enabled only for specific OS boot media, specific boot media slot information, and specific operating systems that support the OS loader watchdog function. This solves both the problem of no watchdog protection during the OS boot phase and the problem of operating systems becoming unusable due to other OSs not supporting the OS loader watchdog function in production, R&D, and OS installation scenarios. It improves server reliability and availability, simplifies production processes in the production and testing stages, and enhances usability during the R&D and customer maintenance phases.

[0125] In this embodiment, Figure 3 Another flowchart illustrating a method for enabling a system boot watchdog timer provided in this application embodiment is shown below. Figure 3As shown, in this embodiment, the preset boot whitelist is set in the BIOS setup. After power-on, the BIOS flash NVRAM (Non-Volatile Random Access Memory) is read to obtain the setup configuration. If the flash NVRAM is empty, the default preset boot whitelist is updated to the flash NVRAM. The three identifiers of the OS loader are set using the preset boot whitelist in the flash NVRAM, which defaults to false. Before the BIOS boots the system, the Device Path of each PCIe device is obtained by enumerating the PCIe devices. Then, based on the Device Path of each PCIe device, each PCIe device is accessed to obtain its corresponding class ID. Based on the class ID of each PCIe device, the boot media of each PCIe device can be determined. At the same time, based on the Device Path of each PCIe device, the boot media slot information of each PCIe device can be determined. When the BIOS boots the operating system, it will search for the storage path of the boot item file, which is the boot path. The system polls and checks if the boot media for each PCIe device is a target boot media in the preset boot media whitelist. If not, the OS loader's boot media flag remains false; otherwise, it is updated to true. It then polls and checks if the boot media slot information for each PCIe device is a target boot media slot in the preset boot media whitelist. If not, the OS loader's boot media slot information flag remains false; otherwise, it is updated to true. Next, it checks if the boot path is in the preset boot media whitelist. If not, the OS loader's boot path flag remains false; otherwise, it is updated to true. Finally, it checks if all three OS loader flags are true. If all are true, the BIOS enables the watchdog timer when starting the OS loader; otherwise, it disables the watchdog timer.

[0126] Based on the same inventive concept, a second aspect of this application provides a system for opening a watchdog timer, such as... Figure 4 As shown, the system 400 includes:

[0127] The preset startup whitelist acquisition module 401 is used to load the preset startup whitelist during startup;

[0128] The startup parameter acquisition module 402 is used to acquire each startup parameter corresponding to the startup parameter type in the preset startup whitelist before starting the system boot.

[0129] The watchdog function control module 403 is used to determine whether the watchdog function of the system boot is enabled based on the preset boot whitelist and the obtained boot parameters.

[0130] Optionally, the startup parameter types in the startup parameter acquisition module 402 include startup medium slot information, startup medium, and startup path.

[0131] Optionally, the watchdog function control module 403 includes:

[0132] The comparison module is used to compare the obtained startup parameters with the whitelist startup parameters under the corresponding startup parameter type in the preset startup whitelist, and obtain the comparison results;

[0133] The watchdog function control submodule is used to enable the watchdog function of the system boot process when the boot parameters for each type of boot parameter obtained by the comparison results include the target boot parameters that exist in the preset boot whitelist.

[0134] Optionally, the startup parameter acquisition module 402 includes:

[0135] The first enumeration module is used to enumerate the PCIe device during the driver execution environment stage and obtain the enumeration result when the startup parameter type is startup media slot information.

[0136] The first device path determination module is used to generate the device path of the PCIe device based on the PCIe devices in the enumeration result;

[0137] The boot media slot information determination module is used to determine the boot media slot information of the PCIe device based on the device path of the PCIe device.

[0138] Optionally, the startup parameter acquisition module 402 includes:

[0139] The second enumeration module is used to enumerate PCIe devices during the driver execution environment stage and obtain enumeration results when the startup parameter type is startup medium.

[0140] The second device path determination module is used to generate the device path of the PCIe device based on the PCIe devices in the enumeration result.

[0141] The ID determination module is used to access the PCIe device through the device path of the PCIe device during the device selection phase and read the class ID in the configuration space of the PCIe device.

[0142] The boot media determination module is used to determine the boot media of the PCIe device based on the class id in the configuration space of the PCIe device.

[0143] Optionally, the startup parameter acquisition module 402 includes:

[0144] The storage path determination module is used to obtain the storage path where the startup item file is located by searching various storage paths when the startup parameter type is startup path;

[0145] The startup path determination module is used to determine the storage path where the startup item file is located as the startup path.

[0146] Optionally, the system 400 further includes:

[0147] The preset boot whitelist setting module is used to set the pre-built preset boot whitelist as the default whitelist in the BIOS; or, to configure the pre-built preset boot whitelist in the BIOS setup.

[0148] Optionally, the system 400 further includes:

[0149] The preset boot whitelist first update module is used to update the preset boot whitelist when the pre-built preset boot whitelist is configured in the BIOS setup.

[0150] The second update module for the preset boot whitelist is used to configure and save the updated preset boot whitelist through the BIOS setup.

[0151] The preset boot whitelist enabling module is used to enable the updated preset boot whitelist after restarting the BIOS.

[0152] Based on the same inventive concept, in a third aspect of the embodiments of this application, such as Figure 5 As shown, Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of this application. This application provides an electronic device 500, including: a processor 501, a memory 502, and a computer program stored in the memory and running on the processor. When executed by the processor, the computer program implements the steps in the system boot watchdog activation method as described in the first aspect of this application.

[0153] Based on the same inventive concept, in a fourth aspect of the embodiments of this application, this application provides a computer non-volatile readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps in the system boot watchdog activation method described in the first aspect of this application.

[0154] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer non-volatile readable storage medium or transmitted from one computer non-volatile readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer non-volatile readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks (SSDs)).

[0155] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0156] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0157] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A method for activating a system boot watchdog timer, characterized in that, Applied to BIOS, the method includes: At startup, load the preset startup whitelist; Before initiating the system boot process, obtain each boot parameter corresponding to the boot parameter type in the preset boot whitelist; The obtained startup parameters are compared with the whitelist startup parameters under the corresponding startup parameter type in the preset startup whitelist to obtain the comparison results; If, under each type of startup parameter included in the preset startup whitelist, the comparison results indicate that there is a target startup parameter that is the same as the startup parameter in the whitelist, then the watchdog function of the system boot is enabled. The startup parameter types include at least one of startup medium slot information, startup medium, and startup path.

2. The method for activating the system boot watchdog according to claim 1, characterized in that, When the boot parameter type is boot media slot information, the step of obtaining each boot parameter corresponding to the boot parameter type in the preset boot whitelist before booting the system includes: During the driver execution environment phase, PCIe devices are enumerated to obtain the enumeration results; Based on the PCIe devices in the enumeration results, generate the device path of the PCIe device; Based on the device path of the PCIe device, determine the boot media slot information of the PCIe device.

3. The method for activating the system boot watchdog according to claim 1, characterized in that, When the boot parameter type is boot media, the step of obtaining each boot parameter corresponding to the boot parameter type in the preset boot whitelist before booting the system includes: During the driver execution environment phase, PCIe devices are enumerated to obtain the enumeration results; Based on the PCIe devices in the enumeration results, generate the device path of the PCIe device; During the device selection phase, the PCIe device is accessed through its device path, and the class id in the PCIe device's configuration space is read. The boot medium of the PCIe device is determined based on the class id in the configuration space of the PCIe device.

4. The method for activating the system boot watchdog according to claim 1, characterized in that, When the boot parameter type is boot path, the step of obtaining each boot parameter corresponding to the boot parameter type in the preset boot whitelist before starting the system boot includes: By searching through various storage paths, the storage path where the startup file is located can be obtained; The storage path where the startup item file is located is determined as the startup path.

5. The method for activating the system boot watchdog according to claim 1, characterized in that, Before loading the preset startup whitelist at startup, the method further includes: The pre-built preset boot whitelist is set as the default whitelist within the BIOS; Alternatively, the pre-built default boot whitelist can be configured into the BIOS setup.

6. The method for activating the system boot watchdog according to claim 1, characterized in that, When configuring the pre-built preset boot whitelist into the BIOS setup, the method further includes: Update the preset startup whitelist; Configure and save the updated default boot whitelist through BIOS setup; After restarting the BIOS, enable the updated default boot whitelist.

7. A system for opening a watchdog timer, characterized in that, The system includes: The preset startup whitelist acquisition module is used to load the preset startup whitelist at startup; The startup parameter acquisition module is used to acquire each startup parameter corresponding to the startup parameter type in the preset startup whitelist before starting the system boot process; The watchdog function control module is used to compare the obtained startup parameters with the whitelist startup parameters of the corresponding startup parameter type in the preset startup whitelist, and obtain the comparison result; if the comparison result indicates that there is a target startup parameter in the startup parameters of each startup parameter type included in the preset startup whitelist that is the same as the whitelist startup parameter, the watchdog function of the system boot is enabled. The startup parameter types include at least one of startup medium slot information, startup medium, and startup path.

8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and running on the processor, wherein the computer program, when executed by the processor, implements the steps of the system boot watchdog activation method as described in any one of claims 1 to 6.

9. A computer non-volatile readable storage medium, characterized in that, The computer non-volatile readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the system boot watchdog activation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Equipment enumeration method and device, computer equipment and storage medium

    CN114817105A

  • Monitoring method and system for preventing startup jamming, electronic equipment and medium

    CN116010211A