How to record boot error information

By executing the power-on self-test code and recording error information in the processing unit of the server, the problem of difficult recording and analysis of server power-on error information is solved, and a more efficient debugging process is achieved.

CN113687967BActive Publication Date: 2024-10-01MITAC COMP (SHUN DE) LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202010419690.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-18
Publication Date
2024-10-01
Estimated Expiration
2040-05-18

AI Technical Summary

Technical Problem

During the server startup process, error information is difficult to record and analyze, resulting in low debugging efficiency. Especially when the server automatically restarts, it is difficult for engineers to track the cause of the error. In particular, the client operator cannot record the debugging code of the LED light, resulting in Debugging efficiency is not high.

Method used

By executing the power-on self-test code in the processing unit, it is determined whether an error occurred in the previously executed power-on self-test program, and the debug code in the complementary metal oxide semiconductor memory is written into the BIOS memory to record the power-on error information to ensure Debug code is accessible in BIOS memory to facilitate analysis and troubleshooting of errors.

Benefits of technology

Debuggers of server devices can understand at what point in time and which subroutine the server crashed based on the boot error information in the BIOS memory, thereby improving debugging efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113687967B_ABST
    Figure CN113687967B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for recording boot error information. The method for recording boot error information includes: each time the BIOS is booted and executes a self-detection program, a first subroutine is used to determine whether an error occurred in the previous boot self-detection program. If an error occurs, it indicates that the system crashed during the previous boot. Therefore, the write function of the BIOS memory is not ready at this moment. Therefore, the debug code already existing in the first address space of the CMOS memory is first moved to the second address space. The processing unit then executes each subroutine containing the debug code, and writes the debug code of the executed subroutine into the first address space. When the write function is ready, the boot error information corresponding to the debug code existing in the second address space is written into the BIOS memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This case is about a method for recording startup error information. Background Art

[0002] During the server startup process, the server may crash due to various errors. After the server crashes, depending on the server, the server system will automatically restart or stay where it crashed. If the server automatically restarts, it is difficult for the server user to track the cause of the server crash. Even if the server is not restarted, since the server has crashed, it is difficult for engineers to analyze the cause of the server crash if they only rely on the debug code displayed on the LED light. Especially when the server has been sold to the client, general computer operators may not record the LED light debug code they see and restart when they encounter a crash, so even the simplest error information cannot be provided to the original manufacturer for error removal. Therefore, regardless of whether the server automatically restarts, it is difficult for engineers to analyze and debug the server crash, resulting in low debugging efficiency and considerable inconvenience.

[0003] Furthermore, even if the server can display error information, current servers cannot display sufficient error information. Given the system complexity of current servers, servers will execute thousands or tens of thousands of functions during the boot process. It will be difficult for engineers to analyze at which point in time or when executing which function the server crashed, resulting in very low debugging efficiency. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for recording startup error information to improve the debugging efficiency.

[0005] To solve the above technical problems, the present invention provides a method for recording boot error information for a server device, comprising: a processing unit executes a boot self-test code to successively execute a first boot self-test program and a second boot self-test program; in the second boot self-test program, the processing unit determines whether an error occurs in the first boot self-test program executed last; when an error occurs in the first boot self-test program, the processing unit moves a debug code existing in a first address space of a complementary metal oxide semiconductor memory to a second address space of the complementary metal oxide semiconductor memory when a write function of a basic input and output system memory is not ready; after moving to the second address space, the processing unit executes a plurality of subroutines included in the boot self-test code, wherein each subroutine includes a debug code; when executing the subroutine, the processing unit writes the debug code of the executed subroutine into the first address space; when the write function is ready, the processing unit writes the boot error information corresponding to the debug code existing in the second address space after the move into the basic input and output system memory.

[0006] Compared to the prior art, in the boot error information recording method of the present invention, the debugger of the server device can understand at which time point and which subroutine the server device crashed based on the boot error information stored in the BIOS memory, which can be used as a reference for tracking and debugging to improve debugging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 The functional block diagram of an embodiment of a server device with a boot error information recording function according to the present invention.

[0008] Figure 2 The figure is a flow chart of an embodiment of a method for recording boot error information according to the present invention.

[0009] Figure 3 for Figure 2 A flow chart of one implementation of the boot error information recording method. DETAILED DESCRIPTION

[0010] Please refer to Figure 1 , Figure 1 The functional block diagram of an embodiment of a server device 1 with a boot error information recording function according to the present invention. The server device 1 includes a basic input and output system (BIOS) memory 11, a complementary metal oxide semiconductor (CMOS) memory 12 and a processing unit 13. The processing unit 13 is coupled to the BIOS memory 11 and the CMOS memory 12.

[0011] The BIOS memory 11 includes a power-on self-test (POST) code, and the processing unit 13 reads the BIOS memory 11 and executes the POST code to perform the boot procedure of the server device 1. The POST code includes a plurality of subroutines, some of which have debugging codes and have different debugging codes. For example, the POST code includes tens of thousands of subroutines and three of which have debugging codes (hereinafter referred to as the first subroutine, the second subroutine, and the third subroutine), and the debugging codes of the first subroutine, the second subroutine, and the third subroutine (in hexadecimal notation as an example) may be "0x01", "0x02", and "0x03", respectively. In one embodiment, the aforementioned subroutine may be a routine that needs to be executed in the POST procedure.

[0012] Based on the aforementioned debugging code, the CMOS memory 12 includes different address spaces (hereinafter referred to as the first address space and the second address space) for storing the debugging code. When executing the POST code, the processing unit 13 writes the debugging code of the executed subroutine into the first address space to record the executed subroutine. Furthermore, in the case where an error has occurred in the POST program, the processing unit 13 can write the boot error information corresponding to the debugging code in the second address space into the BIOS memory 11 when the write function of the BIOS memory 11 is ready to record the boot error information of the server device 1. In one embodiment, the first address space and the second address space can be the addresses "42h" and "43h" respectively. Furthermore, the aforementioned boot error information can be the aforementioned debugging code, the date and time when the error occurs in the POST program.

[0013] For details, please refer to Figure 1 and Figure 2 , Figure 2 The flowchart of one embodiment of the boot error information recording method according to the present invention. When executing the boot self-test code, the processing unit 13 first determines whether an error occurred in the last boot self-test program (step S01), that is, the processing unit 13 determines whether the server device 1 has ever crashed. If the processing unit 13 determines that no error occurred in the last boot self-test program when executing the boot self-test code (the judgment result is "no"), the processing unit 13 executes the subroutine and writes the debug code of the executed subroutine into the first address space when executing the subroutine (step S03), so as to record the executed debug code in real time. On the other hand, if the processing unit 13 determines that an error occurred in the previous execution of the power-on self-test program when executing the power-on self-test code (the judgment result is "yes"), the processing unit 13 reads the first address space of the CMOS memory 12, and the first address space includes the debug code of the executed subroutine written by the processing unit 13 when the power-on self-test program was executed last time. When the write function of the BIOS memory 11 is not ready, the processing unit 13 moves the debug code already existing in the first address space to the second address space (step S02).

[0014] After the debugging code is moved from the first address space to the second address space, the processing unit 13 executes the subroutine, and writes the debugging code of the executed subroutine into the first address space when executing the subroutine (step S03), so that the written debugging code overwrites the debugging code previously existing in the first address space, so as to record the executed subroutine in the currently executed POST program. Moreover, when the writing function of the BIOS memory 11 is ready, the processing unit 13 writes the boot error information corresponding to the debugging code existing in the second address space after the move into the BIOS memory 11 (step S05), so as to record the error information occurring when the POST program was previously executed in the BIOS memory 11.

[0015] For example, the processing unit 13 successively executes a first power-on self-test program and a second power-on self-test program. In the first power-on self-test program, the processing unit 13 writes the debugging code "0x01" of the first subprogram into the first address space when executing the first subprogram, and writes the debugging code "0x02" of the second subprogram into the first address space when executing the second subprogram. The server device 1 then crashes after the debugging code "0x02" is written into the first address space. The processing unit 13 executes the second power-on self-test program after the server device 1 is restarted. , and execute the POST code in the second POST program, and determine in step S01 that an error has occurred in the first POST program (the determination result is "yes"), so in the second POST program, the processing unit 13 moves the debug code 0x02 stored in the first address space to the second address space, and then the processing unit 13 starts to execute from the first subroutine, and after the write function of the BIOS memory 11 is ready, the processing unit 13 writes the boot error information corresponding to the debug code "0x02" in the second address space into the BIOS memory 11. After executing step S05, the processing unit 13 continues to execute the POST program (step S12).

[0016] Based on this, the processing unit 13 can record the currently executed subroutine in real time each time the boot self-test code is executed, and record the crash condition that has occurred in the BIOS memory 11. The debugger of the server device 1 can understand at which time point and which subroutine the server device 1 has crashed based on the boot error information stored in the BIOS memory 11, which can be used as a reference for tracking and debugging to improve debugging efficiency.

[0017] In one embodiment, the processing unit 13 sequentially executes a plurality of subroutines in step S03, and the processing unit 13 writes the debugging code of the subroutines into the aforementioned first address space each time a subroutines having debugging code is executed, so as to cover the debugging code of different subroutines. Taking the aforementioned first subroutines and second subroutines as an example, the processing unit 13 writes the debugging code "0x01" into the first address space when executing the first subroutines, and the processing unit 13 writes the debugging code "0x02" into the first address space when executing the second subroutines. After the processing unit 13 writes the debugging code "0x02" into the first address space, the debugging code "0x02" covers the debugging code "0x01" of the first subroutines existing in the first address space, so that the debugging code stored in the first address space is updated from "0x01" to "0x02". In this way, the first address space can store the debugging code of the latest subroutines that have been executed.

[0018] In one embodiment, the CMOS memory 12 further has a third address space, which can be an address of "40h". The third address space stores two flags (hereinafter referred to as the first flag and the second flag). The first flag indicates whether the POST procedure is completed, and the second flag indicates whether an error occurs in the POST procedure executed last time and whether the POST error information corresponding to the debug code in the second address space needs to be written into the BIOS memory 11. The processing unit 13 determines whether an error occurs in the POST procedure executed last time according to the first flag, and sets the second flag according to the first flag. When the write function of the BIOS memory 11 is ready, the processing unit 13 determines whether the POST error information corresponding to the debug code in the second address space needs to be written into the BIOS memory 11 according to the second flag.

[0019] For details, please refer to Figure 3Taking the first flag at a high level indicating that the power-on self-test program has not been completed as an example, the processing unit 13 determines whether the first flag is at a high level (i.e., logic "1") when executing step S01 to determine whether the first power-on self-test program executed last time is completed. If the processing unit 13 determines in step S01 that the first flag is not at a high level (the determination result is "No"), for example, the first flag is at a low level, indicating that the first POST procedure has been completed without error, at this time, in the second POST procedure, the processing unit 13 first sets the first flag to have a high level (step S07), that is, the processing unit 13 pre-sets that the second POST procedure currently being executed cannot be completed, so that the first flag is changed from a low level to a high level, so as to avoid the processing unit 13 from causing an error when executing the second POST procedure, resulting in a crash and being unable to set the first flag to have a high level in the second POST procedure; thereafter, when the second POST procedure is completed, the processing unit 13 further resets the first flag (step S08), so that the first flag is changed from a high level to a low level, so as to indicate that the second POST procedure currently being executed has been completed without error.

[0020] Based on this, after the processing unit 13 sets the first flag to have a high level (step S07), if the processing unit 13 crashes when executing a subroutine in the second power-on self-test program, after the server device 1 is restarted, since the second power-on self-test program has not been completed, the processing unit 13 has not reset the first flag in step S08 to change the first flag to a low level. When the processing unit 13 executes step S01 in the third power-on self-test program after the server device 1 is restarted, the processing unit 13 can determine that an error has occurred in the second power-on self-test program executed last time (the judgment result is "yes") by virtue of the first flag being at a high level, and accordingly move the debugging code existing in the first address space to the second address space (step S02).

[0021] On the other hand, in the second POST procedure, if the processing unit 13 determines in step S01 that the first flag is at a high level (the determination result is "yes"), it means that the first POST procedure executed last time has not been completed, that is, an error has occurred in the first POST procedure. At this time, the processing unit 13 further sets the second flag according to the first flag having a high level (step S09); thus, taking the second flag having a high level indicating that an error has occurred in the POST procedure executed last time (for example, the first POST procedure), the processing unit 13 sets the second flag in step S09. The flag has a high level; accordingly, after the writing function of the BIOS memory 11 is ready (the judgment result of step S04 is "yes"), the processing unit 13 determines whether the second flag has a high level (step S10) to determine whether an error occurs in the last executed POST program and the boot error information corresponding to the debug code in the second address space needs to be written into the BIOS memory 11 (step S05). If it is determined that the second flag has a high level (the judgment result is "yes"), the processing unit 13 starts to execute step S05 and writes the boot error information into the BIOS memory 11. After the processing unit 13 writes the boot error information into the BIOS memory 11, the processing unit 13 resets the second flag to have a low level (step S12), so that the second flag changes from a high level to a low level, indicating that the recording of the boot error information has been completed.

[0022] On the other hand, when the processing unit 13 determines in step S01 that the first POST procedure executed last time has no error according to the first flag (the judgment result is "No") and the processing unit 11 determines in step S10 that the second flag is not at a high level (the judgment result is "No"), the processing unit 11 executes step S11 to determine whether the second POST procedure currently executed is completed and whether the server device 1 needs to be warm reset. When the second POST procedure is completed or the server device 1 needs to be warm reset, the processing unit 11 resets the first flag (step S08). Therefore, regardless of whether the first flag and the second flag have a high level, the processing unit 13 determines whether the boot procedure is completed and whether the server device 1 needs to perform a system reset in the second POST procedure currently executed, so as to determine whether to reset the first flag.

[0023] In one embodiment, the processing unit 13 further determines whether the currently executed POST program is completed (step S11) before resetting the first flag. If the POST program is completed, it means that the currently executed POST program has no error. The processing unit 13 starts to reset the first flag to a low level (step S08), so that the first flag is changed from the high level set in step S07 to a low level. In addition, some subroutines have the function of making the server device 1 perform a warm reset. In step S11, the processing unit 13 further determines whether the server device 1 needs to perform a warm reset. If the server device 1 needs to perform a warm reset due to the aforementioned subroutine (the judgment result of step S11 is "yes"), the processing unit 13 also needs to reset the first flag to a low level (step S08) to avoid the problem of a judgment error in step S01 of the subsequent POST program executed by the processing unit 13 after the server device 1 is started by the warm reset because the first flag is not reset to a low level.

[0024] For example, taking the third subroutine having the function of causing the server device 1 to perform a warm reset, the processing unit 13 first sets the first flag to a high level in step S07 in the second power-on self-test program. Then, the processing unit 13 executes the third subroutine in step S03, and determines in step S11 that the server device 1 needs to perform a warm reset. At this time, the first flag is at a high level. After the processing unit 13 executes step S08, the first flag changes from a high level to a low level. After the server device 1 is reset, the processing unit 13 executes the third power-on self-test program and determines in step S01 that the first flag is at a low level rather than a high level, which correctly indicates that the second power-on self-test program executed last time did not fail (because the server device 1 is performing a warm reset rather than a crash).

[0025] In one embodiment, the processing unit 13 further calculates a checksum based on the data in the third address space in step S07, and stores the checksum in the fourth address space to indicate whether the CMOS memory 12 is damaged. For example, the data in the third address space is "0x01", and the processing unit 13 calculates and generates a checksum of "0xFF", so that the sum of "0xFF" and "0x01" should generate a sum of "0x00". In one embodiment, the fourth address space can be an address of "41h".

[0026] Therefore, before the processing unit 13 determines whether the POST code executed in the last POST program is wrong (step S01), the processing unit 13 first determines whether the CMOS memory 12 is damaged (step S06). In step S06, the processing unit 13 reads the CMOS memory 12. The processing unit 13 adds the data in the third address space and the checksum stored in the fourth address space to generate a sum value. The processing unit 13 also determines whether the sum value is zero. If the sum value is not zero, it means that due to the damage of the CMOS memory 12, the value of any one of the first flag, the second flag and the checksum stored in the CMOS memory 12 changes, causing the aforementioned sum value to be not zero. Therefore, if the CMOS memory 12 is damaged, it means that the information represented by the first flag and the second flag stored in the CMOS memory 12 is not worth referring to. Therefore, when the processing unit 13 determines in step S06 that the CMOS memory 12 is damaged (the determination result is "No"), the processing unit 13 does not execute steps S01, S02, and S09, and the processing unit 13 starts to execute from step S07. That is, when the CMOS memory 12 is damaged, the processing unit 13 does not set the second flag to have a high level and will not execute step S05 to write the boot error data into the BIOS memory 11.

[0027] In one embodiment, when the processing unit 12 writes the boot error information into the BIOS memory 11 in step S05, the processing unit 12 does not overwrite the boot error information written at different time points, that is, the boot error information generated at different time points can be stored in the BIOS memory 11, so that the maintainer of the server device 1 can perform debugging analysis on the server device 1 based on a larger number of boot error information. Furthermore, the number of bits that can be included in the debugging code of the aforementioned subroutine can be two bytes, that is, the boot self-test code can include at most 65536 subroutines with different debugging codes. Here, the debugger can increase the number of debugging codes in the subroutine according to actual needs. According to the large number of different debugging codes, when the server device 1 crashes, the debugger can more accurately know the executed subroutine that has an error.

[0028] In one embodiment, the writing function of the BIOS memory 11 is ready in the driver execution environment (DXE) boot phase included in the POST program, that is, the processing unit 13 can execute step S05 in the DXE boot phase to update the boot error information in the BIOS memory 11. Furthermore, the server device 1 includes a south bridge chip, and the CMOS memory 12 is present in the south bridge chip. The writing function of the south bridge chip is ready in the security (SEC) boot phase included in the POST program, that is, the processing unit 13 can use the CMOS memory 12 to store the debug code of the executed subroutine when starting to execute the POST code.

[0029] In summary, according to one embodiment of the boot error information recording method of the present invention, the debugger of the server device can understand at which time point and which subroutine the server device crashed based on the boot error information stored in the BIOS memory, which can be used as a reference for tracking and debugging to improve debugging efficiency.

[0030] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the appended claims.

Claims

1. A method for recording boot error information, suitable for a server device, It is characterized in that Include: In a currently executed second POST procedure, a processing unit determines whether an error occurs in a previously executed first POST procedure; When the first POST procedure does not cause an error, the processing unit executes a plurality of subroutines of a POST code contained in a basic input / output system memory, and writes the debug code of the executed subroutines into a first address space of a complementary metal oxide semiconductor memory; When an error occurs in the first POST procedure, the processing unit moves the debugging code existing in the first address space to a second address space of the CMOS memory when a write function of the BIOS memory is not ready; After being moved to the second address space, the processing unit executes the subroutines and writes the debug codes of the executed subroutines into the first address space; and The processing unit writes a boot error message corresponding to the debug code in the second address space after the transfer into the basic input and output system memory when the write function is ready.

2. The method for recording startup error information according to claim 1, It is characterized in that A third address space of the complementary metal oxide semiconductor memory stores a first flag indicating whether the first power-on self-test program is completed. In the step in which the processing unit determines whether an error occurs in the first power-on self-test program executed last, the processing unit determines whether the first flag has a preset level, so as to determine whether an error occurs in the first power-on self-test program by using the first flag.

3. The method for recording startup error information according to claim 2, It is characterized in that The first flag is further used to indicate whether the second POST procedure is completed. In the second POST procedure, the POST error information recording method further comprises: After the processing unit determines whether an error occurs in the first POST procedure executed last time according to the first flag and before executing the subroutines, the processing unit sets the first flag to have the preset level, and the preset level is a high level; and The processing unit resets the first flag to have a low level when the second POST procedure is completed, so as to indicate that the second POST procedure is completed by the first flag.

4. The method for recording boot error information as claimed in claim 3, wherein in the second boot self-test procedure, It is characterized in that The boot error information recording method further comprises: after setting the first flag to the preset level of the high level, the processing unit further resets the first flag to a low level when the server device needs to perform a warm reset.

5. The method for recording boot error information as claimed in claim 2, wherein in the second boot self-test procedure, It is characterized in that The boot error information recording method further includes: When the processing unit determines that an error occurs in the first POST procedure according to the first flag, the processing unit sets a second flag stored in the third address space to have a high level to indicate that an error occurs in the first POST procedure executed last time; The processing unit determines whether the second flag has a high level when the write function is ready; When the second flag is at a high level, the processing unit writes the boot error information into the basic input and output system memory; and The processing unit resets the second flag to have a low level after the boot error information is written into the basic input and output system memory.

6. The method for recording boot error information as claimed in claim 5, wherein in the second boot self-test procedure, It is characterized in that The boot error information recording method further includes: when the processing unit determines that no error occurs in the first boot self-test program according to the first flag and the processing unit determines that the second flag is not at a high level, the processing unit determines whether the second boot self-test program currently being executed is completed and determines whether the server device needs to be warm reset to decide whether to reset the first flag.

7. The method for recording boot error information as claimed in claim 2, wherein in the second boot self-test procedure, It is characterized in that The boot error information recording method further includes: After determining whether an error occurs in the first POST procedure executed last time and before executing the subroutines, the processing unit generates a checksum based on the data in the third address space; The processing unit determines whether the complementary metal oxide semiconductor memory is damaged according to the checksum before determining whether the first power-on self-test program executed last time has an error; and If the complementary metal oxide semiconductor memory is not damaged, the processing unit starts to determine whether an error occurs in the first power-on self-test program executed last time.

8. The method for recording startup error information according to claim 7, It is characterized in that In the step of calculating the checksum by the processing unit, the processing unit stores the checksum in a fourth address space of the complementary metal oxide semiconductor memory.

9. The method for recording startup error information according to claim 1, It is characterized in that Some of the subroutines contain different debugging codes.

10. The method for recording startup error information according to claim 8, It is characterized in that The step of the processing unit writing the debug code of the executed subroutine into the first address space comprises: The processing unit executes each of the subroutines in sequence; and The processing unit writes the debug code of the executed subroutine into the first address space each time the subroutine is executed, so as to cover the different debug code in the first address space.

Citation Information

Patent Citations

  • Error event reporting system and method during power on self test

    CN107357694A

  • Debugging device of server and debugging method thereof

    CN109117299A

  • Program trace management device, program trace management method and program

    JP2013025559A

  • Error reporting function control method for server device

    TW201944259A

  • Hang-up information recording method

    TW202113598A