A log output method, product, device and medium based on system startup

By sending query instructions out of the band to the control platform before the system starts, obtaining the log switch status and turning on operations according to the modification option type, the problem of cumbersome and erroneous operation restart during the system start-up process is solved, and the dynamic output of the log is realized and High efficiency and accuracy.

CN118689516BActive Publication Date: 2024-11-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411180490.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-26
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

During the system startup process, the regular log output cannot modify the ABL log switch due to the in-band interaction between the boot system and the control platform, resulting in frequent modification of the boot system code to add additional restart time.

Method used

By sending query instructions out of band to the control platform before the server is turned on, and the log switch status is turned on according to the determined modification option type, dynamically modifying log output using out-of-band sending method to avoid traditional in-band interaction method Code modification.

Benefits of technology

It eliminates the tedious operation of booting system code modification, improves the efficiency and accuracy of log output, reduces the number and time of restarts caused by misoperation, and realizes dynamic output and flexibility of logs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689516B_ABST
    Figure CN118689516B_ABST
Patent Text Reader

Abstract

The present invention discloses a log output method, product, device and medium based on system startup, and relates to the technical field of servers. The log output corresponding to the system startup phase mainly stipulates the agreement of the in-band instructions of the control platform and the boot system before the server is turned on, and the switch state of the log can be modified at any time during the system startup process through an out-of-band sending method, without the need to modify the code operation of the boot system through the traditional in-band control platform and the boot system interactive method, eliminating the tedious operation of the boot system code modification, and completing the dynamic output of the log without the need to change the version. Add a second query instruction to set the control of the log modification option type, distinguish between conventional configuration pages or operating system option parameters and control platform command modifications, reduce the number of server restart operations and restart time due to erroneous operations for modification operations of the control platform, and improve the efficiency of log output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a log output method, product, device and medium based on system startup. Background Art

[0002] Application Boot Loader (ABL) logs are recorded information during the system boot process. They are critical for developers when debugging problems in the boot process, hardware initialization, or operating system loading.

[0003] During the system startup process, conventional log output cannot modify the opening and closing of the ABL log switch due to the in-band interaction between the boot system and the control platform. It is necessary to frequently modify the boot system code for control, which makes the operation more cumbersome. In addition, during the log output process, the configuration page or the option parameters of the operating system can be modified to control the output of the ABL log, but the command modification corresponding to the control platform cannot be effectively distinguished, and it is mistakenly believed that the control platform is performing a modification operation, which will cause the server to restart once, increasing the additional restart time.

[0004] Therefore, how to avoid the cumbersome operations caused by frequently modifying the code of the boot system and effectively distinguish the output of the option modification control ABL log is urgently needed to be solved by those skilled in the art. Summary of the invention

[0005] The purpose of the present invention is to provide a system startup-based log output method, product, device and medium to solve the problem of cumbersome operations caused by frequent modification of the boot system code and the problem of additional restart time caused by erroneous restart of the control platform.

[0006] In order to solve the above technical problems, the present invention provides a log output method based on system startup, comprising:

[0007] Before the server is turned on, a first query instruction is sent out-of-band to the control platform to obtain the switch status of the log; wherein the control platform and the boot system are pre-committed to the instruction agreement of the log switch, and the instruction agreement at least includes the return parameter agreement of the first query instruction and the second query instruction respectively;

[0008] When the switch state of the log is in the off state and the server is turned on, the boot system sends the second query instruction to obtain the modification option type of the switch state of the log; wherein the modification option type at least includes a control platform modification option, an interface modification option and an operating system modification option;

[0009] The switch state of the log is turned on according to the determined modification option type to output the log.

[0010] On the one hand, the pre-commitment of the control platform and the boot system to perform log switch instructions includes:

[0011] A first return parameter corresponding to the state identifier of the switch state of the log of the first query instruction is agreed upon; wherein the first return parameter occupies one byte;

[0012] A second return parameter for the switch status of the log of the second query instruction is agreed upon; wherein, the second return parameter is used to characterize 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.

[0013] On the other hand, sending the first query instruction out-of-band to the control platform to obtain the switch status of the log includes:

[0014] Sending the first query instruction out-of-band to the control platform;

[0015] Obtaining a first return parameter corresponding to the first query instruction; wherein the first return parameter of the first query instruction is used to indicate a status identifier of a switch status of the log;

[0016] The switch status of the log is determined according to the first return parameter.

[0017] On the other hand, the guiding system sending the second query instruction to obtain the modification option type of the switch state of the log includes:

[0018] In the driver execution environment phase when the server is powered on, the boot system sends the second query instruction to the storage space corresponding to the control platform;

[0019] Obtaining a second return parameter corresponding to the second query instruction;

[0020] The modification option type is determined according to the modification option type identifier corresponding to the second return parameter.

[0021] On the other hand, according to the interface modification option type or the operating system modification option type, the switch state of the log is turned on to output the log, including:

[0022] Skipping the execution corresponding to the interface modification option type or the operating system modification option type;

[0023] The current modification option type of the page configuration corresponding to the control boot system is used to turn on the switch state of the log to output the log; wherein the current modification option type is the on modification option of the log switch, the interface modification option type or the operating system modification option type.

[0024] On the other hand, the switch state of the log is turned on according to the control platform modification option type to output the log, including:

[0025] Calling a 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;

[0026] updating the control platform modification option type corresponding to the overwritten second query instruction for execution;

[0027] When the execution is successful, the log is modified by modifying the option type in the interface or the option corresponding to the operating system modification option type to output the log.

[0028] On the other hand, the memory where the storage space corresponding to the control platform is located is a non-volatile memory.

[0029] On the other hand, the sending of the second query instruction by the boot system to the storage space corresponding to the control platform during the driver execution environment phase of the server startup includes:

[0030] The second query instruction is sent out-of-band to the control platform so that the control platform can receive the second query instruction; and the second query instruction is stored in a 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.

[0031] On the other hand, after the guidance system sends the second query instruction to the storage space corresponding to the control platform, the method further includes:

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

[0033] On the other hand, after the switch state of the log is turned on according to the determined modification option type and before the log is output, the method further includes:

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

[0035] Storing the parameter corresponding to the switch state of the current log into a second variable used for debugging the program;

[0036] Obtaining the switch status of the log after the start operation;

[0037] If the switch state of the log after the opening operation is consistent with the switch state of the current log, control the boot system to call the first protocol to write the parameters corresponding to the switch state of the log into the new first protocol to output the log;

[0038] If the switch state of the log after the start operation is inconsistent with the switch state of the current log, the boot 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 refresh the parameters corresponding to the switch state of the log into the new first protocol to output the log.

[0039] On the other hand, the instruction convention also includes a third query instruction;

[0040] Correspondingly, the pre-commitment of the control platform and the boot system to perform log switching instructions includes:

[0041] A third return parameter of a clearing identifier of the switch state of the log of the third query instruction is agreed upon; wherein the third return parameter occupies one byte.

[0042] On the other hand, after calling the first protocol to write the parameters corresponding to the switch state of the log into the new first protocol, before outputting the log, the method further includes:

[0043] clearing an identifier for clearing the switch state of the log according to the third query instruction;

[0044] Call a system restart command to print the log.

[0045] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the system startup-based log output method when executed by a processor.

[0046] In order to solve the above technical problems, the present invention also provides a log output device based on system startup, comprising:

[0047] Memory for storing computer programs;

[0048] A processor is used to implement the steps of the log output method based on system startup when executing the computer program.

[0049] To solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the log output method based on system startup are implemented.

[0050] The present invention provides a log output method based on system startup, which sends a first query instruction out-of-band to a control platform before a server is turned on to obtain the switch status of a log; wherein, the control platform and a boot system are pre-committed to the instruction agreement for the log switch, and the instruction agreement at least includes the return parameter agreement of the first query instruction and the second query instruction respectively; when the switch status of the log is a closed state and the server is turned on, the boot system sends the second query instruction to obtain the modification option type of the switch status of the log; wherein the modification option type includes at least a control platform modification option, an interface modification option and an operating system modification option; and the switch status of the log is turned on according to the determined modification option type to output the log.

[0051] The beneficial effects of the present invention are that the log output corresponding to the system startup phase is mainly before the server is turned on, the agreement of the in-band instructions of the control platform and the boot system is agreed upon, and the switch state of the log is obtained from the control platform through an out-of-band sending method. The switch state of the log can be modified at any time during the system startup process through the out-of-band sending method, and there is no need to modify the code operation of the boot system through the traditional in-band control platform and boot system interaction method. The present invention saves the tedious operation of modifying the code of the boot system, does not need to change the version, and completes the dynamic output of the log. In addition, the control of the log modification option type is added to distinguish between the conventional configuration page or the option parameters of the operating system and the command modification of the control platform, improve the accuracy of the modification operation, reduce the number of operations and restart time of restarting the server due to the modification operation of the control platform due to the erroneous operation, and improve the efficiency of log output.

[0052] Secondly, the determination process of the instruction agreement is combined with the IPMI command of the control platform and the boot system to complete the dynamic output of the ABL log. Different modification option types enable the switch state of the log to output the log. On the basis of effectively distinguishing different modification option types, corresponding different update operations are performed to improve the diversity and flexibility of log output. Variable storage is used for a proprietary storage mechanism to ensure that data is not easily lost, corresponding to identifying and solving problems to ensure the correctness and stability of the program. The value of the second variable storage corresponding to the successful execution of the underlying code is consistent with the value of the switch state of the ABL log after the current enable operation, ensuring the output of the ABL log, which is distinguished from the code replacement of the corresponding boot system during the server startup process. The third query instruction adds a clear identifier of the option control switch in the switch setting of the modified ABL log to ensure that the switch of the ABL log is not associated next time, and improve the individuality of the ABL output log.

[0053] In addition, the present invention 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-mentioned system startup-based log output method. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 A flow chart of a log output method based on system startup provided by an embodiment of the present invention;

[0056] Figure 2 A flowchart of another log output method based on system startup provided by an embodiment of the present invention;

[0057] Figure 3 A structural diagram of a log output device based on system startup provided by an embodiment of the present invention;

[0058] Figure 4 A structural diagram of a log output device based on system startup provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] The core of the present invention is to provide a system startup-based log output method, product, device and medium to solve the problem of cumbersome operations caused by frequent modification of the boot system code and the problem of additional restart time caused by erroneous restart of the control platform.

[0061] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0062] During the boot process, a microprocessor is loaded to initialize the memory and the hardware interface of the central processing unit (CPU) to reduce the burden of the Unified Extensible Firmware Interface (UEFI) stage and improve the operating efficiency of the processor. At the same time, there will be faults, which cannot be handled by the debug methods commonly used in the UEFI stage. Because the port lights on the motherboard are not on, it is difficult to confirm the current server boot stage from the hardware. In addition, the Basic Input Output System (BIOS) and the Baseboard Management Controller (BMC) do not support the interaction of the Intelligent Platform Management Interface (IPMI) commands at the current stage. There is no way to use the UEFI stage to modify the Platform Configuration Database (PCD) value in real time to dynamically control the BIOS log output during the BIOS boot process. IPMI commands can span different operating systems, firmware and hardware platforms, and can intelligently monitor, control and automatically report the operating status of a large number of servers to reduce server system costs.

[0063] In the process of BIOS startup, debug means are added to accurately locate the location where the failure occurs in the system startup stage. There is a log output switch for opening the ABL stage in the processor. The log output of the ABL stage is turned on and off through specific options. This requires the ESPI bus implementation of the BIOS adapter log output. However, the Setup option can only be modified to output the ABL log when the BIOS on the machine is flashed for the first time. In the case of an abnormality in the ABL stage, and the BIOS cannot be successfully started for the first time, it is impossible to enter the Setup and operating system (Operating System, OS) interface to modify the option type. Only by modifying the BIOS code can the ABL stage log be captured. In addition, in the actual process of outputting the log, the default value of the option can be modified by modifying the Setup and OS interface, but it will be fed back through the IPMI command of the BMC. The BMC will think that the modification made by the IPMI command is such an erroneous operation. After the IPMI command of the BMC is modified, the server will be restarted once, resulting in an additional restart time. Therefore, the log output method based on system startup provided by the present invention can solve the above technical problems.

[0064] Figure 1 A flow chart of a log output method based on system startup provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0065] S11: before the server is turned on, a first query instruction is sent out-of-band to the control platform to obtain the switch status of the log;

[0066] Wherein, the control platform and the guide system are preliminarily provided with a command agreement for the log switch, and the command agreement at least includes a return parameter agreement of the first query command and the second query command respectively;

[0067] S12: When the switch state of the log is closed and the server is turned on, the boot system sends a second query instruction to obtain a modification option type of the switch state of the log;

[0068] The modification option types include at least a control platform modification option, an interface modification option, and an operating system modification option;

[0069] S13: According to the determined modification option type, the switch state of the log is turned on to output the log.

[0070] Specifically, before the server is turned on, the control platform and the boot system are preliminarily instructed to switch the log. The instruction agreement here is an agreement for the return parameter of the IPMI command, so as to facilitate the subsequent command interaction in the log output process. Different from the conventional command interaction, the present invention uses an out-of-band sending method to send a first query instruction to the control platform to obtain the switch status of the log.

[0071] In some embodiments, the control platform and the boot system are pre-committed to the log switch command agreement, including:

[0072] A first return parameter corresponding to the state identifier of the switch state of the log of the first query instruction is agreed upon; wherein the first return parameter occupies one byte;

[0073] A second return parameter for the switch status of the log of the second query instruction is agreed upon; wherein, the second return parameter is used to characterize 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.

[0074] It is understandable that the control platform can be a software system based on the server for managing, monitoring and maintaining the server. The control platform can provide a series of tools and functions to help system administrators or information technology (IT) professionals perform tasks efficiently. It is usually a BMC, but it can also be other control platforms.

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

[0076] In-band transmission and out-of-band transmission are different ways of transmitting data or signals on a communication channel. In-band transmission means that control information or signals are transmitted on the same communication channel together with normal data traffic, and the signals share the same transmission medium with other data. Out-of-band transmission means that control information or signals are sent through an independent communication path or channel, which is separated from the channel for data transmission, allowing control information to bypass the normal data flow.

[0077] Out-of-band messaging Some network devices support out-of-band management interfaces that allow administrators to access the device through an independent channel outside the network (such as a separate physical port or wireless connection). In network security, an intrusion detection system might use out-of-band messaging to immediately notify an administrator of a potential attack.

[0078] The control platform and the boot system need to agree on an IPMI command, at least a first return parameter corresponding to the state identifier of the switch state of the log of the first query instruction and a second return parameter corresponding to the switch state of the log of the second query instruction. The first return parameter occupies one byte and is used to query whether the current state of the ABL log switch is on or off. The second return parameter occupies at least two bytes, one byte of which is used to identify the method by which the user modifies the ABL log switch to distinguish between the operations of modifying the log switch under Setup and OS, and the other byte is used for the IPMI command to modify the opening and closing of the ABL log switch. The second return parameter is used to characterize the modification option type identifier.

[0079] The instruction convention determination process provided in this embodiment is combined with the IPMI command for interaction between the control platform and the boot system to complete the dynamic output of the ABL log.

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

[0081] In some embodiments, sending a first query instruction out-of-band to the control platform to obtain the switch status of the log includes:

[0082] Sending a first query instruction out-of-band to the control platform;

[0083] Obtaining a first return parameter corresponding to the first query instruction; wherein the first return parameter of the first query instruction is a state identifier used to characterize the switch state of the log;

[0084] The switch status of the log is determined according to the first return parameter.

[0085] Specifically, the first return parameter of the first query instruction represents the state identifier of the switch state of the log. The first return parameter can be represented by binary data. If the first return parameter is 0, it means that the switch state of the ABL log is closed; if the first return parameter is 1, it means that the switch state of the ABL log is open. It should be noted that when the switch state of the ABL log is open, no other operations are required, and the serial controller can be directly opened to collect the ABL log.

[0086] When the switch state of the log is in the off state, after the setting is completed, the server is turned on, and the boot system sends a second query instruction to obtain the modification option type of the switch state of the log.

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

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

[0089] Obtain a second return parameter corresponding to the second query instruction;

[0090] The modification option type is determined according to the modification option type identifier corresponding to the second return parameter.

[0091] Specifically, in the Driver Execution Environment (DXE) stage of the UEFI stage, the boot system sends a second query command to obtain the value of the ABL log switch setting from the storage space corresponding to the control platform. It should be noted here that based on the DXE stage being the BIOS boot stage, the second query command corresponds to the enable setting of the switch status of the ABL log.

[0092] The premise for the boot system to send the second query command is that when the switch state of the log is closed, the second query command needs to be sent out-of-band to the control platform so that the boot system can send the second query command during the server startup process.

[0093] 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:

[0094] A second query instruction is sent out-of-band to the control platform so that the control platform receives the second query instruction; and the second query instruction is stored in a 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.

[0095] Specifically, in combination with the above embodiment, the control platform is BMC, the boot system is BIOS, and when the first return parameter is 0, it means that the switch state of the ABL log is in the off state, and then the IPMI command is used to send the command to turn on the ABL log switch to the BMC out of band. After receiving the command, the BMC will store the command in the corresponding storage space, so that the BIOS can send a command query during the server startup process. This makes it unnecessary to change the version of the BIOS debug in the ABL stage, thereby improving the efficiency of BIOS debug.

[0096] The modification option type is determined according to the modification option type identifier corresponding to the second return parameter. In combination with the above embodiment, the second return parameter occupies at least two bytes, one byte of which is used to identify the method by which the user modifies the ABL log switch to distinguish between the operations of modifying the log switch under Setup and OS, and the other byte is used for the IPMI command to modify the opening and closing of the ABL log switch.

[0097] In some embodiments, determining the modification option type according to the modification option type identifier corresponding to the second return parameter includes:

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

[0099] If yes, it is determined to be a control platform modification option type;

[0100] If not, the second returned parameter is parsed to determine whether it is an interface modification option type identifier;

[0101] If it is an interface modification option type identifier, it is determined to be an interface modification option type;

[0102] If it is not an interface modification option type identifier, it is determined to be an operating system modification option type.

[0103] Specifically, by setting the priority form, it can be first determined whether it is a control platform modification option type identifier. If so, it is determined to be a control platform modification option type; if not, the second return parameter is parsed to determine whether it is an interface modification option type identifier. If there is no IPMI setting ABL log switch identifier in the second return parameter, it means that it is not a control platform modification option type identifier. If there is an IPMI setting ABL log switch identifier, it means that it is a corresponding modification option type under Setup or OS, and it needs to be determined based on this type of byte identifier.

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

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

[0106] In some embodiments, the switch state of the log is turned on according to the interface modification option type or the operating system modification option type to output the log, including:

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

[0108] The current modification option type of the page configuration corresponding to the control boot system turns on the switch state of the log to output the log; wherein the current modification option type is the log switch on modification option, interface modification option type or operating system modification option type.

[0109] Specifically, when there is no IPMI setting ABL log switch flag in the second return parameter, it is directly skipped, and the current modification option type of the page configuration corresponding to the control boot system is turned on to output the log. If the boot system is BIOS, the BIOS will execute according to its own settings, such as not turning on the ABL log switch, turning on the ABL log switch in Setup, and turning on the ABL log switch in OS.

[0110] In some other embodiments, the switch state of the log is turned on according to the control platform modification option type to output the log, including:

[0111] Calling a 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;

[0112] The control platform modification option type corresponding to the overwritten second query instruction is updated for execution;

[0113] When the execution is successful, modify the log to output the log by modifying the option type in the interface or the option corresponding to the option type in the operating system.

[0114] Specifically, when the second return parameter is the flag for IPMI to set the ABL log switch, if the boot system is BIOS, it is necessary to call a 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 usually a programming interface for setting the value of a variable. In the 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 startup configuration, security credentials, etc.

[0115] Only if the command of the SetVariable function is executed successfully, the modification of the ABL log switch option in Setup is considered successful, which means that the modification in OS is successful, so the log is output at this time. If the execution fails, the BIOS will skip the remaining code execution and exit.

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

[0117] Status=gRT->SetVariable(

[0118] … );

[0120] if (EFI_ERROR(Status)){

[0121] return EFI_SUCCESS;

[0122] }

[0123] The different modification option types provided in this embodiment enable the switch state of the log to output the log. On the basis of effectively distinguishing different modification option types, corresponding different update operations are performed to improve the diversity and flexibility of log output.

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

[0125] It is understandable that the dynamic output of the ABL log is completed by means of non-volatile storage data through non-volatile memory, so that the debug of BIOS in the ABL stage does not need to change the version. The non-volatile memory here can be an electrically erasable programmable read-only memory (EEPROM), a flash memory, a read-only memory (ROM), a programmable memory (PROM), etc., which are not limited here.

[0126] Specifically, the BIOS obtains the value of the ABL log switch setting from the BMC EEPROM through the IPMI command:

[0127] / / Procedure: GetAblDebugValueFromBmc

[0128] / / Description:

[0129] / / This function will get Abl Debug Value set by BMC.

[0130] BOOLEAN

[0131] GetAblDebugValueFromBmc(

[0132] OUT UINT8*AblDebug )

[0134] {

[0135] …

[0136] }

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

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

[0139] It can be understood that the first variable (eg, IpmiAblDebug variable) is used for debugging a program, which corresponds to the debugging information or debugging mode of the boot loader of IPMI, and the value obtained by setting the ABL log switch is stored in the first variable.

[0140] The variable storage provided in this embodiment is used for a proprietary storage mechanism to ensure that data is not easily lost, corresponding to identifying and solving problems to ensure the correctness and stability of the program.

[0141] The embodiment of the present invention provides a log output method based on system startup, before the server is turned on, a first query instruction is sent out of band to the control platform to obtain the switch state of the log; wherein, the control platform and the boot system are preliminarily agreed on the instruction of the log switch, and the instruction agreement at least includes the return parameter agreement of the first query instruction and the second query instruction; when the switch state of the log is closed and the server is turned on, the boot system sends the second query instruction to obtain the modification option type of the switch state of the log; wherein the modification option type at least includes the control platform modification option, the interface modification option and the operating system modification option; according to the determined modification option type, the switch state of the log is turned on to output the log. The corresponding log output in the system startup phase mainly agrees on the agreement of the in-band instructions of the control platform and the boot system before the server is turned on, and the switch state of the log is obtained from the control platform through the out-of-band sending method. The switch state of the log can be modified at any time during the system startup process through the out-of-band sending method, without modifying the code operation of the boot system through the traditional in-band control platform and boot system interaction method. The present invention saves the tedious operation of code modification of the boot system, does not need to change the version, and completes the dynamic output of the log. In addition, a second query instruction is added to set the control of the log modification option type, distinguishing between the conventional configuration page or operating system option parameters and the command modification of the control platform, improving the accuracy of the modification operation, reducing the number of server restart operations and restart time due to erroneous operation of the control platform modification operation, and improving the efficiency of log output.

[0142] In some embodiments, after the switch state of the log is turned on according to the determined modification option type and before the log is output, the method further includes:

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

[0144] The parameter corresponding to the switch state of the current log is stored in a second variable used for debugging the program;

[0145] Get the switch status of the log after the operation is turned on;

[0146] If the switch state of the log after the start operation is consistent with the switch state of the current log, the control guidance system calls the first protocol to write the parameters corresponding to the switch state of the log into the new first protocol to output the log;

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

[0148] It is understandable that after the DXE stage, the execution of the underlying code requires the successful execution of the options opened by AMD, and the value of the switch state of the log corresponding to the peripheral bus communication protocol is written into the Serial Peripheral Interface Flash (SPI flash). Therefore, it is also necessary to check the switch state of the current log corresponding to the called peripheral bus communication protocol, that is, the switch state of the current log actually stored. Before comparison, the switch state of the current log is stored in the second variable (such as the OrgAblDebug variable). The specific protocol of the peripheral bus communication protocol is not limited and can be set according to actual conditions. It can be a bus protocol for connecting a microcontroller or other processor with peripheral devices, or other protocols.

[0149] The second variable is based on the debugging information or debugging mode setting related to the original application boot loader, and can be the OrgAblDebug variable or other variables.

[0150] It is determined whether the switch state of the log after the operation is turned on is consistent with the switch state of the current log. If they are consistent, the system is guided 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. The first protocol here is mainly a write protocol. The specific write protocol can be an SPI flash write protocol or other write protocols, which are not limited.

[0151] If the switch state of the log after the operation is turned on is inconsistent with the switch state of the current log, the control guidance system calls the second protocol to overwrite the parameters of the switch state of the log after the operation is turned on into the second variable, and the overwriting method needs to be used to keep the consistency. Then call the first protocol to write the parameters corresponding to the switch state of the log into the new first protocol to output the log.

[0152] For example, when OrgAblDebug is inconsistent with the modified ABL log switch default value, the modified ABL log switch default value is overwritten into the peripheral bus communication protocol:

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

[0154] …

[0155] }

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

[0157] In some embodiments, the instruction convention further includes a third query instruction;

[0158] Correspondingly, the control platform and the boot system are pre-configured with the following instructions for logging on and off:

[0159] A third return parameter of a clearing identifier of the switch state of the log of the third query instruction is agreed upon; wherein the third return parameter occupies one byte.

[0160] It is understandable that the instruction convention also includes a third query instruction, which is used to clear the identifier to prevent occupying more storage space and to prepare for timely clearing corresponding to the next setting of the ABL log switch. The third query instruction occupies one byte and clears the identifier of the ABL log switch.

[0161] In some embodiments, after calling the first protocol to write the parameters corresponding to the switch state of the log into the new first protocol, before outputting the log, the method further includes:

[0162] A clearing identifier of the switch state of clearing the log according to the third query instruction;

[0163] Call the system restart command to print the log.

[0164] Specifically, 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, and then call the system restart command to print the ABL log through the serial controller.

[0165] For example, call the IPMI command to clear the ABL log switch identifier in the BMC EEPROM:

[0166] / / Procedure: ClearBmcAblDebugFlag

[0167] / / Description:

[0168] EFI_STATUS

[0169] ClearBmcAblDebugFlag()

[0170] {

[0171] …

[0172] }

[0173] The third query instruction provided in this embodiment adds a clear identifier of the option control switch to the switch setting for modifying the ABL log, thereby ensuring that the switch for setting the ABL log next time is not associated, thereby improving the individuality of the ABL output log.

[0174] Figure 2 A flowchart of another method for outputting logs based on system startup provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, including:

[0175] S21: The guidance system and the control platform jointly agree on an intelligent platform management interface command;

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

[0177] S23: Determine whether the return value of the log switch is 0, if so, proceed to step S24, if not, proceed to step S25;

[0178] S24: Continue to execute the log switch opening command;

[0179] S25: directly open the serial controller to collect logs;

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

[0181] S27: Determine whether the return value contains a log switch identifier for the intelligent platform management interface; if so, proceed to step S28; if not, proceed to step S29;

[0182] S28: Instruct the system to overwrite the value set in the intelligent platform management interface in the log switch option;

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

[0184] S30: Determine whether the log switch option is set successfully; if so, proceed to step S31; if not, proceed to step S32;

[0185] S31: Obtaining a default value of a log switch in the peripheral bus communication protocol and storing it in a second variable;

[0186] S32: exit execution;

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

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

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

[0190] S36: Open the serial controller to collect logs.

[0191] The serial controller (Serial Over LAN, Sol) in step S35 can redirect data of the local asynchronous serial controller interface to the remote end.

[0192] The above describes in detail various embodiments corresponding to the system startup-based log output method. On this basis, the present invention also discloses a system startup-based log output device corresponding to the above method. Figure 3 The structure diagram of a log output device based on system startup provided by an embodiment of the present invention. Figure 3 As shown, the device includes:

[0193] The first acquisition module 11 is used to send a first query instruction to the control platform out of band to obtain the switch status of the log before the server is turned on; wherein the control platform and the boot system are preliminarily agreed on the command of the log switch, and the command agreement at least includes the return parameter agreement of the first query instruction and the second query instruction respectively;

[0194] The second acquisition module 12 is used for, when the switch state of the log is in the off state and the server is turned on, the boot system sends a second query instruction to obtain the modification option type of the switch state of the log; wherein the modification option type at least includes a control platform modification option, an interface modification option and an operating system modification option;

[0195] The enabling operation module 13 is used to perform an enabling operation on the switch state of the log according to the determined modification option type to output the log.

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

[0197] For an introduction to a system-startup-based log output device provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the above system-startup-based log output method.

[0198] Figure 4 A structural diagram of a log output device based on system startup provided by an embodiment of the present invention, such as Figure 4 As shown, the device comprises:

[0199] A memory 21, used for storing computer programs;

[0200] The processor 22 is used to implement the steps of the log output method based on system startup when executing the computer program.

[0201] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0202] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211, wherein, after the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the system startup-based log output method disclosed in any of the aforementioned 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. Among them, the operating system 212 may include Windows, Unix, Linux, etc. Data 213 may include but is not limited to data involved in the system startup-based log output method, etc.

[0203] In some embodiments, the system startup-based log output device 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 .

[0204] Those skilled in the art can understand that Figure 4 The structure shown in the figure does not constitute a limitation on the log output device based on system startup, and may include more or fewer components than those shown in the figure.

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

[0206] For an introduction to a log output device based on system startup provided by the present invention, please refer to the above method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above log output method based on system startup.

[0207] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 22, the steps of the log output method based on system startup as described above are implemented.

[0208] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially 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, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0209] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the above system startup-based log output method.

[0210] Furthermore, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the log output method based on system startup when executed by a processor.

[0211] For an introduction to a computer program product provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the above system startup-based log output method.

[0212] The above is a detailed introduction to a system-startup-based log output method, product, device and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

[0213] It should also be noted that, in this specification, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A log output method based on system startup, It is characterized in that include: Before the server is turned on, a first query instruction is sent out-of-band to the control platform to obtain the switch status of the log; wherein the control platform and the boot system are pre-agreed on the instruction of the log switch, and the instruction agreement at least includes the return parameter agreement of the first query instruction and the second query instruction respectively; the first return parameter corresponding to the state identifier of the switch status of the log of the first query instruction is agreed; the second return parameter of the switch status of the log of the second query instruction is agreed; the first return parameter of the first query instruction is used to represent the state identifier of the switch status of the log; the second return parameter is used to represent the modification option type identifier; When the switch state of the log is in the off state and the server is turned on, the boot system sends the second query instruction to obtain the modification option type of the switch state of the log; wherein the modification option type at least includes a control platform modification option, an interface modification option and an operating system modification option; The switch state of the log is turned on according to the determined modification option type to output the log.

2. The log output method based on system startup according to claim 1, It is characterized in that The first return parameter occupies one byte; 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; and the control platform modification option type identifier occupies one byte.

3. The log output method based on system startup according to claim 2, It is characterized in that The sending of the first query instruction out-of-band to the control platform to obtain the switch status of the log includes: Sending the first query instruction out-of-band to the control platform; Obtaining a first return parameter corresponding to the first query instruction; The switch status of the log is determined according to the first return parameter.

4. The log output method based on system startup according to claim 2, It is characterized in that The step of sending the second query instruction by the guidance system to obtain the modification option type of the switch status of the log includes: In the driver execution environment phase when the server is powered on, the boot system sends the second query instruction to the storage space corresponding to the control platform; Obtaining a second return parameter corresponding to the second query instruction; The modification option type is determined according to the modification option type identifier corresponding to the second return parameter.

5. The log output method based on system startup according to claim 4, It is characterized in that According to the interface modification option type or the operating system modification option type, the switch state of the log is turned on to output the log, including: Skipping 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 control boot system is used to turn on the switch state of the log to output the log; wherein the current modification option type is the on modification option of the log switch, the interface modification option type or the operating system modification option type.

6. The log output method based on system startup according to claim 4, It is characterized in that The switch state of the log is turned on according to the control platform modification option type to output the log, including: Calling a 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; updating the control platform modification option type corresponding to the overwritten second query instruction for execution; When the execution is successful, the log is modified by modifying the option type in the interface or the option corresponding to the operating system modification option type to output the log.

7. The log output method based on system startup according to claim 5 or 6, It is characterized in that The memory where the storage space corresponding to the control platform is located is a non-volatile memory.

8. The log output method based on system startup according to claim 4, It is characterized in that The step of sending the second query instruction by the boot system to the storage space corresponding to the control platform during the driver execution environment phase of the 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; and the second query instruction is stored in a 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.

9. The log output method based on system startup according to claim 8, It is characterized in that After the guidance system sends the second query instruction to the storage space corresponding to the control platform, the method 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.

10. The log output method based on system startup according to claim 1, It is characterized in that After turning on the switch state of the log according to the determined modification option type and before outputting the log, the method further includes: Call the peripheral bus communication protocol to obtain the switch status of the current log; Storing the parameter corresponding to the switch state of the current log into a second variable used for debugging the program; Obtaining the switch status of the log after the start operation; If the switch state of the log after the opening operation is consistent with the switch state of the current log, control the boot system to call the first protocol to write the parameters corresponding to the switch state of the log into 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 boot 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 refresh the parameters corresponding to the switch state of the log into the new first protocol to output the log.

11. The log output method based on system startup according to claim 10, It is characterized in that The instruction agreement also includes a third query instruction; Correspondingly, the pre-commitment of the control platform and the boot system to perform log switching instructions includes: A third return parameter of a clearing identifier of the switch state of the log of the third query instruction is agreed upon; wherein the third return parameter occupies one byte.

12. The log output method based on system startup according to claim 11, It is characterized in that After calling the first protocol to write the parameters corresponding to the switch state of the log into the new first protocol, and before outputting the log, the method further includes: clearing an identifier for clearing the switch state of the log according to the third query instruction; Call a system restart command to print the log.

13. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instruction is executed by a processor, the steps of the system startup-based log output method described in any one of claims 1 to 12 are implemented.

14. A log output device based on system startup, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the system startup-based log output method as described in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the system startup-based log output method according to any one of claims 1 to 12 are implemented.