Log output method and apparatus based on system startup, and product and medium

By sending an out-of-band query command to the control platform before the server boots up to obtain the log switch status, and dynamically controlling the log switch status, the problems of frequent modification of boot system code and accidental restarts are solved, and the efficiency and accuracy of log output are improved.

WO2026046197A1PCT designated stage Publication Date: 2026-03-05INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/117060
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-27
Filing Date
2025-08-26
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

In existing technologies, frequent modifications to the boot system code and accidental restarts of the control platform lead to cumbersome operations and increased restart time.

Method used

Before the server is powered on, a query command is sent to the control platform out of band to obtain the log switch status. Based on the parameters returned by the pre-agreed command, the modification option type is determined, and the log switch status is dynamically controlled to avoid frequent modification of the boot system code.

Benefits of technology

It reduces the number and time of restarts due to misoperation, improves the efficiency and accuracy of log output, realizes the flexibility and diversity of log output, and ensures the correctness and stability of the program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025117060_05032026_PF_FP_ABST
    Figure CN2025117060_05032026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of servers. Disclosed are a log output method and apparatus based on system startup, and a product and a medium. During log output corresponding to a system startup stage, before a server is powered on, specifications for in-band instructions of a control platform and a boot system are primarily specified, such that during system startup, the enable state of a log can be modified at any time by means of out-of-band sending without the need for an operation of modifying codes of the boot system by means of a conventional in-band interaction mode for the control platform and the boot system; thus, cumbersome operations for the code modification of the boot system are bypassed, there is no need to replace the version, and dynamic output of the log is completed. A second query instruction is added to provide control based on modification option types of the log, and an option parameter of a conventional configuration page or operating system and command modification of the control platform are distinguished, and the number of operations for restarting the server and a restart time are reduced when the misoperation is a modification operation of the control platform, thereby improving the efficiency of log output.
Need to check novelty before this filing date? Find Prior Art

Description

A method, product, device, and medium for logging system startup.

[0001] Cross-reference to related applications

[0002] This application claims priority to Chinese Patent Application No. 202411180490.8, filed on August 27, 2024, entitled "A method, product, apparatus and medium for logging output based on system startup", the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of server technology, and in particular to a method, product, apparatus, and medium for logging system startup. Background Technology

[0004] Application Boot Loader (ABL) logs are records of information during the system startup process, which are crucial for developers when debugging issues during startup, hardware initialization, or operating system loading.

[0005] During system startup, the in-band interaction between the boot system and the control platform prevents the ABL log switch from being turned on or off. This necessitates frequent modifications to the boot system code, making the process cumbersome. Furthermore, while ABL log output can be controlled via configuration pages or operating system options, it cannot effectively distinguish between changes made to control platform commands. These changes are mistakenly interpreted as modifications by the control platform, leading to a server restart and additional restart time.

[0006] Therefore, the relevant technologies suffer from technical problems such as cumbersome operations caused by frequent modifications to the boot system code and additional restart time due to accidental restarts of the control platform. Summary of the Invention

[0007] This application provides a method, product, device, and medium for logging system startup, in order to solve the problems of cumbersome operations caused by frequent modifications to the boot system code and the additional restart time caused by accidental restarts of the control platform.

[0008] To address the aforementioned technical problems, according to a first aspect of the embodiments of this application, this application provides a log output method based on system startup, comprising:

[0009] Before the server is powered on, a first query command is sent out-of-band to the control platform to obtain the log on / off status; wherein, the command conventions for log on / off are agreed upon in advance for the control platform and the boot system, and the command conventions include at least the return parameter conventions for the first query command and the second query command respectively;

[0010] When the log switch is off and the server is powered on, the boot system sends a second query command to obtain the modification option type for the log switch status; the modification option type includes at least control platform modification option, interface modification option, and operating system modification option;

[0011] Enable or disable logging based on the determined modification option type to output logs.

[0012] In some embodiments, pre-defined instructions for logging on / off are provided to the control platform and boot system, including:

[0013] The first return parameter corresponds to the status identifier of the log switch status of the first query command; wherein, the first return parameter occupies one byte;

[0014] The second return parameter is defined as the switch status of the log for the second query command; wherein, the second return parameter is used to represent the modification option type identifier; the second return parameter occupies at least two bytes; the interface modification option type identifier and the operating system modification option type identifier share one byte; the control platform modification option type identifier occupies one byte.

[0015] In some embodiments, sending a first query command out-of-band to the control platform to obtain the log's on / off status includes:

[0016] Send the first query command out-of-band to the control platform;

[0017] Obtain the first return parameter corresponding to the first query instruction; wherein, the first return parameter of the first query instruction is used as a status identifier to represent the switch status of the log;

[0018] The log's on / off status is determined based on the first returned parameter.

[0019] In some embodiments, determining the log's on / off state based on a first returned parameter includes:

[0020] If the first return parameter is 0, the log switch status is determined to be off.

[0021] If the first return parameter is 1, the log switch status is determined to be on; where the first return parameter is binary data.

[0022] In some embodiments, after determining that the log switch state is off, the method further includes:

[0023] Send a log enable command out of band to the control platform and store the log enable command in the corresponding storage space of the control platform. The log enable command is used to enable the log switch status.

[0024] In some embodiments, the boot system sends a second query command to obtain the modification option type of the log's switch status, including:

[0025] During the driver execution environment phase of server startup, the boot system sends a second query command to the storage space corresponding to the control platform.

[0026] Retrieve the second return parameter corresponding to the second query command;

[0027] The modification option type is determined based on the modification option type identifier corresponding to the second returned parameter.

[0028] In some embodiments, determining the modification option type based on the modification option type identifier corresponding to the second returned parameter includes:

[0029] Determine whether the second returned parameter is a control platform modification option type identifier;

[0030] If the second returned parameter is the control platform modification option type identifier, then the modification option type is determined to be the control platform modification option type.

[0031] If the second returned parameter is not the control platform modification option type identifier, the method of parsing the second returned parameter is used to determine whether the modification option type is the interface modification option type identifier.

[0032] In some embodiments, determining whether the modification option type is an interface modification option type identifier by parsing the second returned parameter includes:

[0033] The second returned parameter is parsed and processed;

[0034] If the parsing shows that the modification option type is an interface modification option type identifier, then the modification option type is determined to be an interface modification option type.

[0035] If the parsed option type is not the interface option type identifier, then the option type is determined to be the operating system option type.

[0036] In some embodiments, determining whether the second returned parameter is a control platform modification option type identifier includes:

[0037] Determine whether the second returned parameter contains an indicator of the on / off status of the intelligent platform management interface command setting log;

[0038] If the second return parameter does not contain an identifier indicating the on / off status of the intelligent platform management interface command setting log, then the second return parameter is determined not to be an identifier for the control platform modification option type.

[0039] If the second return parameter contains an identifier indicating the on / off status of the intelligent platform management interface command setting log, then the second return parameter is determined to be an identifier for the control platform modification option type.

[0040] In some embodiments, the logging on / off state is enabled or disabled based on the interface modification option type or the operating system modification option type to output logs, including:

[0041] Skip the execution corresponding to the interface modification option type or the operating system modification option type;

[0042] The current modification option type of the page configuration corresponding to the control boot system enables the log switch status to output logs; where the current modification option type is the log switch enable modification option, the interface modification option type, or the operating system modification option type.

[0043] In some embodiments, the control platform modifies the option type to enable or disable the log to output logs, including:

[0044] Call the programming interface to overwrite the control platform modification option type corresponding to the second query instruction in the storage space corresponding to the control platform;

[0045] The control platform corresponding to the overwritten second query command is updated with the option type modified for execution.

[0046] Upon successful execution, the log will be modified by selecting the option type in the interface or the corresponding option type in the operating system to output the log.

[0047] In some embodiments, the memory where the storage space corresponding to the control platform is located is a non-volatile memory.

[0048] In some embodiments, during the driver execution environment phase of server startup, the boot system sends a second query instruction to the storage space corresponding to the control platform, including:

[0049] The system sends a second query instruction out of band to the control platform so that the control platform can receive the second query instruction; and stores the second query instruction in the corresponding storage space of the control platform; and the boot system sends the second query instruction to the corresponding storage space of the control platform.

[0050] In some embodiments, after the boot system sends a second query instruction to the storage space corresponding to the control platform, the method further includes:

[0051] The second return parameter in the storage space corresponding to the control platform is stored in the first variable used for debugging the program.

[0052] In some embodiments, after enabling the log switch state according to the determined modification option type, before outputting the log, the method further includes:

[0053] Call the peripheral bus communication protocol to obtain the current log switch status;

[0054] Store the parameters corresponding to the current log switch status into a second variable used for debugging the program;

[0055] Get the on / off status of the log after the operation is enabled;

[0056] If the log switch state after the operation is enabled is consistent with the current log switch state, the control and guidance system calls the first protocol to flush the parameters corresponding to the log switch state to the new first protocol to output the log.

[0057] If the log switch state after the start operation is inconsistent with the current log switch state, the control and guidance system calls the second protocol to overwrite the parameters of the log switch state after the start operation into the second variable; and calls the first protocol to flush the parameters corresponding to the log switch state into the new first protocol to output the log.

[0058] In some embodiments, the instruction convention also includes a third query instruction;

[0059] Pre-defined instructions for logging on / off on the control platform and boot system, including:

[0060] The third return parameter is defined as the clear identifier of the log switch status of the third query command; the third return parameter occupies one byte.

[0061] In some embodiments, after invoking the first protocol to flush the parameters corresponding to the log's on / off state to the new first protocol, and before outputting the log, the method further includes:

[0062] The clear identifier for the switch status of the log is cleared according to the third query command;

[0063] The system restart command is invoked to print the logs.

[0064] To address the aforementioned technical problems, according to a second aspect of the embodiments of this application, this application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of a log output method based on system startup.

[0065] To address the aforementioned technical problems, according to a third aspect of the embodiments of this application, this application also provides a log output device based on system startup, comprising:

[0066] Memory, used to store computer programs;

[0067] A processor is used to implement steps such as a system startup-based log output method when executing computer programs.

[0068] To address the aforementioned technical problems, according to a fourth aspect of the embodiments of this application, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a log output method based on system startup.

[0069] This application provides a log output method based on system startup. Before the server boots up, a first query command is sent out-of-band to the control platform to obtain the log on / off status. The control platform and the boot system are pre-defined with instructions for log on / off, including at least the return parameter conventions for the first and second query commands. When the log is off and the server is booting up, the boot system sends a second query command to obtain the modification option type for the log's on / off status. The modification option type includes at least control platform modification options, interface modification options, and operating system modification options. Based on the determined modification option type, the log is enabled to output the log.

[0070] The beneficial effects of this application lie in the log output during the system startup phase. Primarily, before the server boots up, the agreement on in-band commands between the control platform and the boot system is established. The control platform's log acquisition on / off status is controlled via out-of-band transmission. The log on / off status can be modified at any time during system startup via out-of-band transmission, eliminating the need to modify the boot system's code through traditional in-band control platform-boot system interaction. This application avoids the cumbersome operation of modifying the boot system's code and does not require version changes, achieving dynamic log output. Furthermore, the addition of a second query command to control the log modification option type distinguishes between regular configuration page or operating system option parameters and control platform command modifications, improving the accuracy of modification operations and reducing the number of server restarts and restart time due to accidental control platform modification operations, thus improving log output efficiency.

[0071] Secondly, the instruction convention determination process, combined with IPMI commands used for interaction between the control platform and the boot system, enables dynamic output of the ABL log. Different modification option types enable / disable the log's on / off state to output logs. By effectively distinguishing different modification option types, corresponding update operations are executed, improving the diversity and flexibility of log output. Variable storage, using a dedicated storage mechanism, ensures data integrity and program correctness and stability while preventing data loss, corresponding to problem identification and resolution. The value of the second variable corresponding to successful execution of the underlying code remains consistent with the value of the ABL log's on / off state after the current enabling operation, ensuring ABL log output. This is distinct from the code replacement in the boot system during server startup. Thirdly, the query instruction adds a clear identifier for the option control switch in the ABL log modification settings, ensuring that the next ABL log on / off setting is independent, improving the individuality of the ABL log output.

[0072] In addition, this application also provides a computer program product, a system startup-based log output device, and a medium, which have the same beneficial effects as the above-described system startup-based log output method. Attached Figure Description

[0073] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0074] Figure 1 is a flowchart of a log output method based on system startup provided in an embodiment of this application;

[0075] Figure 2 is a flowchart of another log output method based on system startup provided in an embodiment of this application;

[0076] Figure 3 is a structural diagram of a log output device based on system startup provided in an embodiment of this application;

[0077] Figure 4 is a structural diagram of a log output device based on system startup provided in an embodiment of this application. Detailed Implementation

[0078] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0079] The core of this application is to provide a method, product, device, and medium for logging system startup, in order to solve the problems of cumbersome operations caused by frequent modifications to the boot system code and the additional restart time caused by accidental restarts of the control platform.

[0080] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0081] During the boot process, a microprocessor is loaded to initialize the memory and Central Processing Unit (CPU) hardware interfaces. This reduces the burden on the Unified Extensible Firmware Interface (UEFI) stage and improves processor efficiency. However, faults may occur, and these faults cannot be handled using the debugging methods commonly used in the UEFI stage. Because the port lights on the motherboard are not lit, it is difficult to confirm the current server boot stage from a hardware perspective. Furthermore, the Basic Input Output System (BIOS) and Baseboard Management Controller (BMC) at this stage do not support interaction using the Intelligent Platform Management Interface (IPMI) command. Therefore, during the BIOS boot process, it is impossible to dynamically control BIOS log output by modifying Platform Configuration Database (PCD) values ​​in real time, as is possible in the UEFI stage. IPMI commands can operate across different operating systems, firmware, and hardware platforms, intelligently monitoring, controlling, and automatically reporting the operational status of a large number of servers, thereby reducing server system costs.

[0082] Adding debugging tools during BIOS startup allows for precise location of faults during the system startup phase. The processor has a switch to enable / disable ABL (Advanced Boot Record) log output, which requires BIOS adaptation to the ESPI (Enhanced Serial Peripheral Interface) bus for log output. However, ABL log output can only be modified during the first boot of the BIOS after flashing the firmware. In cases of ABL phase anomalies, and the BIOS fails to boot successfully on the first boot, it's impossible to access the Setup and Operating System (OS) interfaces to modify option types. Therefore, modifying the BIOS code is necessary to capture ABL phase logs. Furthermore, while modifying default option outputs through the Setup and OS interfaces can be done, this triggers feedback via the BMC's IPMI command. The BMC interprets this as a mistake, as IPMI command modifications require a server restart, adding extra restart time. Therefore, the system startup-based log output method provided in this application solves these technical problems.

[0083] Figure 1 is a flowchart of a log output method based on system startup provided in an embodiment of this application. As shown in Figure 1, the method includes:

[0084] S11: Before the server is powered on, send the first query command out of band to the control platform to obtain the log's on / off status;

[0085] Among them, the instruction conventions for logging on and off are pre-defined for the control platform and the boot system, and the instruction conventions include at least the return parameter conventions for the first query instruction and the second query instruction respectively;

[0086] S12: When the log switch status is off and the server is powered on, the boot system sends a second query command to obtain the modification option type for the log switch status;

[0087] Among them, the types of modification options include at least control platform modification options, interface modification options, and operating system modification options;

[0088] S13: Enable the log switch state according to the determined modification option type to output the log.

[0089] In some embodiments, before the server is powered on, a pre-defined instruction agreement is established between the control platform and the boot system for logging on / off. This instruction agreement is used to define the return parameters of IPMI commands, facilitating command interaction during subsequent log output. Unlike conventional command interaction, this application uses out-of-band transmission to send a first query command to the control platform to obtain the logging on / off status.

[0090] In some embodiments, pre-defined instructions for logging on / off are provided to the control platform and boot system, including:

[0091] The first return parameter corresponds to the status identifier of the log switch status of the first query command; wherein, the first return parameter occupies one byte;

[0092] The second return parameter is defined as the switch status of the log for the second query command; wherein, the second return parameter is used to represent the modification option type identifier; the second return parameter occupies at least two bytes; the interface modification option type identifier and the operating system modification option type identifier share one byte; the control platform modification option type identifier occupies one byte.

[0093] Understandably, a control platform can be a server-based software system used to manage, monitor, and maintain servers. A control platform can provide a range of tools and functions to help system administrators or information technology (IT) professionals perform tasks efficiently. It is typically a BMC (Browser Control Center), but other control platforms are also possible.

[0094] The boot system is a crucial part of the startup process, responsible for loading the operating system after the server hardware is powered on or reset. It can be the BIOS, a boot loader, or a boot manager, etc., and is not limited here; it can be configured according to the actual situation.

[0095] In-band and out-of-band transmission are different methods of transmitting data or signals on a communication channel. In-band transmission involves transmitting control information or signals along with normal data traffic on the same communication channel, with the signal sharing the same transmission medium as other data. Out-of-band transmission, on the other hand, sends control information or signals through a separate communication path or channel, allowing the control information to bypass the normal data flow.

[0096] Out-of-band transmission is supported by some network devices that have out-of-band management interfaces, allowing administrators to access the device through a separate channel outside the network (such as a separate physical port or wireless connection). In network security, intrusion detection systems may use out-of-band transmission to immediately notify administrators of potential attacks.

[0097] The control platform and boot system require agreed-upon IPMI commands, including at least a first return parameter corresponding to the status identifier of the log switch for the first query command and a second return parameter corresponding to the status of the log switch for the second query command. The first return parameter occupies one byte and is used to query whether the current ABL log switch is on or off. The second return parameter occupies at least two bytes; one byte indicates how the user modified the ABL log switch, distinguishing between setup and OS-based log switch modifications, and the other byte is used for IPMI commands to modify the ABL log switch's on or off status. The second return parameter also indicates the modification option type.

[0098] The instruction convention determination process provided in this embodiment, combined with the IPMI commands exchanged between the control platform and the boot system, completes the dynamic output of the ABL log.

[0099] In step S11, a first query command is sent out-of-band to the control platform to obtain the log switch status, and the current log switch status is determined by the return parameters of the first query command.

[0100] In some embodiments, sending a first query command out-of-band to the control platform to obtain the log's on / off status includes:

[0101] Send the first query command out-of-band to the control platform;

[0102] Obtain the first return parameter corresponding to the first query instruction; wherein, the first return parameter of the first query instruction is used as a status identifier to represent the switch status of the log;

[0103] The log's on / off status is determined based on the first returned parameter.

[0104] In some embodiments, the first return parameter of the first query instruction represents the status identifier of the log's on / off state. The first return parameter can be represented by binary data. For example, if the first return parameter is 0, it indicates that the ABL log's on / off state is off; if the first return parameter is 1, it indicates that the ABL log's on / off state is on. It should be noted that when the ABL log's on / off state is on, no other operation is required; the serial controller can be directly turned on to collect the ABL log.

[0105] When the log switch is in the off state, after the settings are completed, the server is powered on, and the boot system sends a second query command to obtain the modification option type for the log switch state.

[0106] In some embodiments, the boot system sends a second query command to obtain the modification option type of the log's switch status, including:

[0107] During the driver execution environment phase of server startup, the boot system sends a second query command to the storage space corresponding to the control platform.

[0108] Retrieve the second return parameter corresponding to the second query command;

[0109] The modification option type is determined based on the modification option type identifier corresponding to the second returned parameter.

[0110] In some embodiments, during the Driver Execution Environment (DXE) phase of the UEFI stage, the boot system sends a second query command to retrieve the ABL log switch setting value from the storage space corresponding to the control platform. It should be noted that, based on the DXE stage being the BIOS boot stage, the second query command corresponds to the enable setting of the ABL log switch state.

[0111] The prerequisite for the boot system to send the second query command is that the log switch status is off. The second query command needs to be sent out to the control platform so that the boot system can send the second query command to query during the server boot process.

[0112] In some embodiments, during the driver execution environment phase of server startup, the boot system sends a second query instruction to the storage space corresponding to the control platform, including:

[0113] The system sends a second query instruction out of band to the control platform so that the control platform can receive the second query instruction; and stores the second query instruction in the corresponding storage space of the control platform; and the boot system sends the second query instruction to the corresponding storage space of the control platform.

[0114] In some embodiments, in conjunction with the above embodiments, the control platform is a BMC and the boot system is a BIOS. When the first return parameter is 0, it indicates that the ABL log is in the off state. Then, an out-of-band command to turn on the ABL log is sent to the BMC using an IPMI command. After receiving the command, the BMC stores it in the corresponding storage space so that the BIOS can query it during the server boot process. This eliminates the need to change the BIOS version for debugging during the ABL stage, improving the efficiency of BIOS debugging.

[0115] The modification option type is determined based on the modification option type identifier corresponding to the second return parameter. In conjunction with the above embodiments, the second return parameter occupies at least two bytes. One byte is used to identify how the user modifies the ABL log switch, in order to distinguish between the operation of modifying the log switch under Setup and OS. The other byte is used for IPMI command to modify the opening and closing of the ABL log switch.

[0116] In some embodiments, determining the modification option type based on the modification option type identifier corresponding to the second returned parameter includes:

[0117] Determine whether the second returned parameter is a control platform modification option type identifier;

[0118] If the second returned parameter is the control platform modification option type identifier, then the modification option type is determined to be the control platform modification option type.

[0119] If the second returned parameter is not the control platform modification option type identifier, the modification option type is determined to be the interface modification option type identifier by parsing the second returned parameter.

[0120] If the parsing shows that the modification option type is an interface modification option type identifier, then the modification option type is determined to be an interface modification option type.

[0121] If the parsed option type is not the interface option type identifier, then the option type is determined to be the operating system option type.

[0122] In some embodiments, a priority setting can be used to first determine if it is a control platform modification option type identifier. If it is, then it is determined to be a control platform modification option type. If it is not, the second return parameter is parsed to determine if it is an interface modification option type identifier. If the second return parameter does not contain an identifier for setting the IPMI ABL log switch, it indicates that it is not a control platform modification option type identifier. If the second return parameter contains an identifier for setting the IPMI ABL log switch, it indicates that it is a modification option type corresponding to Setup or OS, and the byte identifier for this type needs to be determined.

[0123] In this embodiment, the enable flag of the second return parameter effectively distinguishes between three types: control platform modification option type, interface modification option type flag, and operating system modification option type, making the code logic more rigorous and improving the usability and rigor of the product.

[0124] In step S13, the log switch status is turned on according to the determined modification option type to output the log.

[0125] In some embodiments, the logging on / off state is enabled or disabled based on the interface modification option type or the operating system modification option type to output logs, including:

[0126] Skip the execution corresponding to the interface modification option type or the operating system modification option type;

[0127] The current modification option type of the page configuration corresponding to the control boot system enables the log switch status to output logs; where the current modification option type is the log switch enable modification option, the interface modification option type, or the operating system modification option type.

[0128] In some embodiments, if the IPMI setting for the ABL logging switch is not specified in the second return parameter, it is skipped, and the current modification option type of the page configuration corresponding to the boot system is used to enable the logging switch to output logs. When the boot system is BIOS, the BIOS will execute according to its own settings, such as disabling the ABL logging switch, enabling the ABL logging switch in Setup, or enabling the ABL logging switch in the OS.

[0129] In other embodiments, the log on / off state is enabled or disabled based on the option type modified by the control platform to output logs, including:

[0130] Call the programming interface to overwrite the control platform modification option type corresponding to the second query instruction in the storage space corresponding to the control platform;

[0131] The control platform corresponding to the overwritten second query command is updated with the option type modified for execution.

[0132] Upon successful execution, the log will be modified by selecting the option type in the interface or the corresponding option type in the operating system to output the log.

[0133] In some embodiments, when the second return parameter is the identifier for setting the ABL log switch in IPMI, and the boot system is BIOS, it is necessary to call the programming interface to overwrite the control platform modification option type corresponding to the second query instruction in the storage space corresponding to the control platform. The programming interface is the SetVariable function, which is typically a programming interface used to set the value of a variable. In a UEFI (Unified Extensible Firmware Interface) environment, the UEFI Shell environment provides a SetVariable command for setting or modifying UEFI variables. These variables can be used to store various data, such as boot configurations and security credentials.

[0134] The modification of the ABL logging option in Setup is considered successful only if the SetVariable function executes successfully, which means the modification in the OS is successful, and therefore, the log will be output. If execution fails, the BIOS will skip the remaining code and exit.

[0135] For example: The BIOS calls SetVariable to write the ABL log switch setting value in the BMC into the Setup option:

[0136] This embodiment provides different modification option types to enable or disable the log output, effectively distinguishing different modification option types and performing corresponding update operations to improve the diversity and flexibility of log output.

[0137] In some embodiments, the memory where the storage space corresponding to the control platform is located is a non-volatile memory.

[0138] Understandably, by using non-volatile memory to store data, the dynamic output of the ABL log is achieved, eliminating the need to change versions of the BIOS for debugging during the ABL stage. The non-volatile memory here can be electrically erasable programmable read-only memory (EEPROM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), etc., and is not limited here.

[0139] In some embodiments, the BIOS obtains the ABL log switch setting value from the BMC EEPROM via IPMI commands:

[0140] In some embodiments, after the boot system sends a second query instruction to the storage space corresponding to the control platform, the method further includes:

[0141] The second return parameter in the storage space corresponding to the control platform is stored in the first variable used for debugging the program.

[0142] Understandably, the first variable (e.g., the IpmiAblDebug variable) is used to debug the program. It corresponds to the debugging information or debugging mode of the IPMI bootloader, and the value of the ABL log switch setting is stored in this first variable.

[0143] The variable storage provided in this embodiment uses a proprietary storage mechanism to ensure that data is not easily lost, while also ensuring the correctness and stability of the program in relation to identifying and resolving problems.

[0144] This application provides a log output method based on system startup. Before the server boots up, a first query command is sent out-of-band to the control platform to obtain the log's on / off status. The control platform and the boot system pre-define the log on / off command conventions, which include at least the return parameter conventions for the first and second query commands. When the log is off and the server is booting up, the boot system sends a second query command to obtain the modification option type for the log's on / off status. The modification option type includes at least control platform modification options, interface modification options, and operating system modification options. Based on the determined modification option type, the log's on / off status is enabled to output the log. Log output during the system startup phase primarily involves defining the in-band commands of the control platform and boot system before server boot. The log on / off status is obtained from the control platform via out-of-band transmission. This allows for modification of the log's on / off status at any time during system startup via out-of-band transmission, eliminating the need to modify the boot system's code through traditional in-band control platform and boot system interaction. This application avoids the cumbersome operation of modifying the boot system's code and does not require version changes, thus achieving dynamic log output. In addition, a second query command is added to control the log modification option type, distinguishing between regular configuration page or operating system option parameters and control platform command modifications. This improves the accuracy of modification operations, reduces the number of server restarts and restart time due to accidental control platform modification operations, and improves log output efficiency.

[0145] In some embodiments, after enabling the log switch state according to the determined modification option type, before outputting the log, the method further includes:

[0146] Call the peripheral bus communication protocol to obtain the current log switch status;

[0147] Store the parameters corresponding to the current log switch status into a second variable used for debugging the program;

[0148] Get the on / off status of the log after the operation is enabled;

[0149] If the log switch state after the operation is enabled is consistent with the current log switch state, the control and guidance system calls the first protocol to flush the parameters corresponding to the log switch state to the new first protocol to output the log.

[0150] If the log switch state after the start operation is inconsistent with the current log switch state, the control and guidance system calls the second protocol to overwrite the parameters of the log switch state after the start operation into the second variable; and calls the first protocol to flush the parameters corresponding to the log switch state into the new first protocol to output the log.

[0151] Understandably, after the DXE stage, the execution of the underlying code requires successful execution within the options enabled by AMD, and the on / off state value of the log corresponding to the peripheral bus communication protocol must be written into the Serial Peripheral Interface Flash (SPI flash). Therefore, it is also necessary to check the on / off state of the current log corresponding to the called peripheral bus communication protocol, that is, the actual stored on / off state of the current log. Before comparison, the on / off state of this current log is stored in a second variable (e.g., the OrgAblDebug variable). The peripheral bus communication protocol is not limited and can be set according to the actual situation. It can be a bus protocol used to connect a microcontroller or other processor with peripheral devices, or it can be other protocols.

[0152] The second variable is based on debugging information or debug mode settings related to the original application bootloader. It can be the OrgAblDebug variable or other variables.

[0153] It determines whether the log switch state after the start operation is consistent with the current log switch state. If the log switch state after the start operation is consistent with the current log switch state, it guides the system to call the first protocol to write the parameters corresponding to the log switch state to the new first protocol to output the log. The first protocol here is mainly the write protocol. The write protocol can be the SPI flash write protocol or other write protocols, without limitation.

[0154] If the log's on / off state after the operation is enabled is inconsistent with the current log's on / off state, the control and guidance system calls the second protocol to overwrite the parameters of the log's on / off state after the operation into the second variable. This overwriting method must be used to maintain consistency. Then, the first protocol is called to flush the parameters corresponding to the log's on / off state into the new first protocol for log output.

[0155] For example, when OrgAblDebug is inconsistent with the modified default value of the ABL log switch, the modified default value of the ABL log switch will be overwritten into the peripheral bus communication protocol.

[0156] if(AmdCbsConfig.CbsCmnSocAblConOut!=OrgAblDebug){

[0157] ...

[0158] }

[0159] The value stored in the second variable corresponding to the successful execution of the underlying code in this embodiment is consistent with the value of the switch state of the ABL log after the current start operation, ensuring the output of the ABL log. This is different from the code replacement of the corresponding boot system during the server startup process.

[0160] In some embodiments, the instruction convention also includes a third query instruction;

[0161] Pre-defined instructions for logging on / off on the control platform and boot system, including:

[0162] The third return parameter is defined as the clear identifier of the log switch status of the third query command; the third return parameter occupies one byte.

[0163] Understandably, the instruction convention also includes a third query instruction, which is used to clear the identifier to prevent excessive storage space consumption and to prepare for timely clearing corresponding to the next setting of the ABL log switch. This third query instruction occupies one byte and clears the ABL log switch identifier.

[0164] In some embodiments, after invoking the first protocol to flush the parameters corresponding to the log's on / off state to the new first protocol, and before outputting the log, the method further includes:

[0165] The clear identifier for the switch status of the log is cleared according to the third query command;

[0166] The system restart command is invoked to print the logs.

[0167] In some embodiments, taking the boot system BIOS as an example, the BIOS will directly call the SPI flash write protocol to refresh the value to the SPI flash. After that, we need to call the IPMI command to clear the ABL log switch identifier in the BMC EEPROM to prepare for the next setting of the ABL log switch. Then, the system restart command is called to print the ABL log out through the serial controller.

[0168] For example: Use the IPMI command to clear the ABL log switch identifier in the BMC EEPROM:

[0169] The third query command provided in this embodiment adds a clear identifier for the option control switch when modifying the ABL log switch settings, ensuring that the switch settings for the ABL log are not associated in the next setting, thereby improving the individuality of the ABL output log.

[0170] Figure 2 is a flowchart of another log output method based on system startup provided in an embodiment of this application. As shown in Figure 2, it includes:

[0171] S21: The boot system and control platform jointly agree on intelligent platform management interface commands;

[0172] S22: Use the intelligent platform management interface query command to confirm the current log switch status;

[0173] S23: Determine whether the return value of the log switch is 0. If the return value of the log switch is 0, proceed to step S24. If the return value of the log switch is not 0, proceed to step S25.

[0174] S24: Continue executing the command to enable the log switch;

[0175] S25: Directly open the serial controller to collect logs;

[0176] S26: Guide the system to obtain the setting value of the log switch in the storage space corresponding to the control platform;

[0177] S27: Determine whether the return value contains a log switch identifier set by the intelligent platform management interface; if the return value contains a log switch identifier set by the intelligent platform management interface, proceed to step S28; if the return value does not contain a log switch identifier set by the intelligent platform management interface, proceed to step S29.

[0178] S28: The system will overwrite the value set in the intelligent platform management interface in the log switch option;

[0179] S29: Exit execution and guide the system to execute according to your settings;

[0180] S30: Determine whether the log switch option setting is successful; if the log switch option setting is successful, proceed to step S31; if the log switch option setting is unsuccessful, proceed to step S32.

[0181] S31: Obtain the default value of the log switch in the peripheral bus communication protocol and store it in the second variable;

[0182] S32: Exit execution;

[0183] S33: Determine whether the default value in the second variable is consistent with the default value of the modified log switch; if the default value in the second variable is not consistent with the default value of the modified log switch, proceed to step S34; if the default value in the second variable is consistent with the default value of the modified log switch, proceed to step S35.

[0184] S34: Overwrite the second variable with the modified default value of the log switch;

[0185] S35: Refresh the serial peripheral interface flash memory and clear the setting log switch identifier;

[0186] S36: Enable serial controller log collection.

[0187] In step S35, the serial controller (Serial Over LAN, Sol) can redirect data from the local asynchronous serial controller interface to the remote end.

[0188] The foregoing has described in detail various embodiments of the log output method based on system startup. Based on this, this application also discloses a log output device based on system startup corresponding to the above method. Figure 3 is a structural diagram of a log output device based on system startup provided in an embodiment of this application. As shown in Figure 3, the device includes:

[0189] The first acquisition module 11 is configured to send a first query command out-of-band to the control platform to obtain the log on / off status before the server is powered on; wherein, the command agreement for log on / off is agreed upon in advance between the control platform and the boot system, and the command agreement includes at least the return parameter agreement for the first query command and the second query command respectively;

[0190] The second acquisition module 12 is configured to send a second query command to acquire the modification option type of the log switch state when the log switch state is off and the server is powered on; wherein, the modification option type includes at least control platform modification option, interface modification option and operating system modification option;

[0191] The operation module 13 is set to enable or disable the log based on the determined modification option type in order to output logs.

[0192] Since the embodiments of the device part correspond to the embodiments described above, please refer to the embodiments of the method part for the description of the device part, and will not be repeated here.

[0193] For a description of the system startup-based log output device provided in this application, please refer to the above method embodiments. This application will not repeat the description here, as it has the same beneficial effects as the above system startup-based log output method.

[0194] Figure 4 is a structural diagram of a log output device based on system startup provided in an embodiment of this application. As shown in Figure 4, the device includes:

[0195] Memory 21 is configured to store computer programs;

[0196] Processor 22 is configured to implement a log output method based on system startup when executing computer programs.

[0197] The processor 22 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 22 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is configured to process data in the wake-up state; the coprocessor is a low-power processor configured to process data in the standby state. In some embodiments, the processor 22 may integrate a Graphics Processing Unit (GPU), which is configured to render and draw the content required to be displayed on the screen. In some embodiments, the processor 22 may also include an Artificial Intelligence (AI) processor, which is configured to handle computational operations related to machine learning.

[0198] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 21 is at least configured to store the following computer program 211, which, after being loaded and executed by the processor 22, is capable of implementing the relevant steps of the system startup-based log output method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. The operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include, but is not limited to, the data involved in the system startup-based log output method, etc.

[0199] In some embodiments, the log output device based on system startup may further include a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27.

[0200] Those skilled in the art will understand that the structure shown in Figure 4 does not constitute a limitation on a system startup-based log output device and may include more or fewer components than shown.

[0201] The processor 22 implements the system startup-based log output method provided in any of the above embodiments by calling instructions stored in the memory 21.

[0202] For a description of the system startup-based log output device provided in this application, please refer to the above method embodiments. This application will not repeat the description here, as it has the same beneficial effects as the above system startup-based log output method.

[0203] In some embodiments, this application also provides a computer-readable storage medium storing a computer program that, when executed by processor 22, implements the steps of the log output method based on system startup as described above.

[0204] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0205] For a description of the computer-readable storage medium provided in this application, please refer to the above method embodiments. This application will not repeat the description here, but it has the same beneficial effects as the above-described log output method based on system startup.

[0206] In some embodiments, this application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of a log output method based on system startup.

[0207] For an introduction to the computer program product provided in this application, please refer to the above method embodiments. This application will not repeat the details here, but it has the same beneficial effects as the above-described log output method based on system startup.

[0208] The foregoing has provided a detailed description of a system startup-based log output method, product, apparatus, and medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

[0209] It should also be noted that, in this specification, 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 the element.

Claims

1. A log output method based on system startup, characterized in that, include: Before the server is powered on, a first query command is sent out-of-band to the control platform to obtain the log on / off status; wherein, the command agreement for log on / off is agreed upon in advance for the control platform and the boot system, and the command agreement includes at least the return parameter agreement for the first query command and the second query command respectively; When the log is in the off state and the server is powered on, the boot system sends the second query command to obtain the modification option type of the log's on / off state; wherein, the modification option type includes at least control platform modification option, interface modification option, and operating system modification option; The log is turned on or off according to the determined modification option type to output the log.

2. The log output method based on system startup according to claim 1, characterized in that, The pre-defined instructions for enabling / disabling logs on the control platform and boot system include: The first return parameter is defined as the status identifier of the switch status of the log in the first query instruction; wherein the first return parameter occupies one byte. The second return parameter is defined as the switch status of the log in the second query instruction; wherein, the second return parameter is used to represent the modification option type identifier; the second return parameter occupies at least two bytes; the interface modification option type identifier and the operating system modification option type identifier share one byte; the control platform modification option type identifier occupies one byte.

3. The log output method based on system startup according to claim 2, characterized in that, Sending the first query command out-of-band to the control platform to obtain the log's on / off status includes: Send the first query command out-of-band to the control platform; Obtain the first return parameter corresponding to the first query instruction; wherein, the first return parameter of the first query instruction is used as a status identifier representing the switch status of the log; The on / off status of the log is determined based on the first returned parameter.

4. The log output method based on system startup according to claim 3, characterized in that, Determining the log's on / off state based on the first returned parameter includes: If the first return parameter is 0, the switch status of the log is determined to be off. If the first return parameter is 1, the switch state of the log is determined to be on; wherein, the first return parameter is binary data.

5. The log output method based on system startup according to claim 4, characterized in that, After determining that the log's switch state is off, the method further includes: A log enable command is sent out-of-band to the control platform, and the log enable command is stored in the storage space corresponding to the control platform. The log enable command is used to enable the log switch status.

6. The log output method based on system startup according to claim 2, characterized in that, The modification option types for obtaining the switch status of the log by sending the second query command from the boot system include: During the driver execution environment phase of server startup, the boot system sends the second query instruction to the storage space corresponding to the control platform; Obtain the second return parameter corresponding to the second query instruction; The modification option type is determined based on the modification option type identifier corresponding to the second returned parameter.

7. The log output method based on system startup according to claim 6, characterized in that, The step of determining the modification option type based on the modification option type identifier corresponding to the second returned parameter includes: Determine whether the second returned parameter is the control platform modification option type identifier; If the second returned parameter is the control platform modification option type identifier, then the modification option type is determined to be the control platform modification option type; If the second returned parameter is not the control platform modification option type identifier, the modification option type is determined to be the interface modification option type identifier by parsing the second returned parameter.

8. The log output method based on system startup according to claim 7, characterized in that, The step of determining whether the modification option type is an interface modification option type identifier by parsing the second returned parameter includes: The second returned parameter is parsed and processed; If the type of the modification option is determined to be the interface modification option type identifier, then the type of the modification option is determined to be the interface modification option type. If the parsed modification option type is not the interface modification option type identifier, then the modification option type is determined to be the operating system modification option type.

9. The log output method based on system startup according to claim 7, characterized in that, The step of determining whether the second returned parameter is a control platform modification option type identifier includes: Determine whether the second returned parameter contains an identifier indicating the on / off status of the log set by the intelligent platform management interface command; If the second return parameter does not contain an identifier indicating the on / off status of the log set by the intelligent platform management interface command, then it is determined that the second return parameter is not an identifier for the control platform modification option type. If the second return parameter contains an identifier indicating the on / off state of the log set by the intelligent platform management interface command, then the second return parameter is determined to be an identifier of the control platform modification option type.

10. The log output method based on system startup according to claim 6, characterized in that, The log switch status is enabled or disabled based on the interface or operating system's option type to output logs, including: Skip the execution corresponding to the interface modification option type or the operating system modification option type; The current modification option type of the page configuration corresponding to the boot system is controlled to enable the log switch state to output logs; wherein, the current modification option type is the log switch enable modification option, the interface modification option type, or the operating system modification option type.

11. The log output method based on system startup according to claim 6, characterized in that, The control platform modifies the option type to enable or disable the log feed, and then outputs the logs, including: The programming interface is invoked to overwrite the control platform modification option type corresponding to the second query instruction in the storage space corresponding to the control platform; The control platform will update the option type corresponding to the overwritten second query instruction for execution; Upon successful execution, modify the log by changing the option type in the interface or the corresponding option type in the operating system to output the log.

12. The log output method based on system startup according to claim 10 or 11, characterized in that, The memory containing the storage space corresponding to the control platform is a non-volatile memory.

13. The log output method based on system startup according to claim 6, characterized in that, The step of sending the second query instruction to the storage space corresponding to the control platform by the boot system during the driver execution environment phase of server startup includes: The second query instruction is sent out-of-band to the control platform so that the control platform can receive the second query instruction; the second query instruction is stored in the storage space corresponding to the control platform; and the guidance system sends the second query instruction to the storage space corresponding to the control platform.

14. The log output method based on system startup according to claim 13, characterized in that, After the guidance system sends the second query instruction to the storage space corresponding to the control platform, the process further includes: The second return parameter in the storage space corresponding to the control platform is stored in the first variable used for debugging the program.

15. The log output method based on system startup according to claim 1, characterized in that, After enabling the log switch state according to the determined modification option type, before outputting the log, the following steps are also included: Call the peripheral bus communication protocol to obtain the current log switch status; Store the parameters corresponding to the current log's on / off state into a second variable used for debugging the program; Obtain the on / off status of the log after the start operation; If the switch state of the log after the start operation is consistent with the switch state of the current log, the system is controlled to call the first protocol to write the parameters corresponding to the switch state of the log to the new first protocol to output the log. If the switch state of the log after the start operation is inconsistent with the switch state of the current log, the system is controlled to call the second protocol to overwrite the parameters of the switch state of the log after the start operation into the second variable; and the first protocol is called to flush the parameters corresponding to the switch state of the log into the new first protocol to output the log.

16. The log output method based on system startup according to claim 15, characterized in that, The instruction convention also includes a third query instruction; The pre-defined instructions for enabling / disabling logs on the control platform and boot system include: The third return parameter is defined as the clear identifier of the log's on / off state in the third query instruction; wherein the third return parameter occupies one byte.

17. The log output method based on system startup according to claim 16, characterized in that, After invoking the first protocol to flush the parameters corresponding to the switch state of the log to the new first protocol, and before outputting the log, the method further includes: The clear identifier of the log's switch status is cleared according to the third query instruction; The system restart command is invoked to print the log.

18. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the log output method based on system startup as described in any one of claims 1 to 17.

19. A log output device based on system startup, characterized in that, include: The memory is configured to store computer programs; The processor is configured to implement the steps of the system startup-based log output method as described in any one of claims 1 to 17 when executing the computer program.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the log output method based on system startup as described in any one of claims 1 to 17.

Citation Information

Patent Citations

  • Remote out-of-band SSD log information query method and device and BMC

    CN111176967A

  • Fault diagnosis method and device, electronic equipment and storage medium

    CN111767184A

  • Log processing method and device, electronic equipment and storage medium

    CN116361106A

  • Processor serial port log output method and device, electronic equipment and storage medium

    CN116719712A

  • Server, hard disk monitoring method and device thereof, equipment and medium

    CN117992311A