Method for storing basic input and output system debugging information

By creating a storage block in the BIOS and using divided storage or compression technology, the problem of slow output of BIOS debugging information and the need for serial line output is solved, achieving fast and convenient collection of debugging information, improving efficiency and Convenience.

CN113760585BActive Publication Date: 2024-09-06MITAC COMP (SHUN DE) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010490308.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-02
Publication Date
2024-09-06
Estimated Expiration
2040-06-02

AI Technical Summary

Technical Problem

The existing BIOS debugging method is slow in outputting debugging messages through the serial port, which affects efficiency, and requires a serial line to connect to another computer, which is really inconvenient.

Method used

Multiple storage blocks are created through the computer device, and BIOS debugging information is stored using split storage and compression technology, and the debugging information is transferred to the second storage module during the driver stage to avoid serial port output.

Benefits of technology

It realizes the quick and convenient collection of complete debugging information, improves debugging efficiency and convenience, and ensures the authenticity and completeness of debugging information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760585B
    Figure CN113760585B
Patent Text Reader

Abstract

A method for storing debugging messages of a basic input / output system, implemented by a computer device, includes the following steps: (A) performing an initialization BIOS routine to establish multiple storage blocks; (B) when the next BIOS routine is the debugging message output routine, and the BIOS is in an initialization phase, determining whether a debugging message needs to be stored in the storage blocks based on a storage parameter value, a storage index value, and an output message count; (C) when it is determined that the debugging message needs to be stored, storing the debugging message and updating the output message count; (D) when it is determined that the debugging message does not need to be stored, updating the output message count; (E) when the next BIOS routine is the start routine of the driver phase, storing all the debugging messages stored in the storage blocks into a second storage module.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a debugging method, and in particular to a method for storing debugging information of a basic input and output system. [Background technology]

[0002] The Basic Input / Output System (BIOS) is a firmware that performs hardware initialization during the power-on phase and provides runtime services for the operating system and programs. If you want to debug the BIOS program code, the existing debugging method usually operates the BIOS boot program in a debugging mode. During the boot process, the debugging message will be output to another computer via the serial port. Engineers can find out the cause of the problem based on these debugging messages. However, the existing debugging method has several disadvantages: 1. The speed of outputting debugging messages from the serial port is very slow, which seriously affects the debugging efficiency; 2. The slow transmission speed of the serial port will also change the time sequence of program code execution, causing the original problem to be debugged to disappear or new problems to arise; 3. It is inconvenient to use a serial line to connect to another computer to collect debugging messages, so there are still many areas for improvement in the existing debugging method. [Summary of the invention]

[0003] The technical problem to be solved by the present invention is to provide a method for storing debugging information of a basic input / output system which is effective, convenient and capable of completely obtaining all debugging information.

[0004] In order to solve the above technical problems, the method for storing debugging information of a basic input and output system of the present invention is implemented by a computer device, the computer device comprising a first storage module, a second storage module and a processing module electrically connected to the first storage module and the second storage module. The method for storing debugging information of a basic input and output system comprises the following steps:

[0005] (A) performing a basic input / output system initialization routine by the processing module to establish a plurality of storage blocks in the first storage module, and setting a storage parameter value indicating the number of storage times of the debug message and a storage index value, and initializing an output message number;

[0006] (B) executing the next basic input / output system routine by the processing module;

[0007] (C) when the next BIOS routine is a debug message output routine and the BIOS is in an initialization phase, determining by the processing module whether to store a debug message output by the debug message output routine according to the storage parameter value, the storage index value and the output message number;

[0008] (D) When the processing module determines that the debugging message needs to be stored, the processing module stores the debugging message in the storage blocks, updates the output message number, and returns to step (B);

[0009] (E) when the processing module determines that the debugging message does not need to be stored, the processing module updates the output message number and returns to step (B);

[0010] (F) when the next BIOS routine is a start routine of a driving stage, the processing module stores all the debugging messages stored in the storage blocks to the second storage module, and returns to step (B);

[0011] (G) when the next BIOS routine is a loading OS routine, determining by the processing module whether the shared storage parameter value is one; and

[0012] (H) When the processing module determines that the storage parameter value is not one, the storage index value is updated by the processing module.

[0013] In order to solve the above technical problems, the method for storing debugging information of a basic input and output system of the present invention is implemented by a computer device, the computer device comprising a first storage module, a second storage module and a processing module electrically connected to the first storage module and the second storage module. The method for storing debugging information of a basic input and output system comprises the following steps:

[0014] (A) performing, by the processing module, an initialization basic input / output system routine to establish a plurality of storage blocks in the first storage module, set an estimated total number of messages, and initialize an output message number;

[0015] (B) executing the next basic input / output system routine by the processing module;

[0016] (C) when the next BIOS routine is the debug message output routine and the BIOS is in an initialization phase, the processing module stores a debug message output by the debug message output routine in the storage blocks and updates the output message count;

[0017] (D) determining by the processing module whether it is necessary to compress the debugging messages stored in the storage blocks according to the total number of messages, the number of output messages and the remaining storage space of the storage blocks;

[0018] (E) when the processing module determines that the debugging messages stored in the storage blocks need to be compressed, the processing module compresses the uncompressed debugging messages stored in the storage blocks, records the length of the compressed messages, and returns to step (B); and

[0019] (F) When the next BIOS routine is a start routine of a driving stage, the processing module stores all the debugging messages stored in the storage blocks to the second storage module, and returns to step (B).

[0020] Compared with the prior art, the present invention uses the computer device to establish multiple storage blocks and use batch storage or compression technology to store all the debugging messages generated in the initialization stage, and in the starting routine of the driving stage, all the debugging messages stored in the storage blocks are transferred to the second storage module, and the debugging messages generated in the driving stage are also stored in the second storage module, so that both the debugging messages generated in the initialization stage and the debugging messages generated in the driving stage can be obtained from the second storage module without being output to another computer through a serial port. In this way, the obtained debugging messages are complete and truly reflected debugging messages. In addition, by directly storing the debugging messages in the second storage modules without having to output them through a serial line, the efficiency and convenience of collecting debugging messages can be greatly improved.

Brief Description of the Drawings

[0021] Other features and effects of the present invention will be clearly presented in the embodiments with reference to the accompanying drawings, in which:

[0022] Figure 1 is a block diagram illustrating a computer device implementing a first embodiment of the method for storing basic input and output system debugging information of the present invention;

[0023] Figure 2 and 3 The first embodiment of the method for storing debugging information of a basic input and output system of the present invention is described in conjunction with the above;

[0024] Figure 4 is a block diagram illustrating a computer device implementing a second embodiment of the method for storing debugging information of a basic input and output system of the present invention;

[0025] Figure 5 and 6 A second embodiment of the method for storing debugging information of a basic input / output system according to the present invention is described in conjunction with the present invention;

[0026] Figure 7 is a flow chart illustrating the detailed process of how the processing module of the computer device of the present invention determines whether to compress the debugging information; and

[0027] Figure 8 It is a flow chart illustrating how the processing module of the computer device of the present invention stores all the debugging information stored in a plurality of storage blocks into a second storage module. [Specific implementation method]

[0028] Before the present invention is described in detail, it should be noted that similar components are denoted by the same reference numerals in the following description.

[0029] See also Figure 1 A first embodiment of the method for storing debugging information of a basic input / output system of the present invention is implemented by a computer device 1. The computer device 1 includes a temporary storage module 11, a first storage module 12, a second storage module 13, a third storage module 14, and a processing module 15 electrically connected to the temporary storage module 11, the first storage module 12, the second storage module 13, and the third storage module 14. In this embodiment, the temporary storage module 11 is, for example, a register, the first storage module 12 is, for example, a cache, which may also be included in the processing module 15, the second storage module 13 is, for example, a main memory, the third storage module 14 is, for example, a flash memory, and the processing module 15 is, for example, a central processing unit.

[0030] The following will describe a first embodiment of the method for storing basic input and output system debugging information implemented by the computer device 1 according to the present invention with reference to the accompanying drawings. Figure 1 , Figure 2 and Figure 3 A first embodiment of the method for storing debugging information of a basic input / output system of the present invention includes the following steps.

[0031] In step 201, the processing module 15 performs an initialization BIOS routine to establish a plurality of storage blocks in the first storage module 12, store the addresses of the storage blocks in the temporary storage module 11, set a storage parameter value indicating the number of storage times of the debugging message and a storage index value, set an estimated total number of messages, and initialize an output message number. In this embodiment, each storage block is, for example, a hand off block (HOB).

[0032] It is worth noting that the storage parameter value can be defined as a preset number of times and the processing module 15 automatically sets the storage parameter value to the preset number of times, or an administrator can input the storage number of times based on previous debugging experience, and the processing module 15 sets the storage parameter value according to the storage number of times input by the administrator, but the invention is not limited thereto. In addition, in the present embodiment, since the third storage module 14 is a flash memory, the data stored in the third storage module 14 will not disappear due to power off, so the storage index value is also stored in the third storage module 14, so each time the processing module 15 performs the initialization basic input and output system routine to set the storage index value, the processing module 15 will set the storage index value according to the storage index value stored in the third storage module 14.

[0033] In step 202 , the processing module 15 performs the next BIOS routine.

[0034] In step 203, the processing module 15 determines whether the next BIOS routine is a debug message output routine. When the processing module 15 determines that the next BIOS routine is the debug message output routine, the process proceeds to step 204; when the processing module 15 determines that the next BIOS routine is not the debug message output routine, the process proceeds to step 211.

[0035] In step 204, the processing module 15 determines whether the basic input and output system is in an initialization stage (i.e., pre-EFI stage, referred to as PEI stage, where the full name of EFI is Extensible Firmware Interface) according to the data stored in the temporary storage module 11. When the processing module 15 determines that the basic input and output system is in the initialization stage, the process proceeds to step 205; when the processing module 15 determines that the basic input and output system is not in the initialization stage, the process proceeds to step 208. Among them, the processing is to determine whether the basic input and output system is in the initialization stage module by determining whether the temporary storage module 11 stores the addresses of the storage blocks. When the processing determines that the temporary storage module 11 stores the addresses of the storage blocks, the processing module 15 determines that the basic input and output system is in the initialization stage; when the processing determines that the temporary storage module 11 does not store the addresses of the storage blocks, the processing module 15 determines that the basic input and output system is not in the initialization stage.

[0036] In step 205, the processing module 15 determines whether to store a debug message output by the debug message output routine according to the storage sharing parameter value, the storage index value and the output message number. When the processing module 15 determines that the debug message needs to be stored, the process proceeds to step 206; when the processing module 15 determines that the debug message does not need to be stored, the process proceeds to step 207. The processing module 15 determines whether to store a debug message output by the debug message output routine by calculating a remainder of the output message number divided by the storage sharing parameter value and determining whether the remainder is equal to the storage index value. When the processing module 15 determines that the remainder is equal to the storage index value, it means that the debug message needs to be stored; when the processing module 15 determines that the remainder is not equal to the storage index value, it means that the debug message does not need to be stored. For example, if the storage parameter value is 4, the current storage index value is 2, and the 19th debug message is currently output (that is, the number of output messages is 19), then the remainder of the number of output messages divided by the storage parameter value is 3. Since the storage index value is 2 at this time, the remainder 3 is not equal to the storage index value 2, so the 19th debug message does not need to be stored this time.

[0037] In step 206, the processing module 15 stores the debug message in the storage blocks and updates the output message number (i.e., the output message number is increased by one). It is worth mentioning that in the present embodiment, each time the debug message is stored, the currently stored debug message is appended to the previously stored debug message. Each time after the debug message is stored, the processing module 15 updates a message length, so that the next time the next debug message is to be stored in the storage blocks, the processing module 15 stores the next debug message at an address obtained by adding the message length to a base address, and then adds the length of the next debug message to the message length to update the message length.

[0038] In step 209, the processing module 15 determines whether to compress the debugging messages stored in the storage blocks according to the total number of messages, the number of output messages, and the remaining storage space of the storage blocks. When the processing module 15 determines that the debugging messages stored in the storage blocks need to be compressed, the process proceeds to step 210; when the processing module 15 determines that the debugging messages stored in the storage blocks do not need to be compressed, the process returns to step 202.

[0039] It is worth mentioning that step 209 includes the following sub-steps (see Figure 7 ).

[0040] In sub-step 501, the processing module 15 calculates a ratio of messages to be stored according to the total number of messages and the number of output messages. The processing module 15 subtracts the number of output messages from the total number of messages to obtain a number of messages to be stored, and then divides the number of messages to be stored by the total number of messages to obtain the ratio of messages to be stored.

[0041] In sub-step 502, the processing module 15 calculates a remaining storage space ratio according to the remaining storage space of the storage blocks and the total storage space of the storage blocks. The processing module 15 divides the remaining storage space of the storage blocks by the total storage space of the storage blocks to obtain the remaining storage space ratio.

[0042] In sub-step 503, the processing module 15 determines whether the remaining storage space ratio is less than the waiting-to-store message ratio, so as to determine whether the debugging messages stored in the storage blocks need to be compressed. When it is determined that the remaining storage space ratio is less than the waiting-to-store message ratio, it means that the debugging messages stored in the storage blocks need to be compressed, so the process proceeds to step 210; when it is determined that the remaining storage space ratio is not less than the waiting-to-store message ratio, it means that the debugging messages stored in the storage blocks do not need to be compressed, so the process proceeds to step 202.

[0043] In step 210 , the processing module 15 compresses the uncompressed debugging messages stored in the storage blocks, records the length of the compressed messages, and returns to step 202 .

[0044] In step 207 , the processing module 15 updates the output message number (ie, increases the output message number by 1), and returns to step 202 .

[0045] In step 208 , the processing module 15 stores the debugging message output by the debugging message output routine in the second storage module 13 , and returns to step 202 .

[0046] In step 211, the processing module 15 determines whether the next BIOS routine is a start routine of a driver stage (i.e., DXE stage, where DXE stands for Driver Execution Environment). When the processing module 15 determines that the next BIOS routine is a start routine of the driver stage, the process proceeds to step 212; when the processing module 15 determines that the next BIOS routine is not a start routine of the driver stage, the process proceeds to step 213.

[0047] In step 212, the processing module 15 stores all the debugging messages stored in the storage blocks to the second storage module 13, resets the data stored in the temporary storage module 11, and returns to step 202. In this embodiment, the processing module 15 deletes the data stored in the temporary storage module 11 to reset the data stored in the temporary storage module 11. It is worth mentioning that after the computer device 1 enters the DXE stage, it means that the initialization of the second storage module 13 has been completed and can be used, so all the debugging messages stored in the storage blocks can be transferred to the second storage module 13.

[0048] It is worth mentioning that step 212 also includes the following sub-steps (see Figure 8 ).

[0049] In sub-step 601, the processing module 15 decompresses the compressed debugging messages stored in the storage blocks according to the compressed message length recorded during each compression. In this embodiment, the processing module 15 uses an array to store the compressed message length of each compressed debugging message.

[0050] In sub-step 602 , the processing module 15 stores all the decompressed debugging messages in the second storage module 13 , resets the data stored in the temporary storage module 11 , and returns to step 202 .

[0051] It is worth mentioning that in the present embodiment, the decompression process is performed in step 601; however, in other embodiments, the decompression process can also be performed when the administrator wants to view the debugging message after booting, so as to save the decompression time during the booting process. At this time, in step 212, the processing module 15 stores all the debugging messages stored in the storage blocks and the compressed message length recorded during each compression to the second storage module 13 for subsequent decompression.

[0052] In step 213, the processing module 15 determines whether the next BIOS routine is a loading operating system routine. When the processing module 15 determines that the next BIOS routine is the loading operating system routine (that is, the BIOS routine has ended), the process proceeds to step 214; when the processing module 15 determines that the next BIOS routine is not the loading operating system routine, the process returns to step 202.

[0053] In step 214, the processing module 15 determines whether the shared storage parameter value is 1. When the processing module 15 determines that the shared storage parameter value is 1, the process ends (that is, the Power-On Self-Test (POST) process ends); when the processing module 15 determines that the shared storage parameter value is not 1, the process proceeds to step 215.

[0054] In step 215, the processing module 15 further determines whether the storage index value is equal to the storage parameter value minus 1. When the processing module 15 determines that the storage index value is equal to the storage parameter value minus 1 (this indicates that the debugging information that needs to be stored in batches has been stored), the process proceeds to step 216; when the processing module 15 determines that the storage index value is not equal to the storage parameter value minus 1 (this indicates that the debugging information that needs to be stored in batches has not been stored), the process proceeds to step 217.

[0055] In step 216 , the processing module 15 resets the storage index value stored in the third storage module 14 to zero, and ends the POST process.

[0056] In step 217 , the processing module 15 increases the storage index value stored in the third storage module 14 by one to update the storage index value, and ends the POST process.

[0057] It is worth mentioning that when the storage parameter value is not 1, it means that the debugging messages generated during the initialization phase need to be stored in batches to ensure that all debugging messages generated during the initialization phase can be completely retained. Since the storage space of the storage blocks is limited, when there are too many debugging messages generated during the initialization phase, they need to be stored in batches. For example, if there are 1000 debugging messages generated during the initialization phase, and the storage parameter value is set to 2, it means that all debugging messages generated during the initialization phase must be stored in two batches. Therefore, when the steps of the method for storing debugging messages of the basic input and output system of the present invention are performed for the first time, the storage index value is set to 0, so the debugging message stored is the 2nth debugging message output, n = 1, 2, 3, ..., 499, 500, that is, the debugging message stored when the debugging messages of the basic input and output system are stored for the first time. The debug messages stored are the 2nd, 4th, 6th, 8th, ... debug messages. Then, when the computer device 1 is restarted to perform the steps of the method for storing debug messages of the basic input / output system of the present invention again (i.e., the second time), the storage index value is set to 1, so the debug message stored is the 2m+1th debug message output, m=0, 1, 2, ..., 498, 499, that is, the debug messages stored when storing the debug messages of the basic input / output system for the second time are the 1st, 3rd, 5th, 7th, ... debug messages.In the case where the BIOS program code has not been modified, the debugging message is reproducible, and the same debugging message will appear again at the next restart. Therefore, the first time the method of storing debugging messages of the basic input and output system of the present invention is performed, only half of the debugging messages generated in the initialization stage are stored, that is, the 2nd, 4th, 6th, 8th, ... debugging messages are stored. When step 215 of storing debugging messages of the basic input and output system is performed for the first time, the storage parameter value is 2, and the storage index value is 0. Since the storage index value is equal to zero and not equal to the storage parameter value minus one (2-1=1), it means that the debugging messages that need to be stored in batches have not been stored yet. Therefore, the process will proceed to step 217 to increase the storage index value by one (0+1=1), and the method of storing debugging messages of the basic input and output system of the present invention will be performed for the second time at the next restart. The other half of the debugging messages generated in the initialization phase is stored only when the first, third, fifth, seventh, ... debugging messages are stored. When the step 215 of storing the debugging messages of the basic input / output system is performed for the second time, the storage parameter value is 2, and the storage index value is 1. Since the storage index value is equal to one and equal to the storage parameter value minus one (2-1=1), it means that the debugging messages that need to be stored in batches have been stored. Therefore, the process will proceed to step 216 to reset the storage index value to zero. By means of the above-mentioned storage in batches, all the debugging messages generated in the initialization phase can be completely stored while satisfying the storage space limit of the storage blocks. In other words, when the method of storing the debugging messages of the basic input / output system of the present invention is repeated the number of times reaching the storage parameter value, all the debugging messages generated in the initialization phase can be completely stored. It is worth mentioning that in this embodiment, the processing module 15 also performs steps 209-210 to compress the debugging messages stored in the storage blocks; however, in other embodiments of the present invention, the processing module 15 may not perform steps 209-210, and the total number of messages is not set in step 201, and all debugging messages generated in the initialization stage are simply stored in a distributed manner. An important purpose of the present invention is to "store all debugging messages of the BIOS program code during the boot process to the second storage module 13", so in terms of step design, the present invention includes two major storage procedures, because the second storage module 13 (that is, the main memory) has not yet been initialized when the computer is just turned on, that is, the PEI stage. In the PEI stage, the present invention performs a first storage procedure, in which the debugging information is temporarily stored in those storage blocks (HOB). After the second storage module 13 is initialized, that is, the DXE stage, the present invention enters the second storage procedure. After entering the DXE stage, the debugging information temporarily stored in those storage blocks can be stored in the second storage module 13.After entering the DXE stage, since the second storage module 13 has been initialized, all debug messages outputted thereafter can be stored in the second storage module 13 .

[0058] See also Figure 4 A second embodiment of the method for storing debugging information of a basic input / output system of the present invention is implemented by another computer device 1, which is substantially the same as the computer device 1, except that the computer device 1 does not need to include the third storage module 14.

[0059] See also Figure 4 , Figure 5 and Figure 6 A second embodiment of the method for storing debugging information of a basic input / output system of the present invention includes the following steps.

[0060] In step 401 , the processing module 15 performs an initialization BIOS routine to create a plurality of storage blocks in the first storage module 12 , store the addresses of the storage blocks in the temporary storage module 11 , set an estimated total number of messages, and initialize an output message number.

[0061] In step 402 , the processing module 15 performs the next BIOS routine.

[0062] In step 403, the processing module 15 determines whether the next BIOS routine is the debug message output routine. When the processing module 15 determines that the next BIOS routine is the debug message output routine, the process proceeds to step 404; when the processing module 15 determines that the next BIOS routine is not the debug message output routine, the process proceeds to step 409.

[0063] In step 404, the processing module 15 determines whether the basic input and output system is in the initialization stage (i.e., the pre-EFI stage, referred to as the PEI stage, where the full name of EFI is Extensible Firmware Interface) according to the data stored in the temporary storage module 11. When the processing module 15 determines that the basic input and output system is in the initialization stage, the process proceeds to step 405; when the processing module 15 determines that the basic input and output system is not in the initialization stage, the process proceeds to step 408. Among them, the processing is to determine whether the basic input and output system is in the initialization stage module by determining whether the temporary storage module 11 stores the addresses of the storage blocks. When the processing determines that the temporary storage module 11 stores the addresses of the storage blocks, the processing module 15 determines that the basic input and output system is in the initialization stage; when the processing determines that the temporary storage module 11 does not store the addresses of the storage blocks, the processing module 15 determines that the basic input and output system is not in the initialization stage.

[0064] In step 405, the processing module 15 stores a debugging message output by the debugging message output routine in the storage blocks, and updates the output message number.

[0065] In step 406, the processing module 15 determines whether to compress the debugging messages stored in the storage blocks according to the total number of messages, the number of output messages, and the remaining storage space of the storage blocks. When the processing module 15 determines that the debugging messages stored in the storage blocks need to be compressed, the process proceeds to step 407; when the processing module 15 determines that the debugging messages stored in the storage blocks do not need to be compressed, the process returns to step 402.

[0066] Similar to the first embodiment, step 406 includes sub-steps 501 to 503 (see Figure 7 ), the only difference is that when it is determined that the remaining storage space ratio is less than the ratio of messages to be stored, the process proceeds to step 407; when it is determined that the remaining storage space ratio is not less than the ratio of messages to be stored, the process proceeds to step 402.

[0067] In step 407 , the processing module 15 compresses the uncompressed debugging messages stored in the storage blocks, records the length of the compressed messages, and returns to step 402 .

[0068] In step 408 , the processing module 15 stores the debugging message output by the debugging message output routine in the second storage module 13 , and returns to step 402 .

[0069] In step 409, the processing module 15 determines whether the next BIOS routine is the start routine of the driving stage (i.e., the DXE stage). When the processing module 15 determines that the next BIOS routine is the start routine of the driving stage, the process proceeds to step 410; when the processing module 15 determines that the next BIOS routine is not the start routine of the driving stage, the process proceeds to step 411.

[0070] In step 410 , the processing module 15 stores all the debugging information stored in the storage blocks to the second storage module 13 , resets the data stored in the temporary storage module 11 , and returns to step 402 .

[0071] Similar to the first embodiment, step 410 includes sub-steps 601-602 (see Figure 8 ), the only difference is that after step 602, the process returns to step 402.

[0072] In step 411, the processing module 15 determines whether the next BIOS routine is the operating system loading routine. When the processing module 15 determines that the next BIOS routine is the operating system loading routine, the process ends (that is, the POST process ends); when the processing module 15 determines that the next BIOS routine is not the operating system loading routine, the process returns to step 402.

[0073] In summary, the method for storing debug messages of the basic input / output system of the present invention is to store all debug messages generated in the initialization phase by the computer device 1 through establishing multiple storage blocks and using the storage or compression technology in batches, and to transfer all debug messages stored in the storage blocks to the second storage module 13 in the start routine of the driving phase, and the debug messages generated in the driving phase are also stored in the second storage module 13, so that both the debug messages generated in the initialization phase and the debug messages generated in the driving phase can be obtained from the second storage module 13, without having to be output to another computer via a serial port. Thus, the debug messages obtained are complete and truly reflective debug messages. In addition, the debug message acquisition method of the present invention is not only very efficient but also very convenient compared to the previous method of using a serial line to connect to another computer to collect debug messages, so it can indeed achieve the purpose of the present invention.

[0074] However, the above is only an embodiment of the present invention and should not be used to limit the scope of the present invention. All simple equivalent changes and modifications made according to the claims and the patent specification of the present invention are still within the scope of the present invention.

Claims

1. A method for storing debugging information of a basic input / output system, implemented by a computer device, the computer device comprising a first storage module, a second storage module and a processing module electrically connected to the first storage module and the second storage module, characterized in that: The method for storing debugging information of a basic input / output system comprises the following steps: (A) performing a basic input / output system initialization routine by the processing module to establish a plurality of storage blocks in the first storage module, and setting a storage parameter value indicating the number of storage times of the debug message and a storage index value, and initializing an output message number; (B) executing the next basic input / output system routine by the processing module; (C) when the next BIOS routine is a debug message output routine and the BIOS is in an initialization phase, determining by the processing module whether to store a debug message output by the debug message output routine according to the storage parameter value, the storage index value and the output message number; (D) when the processing module determines that the debugging message needs to be stored, the processing module stores the debugging message in the plurality of storage blocks, updates the output message number, and returns to step (B); (E) when the processing module determines that the debugging message does not need to be stored, the processing module updates the output message number and returns to step (B); (F) when the next BIOS routine is a start routine of a driving phase, storing all debug messages stored in the plurality of storage blocks to the second storage module by the processing module, and returning to step (B); (G) when the next BIOS routine is a loading OS routine, determining by the processing module whether the shared storage parameter value is 1; and (H) When the processing module determines that the storage parameter value is not 1, the storage index value is updated by the processing module.

2. The method for storing debugging information of a basic input / output system as claimed in claim 1, wherein the computer device further comprises a temporary storage module electrically connected to the processing module, wherein: In step (A), the processing module also stores the addresses of the plurality of storage blocks in the temporary storage module; In step (C), the processing module determines whether the basic input and output system is in the initialization stage by determining whether the temporary storage module stores the addresses of the plurality of storage blocks; and In step (F), the processing module also resets the data stored in the temporary storage module.

3. The method for storing debugging information of a basic input / output system as claimed in claim 2, characterized in that: In step (C), when the basic input and output system is not in the initialization stage, the processing module stores the debugging message output by the debugging message output routine in the second storage module, and returns to step (B).

4. The method for storing debugging information of a basic input / output system as claimed in claim 1, wherein: In step (C), the processing module determines whether to store a debug message output by the debug message output routine by calculating a remainder of the output message number divided by the storage parameter value and determining whether the remainder is equal to the storage index value.

5. The method for storing debugging information of a basic input / output system as claimed in claim 4, wherein between step (G) and step (H), It also includes the following steps: (I) when the processing module determines that the storage parameter value is not one, the processing module further determines whether the storage index value is equal to the storage parameter value minus one; and (J) when the processing module determines that the storage index value is equal to the storage parameter value minus one, resetting the storage index value to zero by the processing module; Wherein, in step (H), when the processing module determines that the storage parameter value is not one and the storage index value is not equal to the storage parameter value minus one, the processing module increases the storage index value by one to update the storage index value.

6. The method for storing debugging information of a basic input / output system as claimed in claim 1, wherein: In step (A), the processing module performs the initialization BIOS routine and sets an estimated total number of messages, and step (D) further includes the following sub-steps: (D-1) When the processing module determines that the debugging message needs to be stored, the processing module stores the debugging message in the plurality of storage blocks and updates the output message number; (D-2) determining, by the processing module, whether it is necessary to compress the debugging messages stored in the plurality of storage blocks according to the total number of messages, the number of output messages, and the remaining storage space of the plurality of storage blocks; and (D-3) When the processing module determines that the debugging messages stored in the multiple storage blocks need to be compressed, the processing module compresses the uncompressed debugging messages stored in the multiple storage blocks, records the length of the compressed messages, and returns to step (B).

7. The method for storing debugging information of a basic input / output system as claimed in claim 6, characterized in that: Step (D-2) comprises the following sub-steps: (D-2-1) The processing module calculates a ratio of messages to be stored according to the total number of messages and the number of output messages; (D-2-2) the processing module calculates a remaining storage space ratio according to the remaining storage space of the plurality of storage blocks and the total storage space of the plurality of storage blocks; and (D-2-3) The processing module determines whether the remaining storage space ratio is less than the to-be-stored message ratio, so as to determine whether it is necessary to compress the debugging messages stored in the plurality of storage blocks.

8. The method for storing debugging information of a basic input / output system as claimed in claim 7, wherein: Step (F) comprises the following sub-steps: (F-1) when the next BIOS routine is the start routine of the driving stage, the processing module decompresses the compressed debugging messages stored in the plurality of storage blocks according to the compressed message length recorded during each compression; and (F-2) The processing module stores all the decompressed debugging information in the second storage module and returns to step (B).

9. A method for storing debugging information of a basic input / output system, implemented by a computer device, the computer device comprising a first storage module, a second storage module and a processing module electrically connected to the first storage module and the second storage module, characterized in that: The method for storing debugging information of a basic input / output system comprises the following steps: (A) performing, by the processing module, an initialization basic input / output system routine to establish a plurality of storage blocks in the first storage module, set an estimated total number of messages, and initialize an output message number; (B) executing the next basic input / output system routine by the processing module; (C) when the next BIOS routine is a debug message output routine and the BIOS is in an initialization phase, the processing module stores a debug message output by the debug message output routine in the plurality of storage blocks and updates the output message count; (D) determining by the processing module whether it is necessary to compress the debugging messages stored in the plurality of storage blocks according to the total number of messages, the number of output messages, and remaining storage space of the plurality of storage blocks; (E) when the processing module determines that the debugging messages stored in the plurality of storage blocks need to be compressed, the processing module compresses the uncompressed debugging messages stored in the plurality of storage blocks, records the length of the compressed messages, and returns to step (B); and (F) When the next BIOS routine is a start routine of a driving phase, the processing module stores all debug messages stored in the plurality of storage blocks to the second storage module, and returns to step (B).

10. The method for storing debugging information of a basic input / output system as claimed in claim 9, wherein the computer device further comprises a temporary storage module, characterized in that: In step (A), the processing module also stores the addresses of the plurality of storage blocks in the temporary storage module; In step (C), the processing module determines whether the basic input and output system is in the initialization stage by determining whether the temporary storage module stores the addresses of the plurality of storage blocks; and In step (F), the processing module also resets the data stored in the temporary storage module.

11. The method for storing debugging information of a basic input / output system as claimed in claim 9, wherein: In step (C), when the basic input and output system is not in the initialization stage, the processing module stores the debugging message output by the debugging message output routine in the second storage module, and returns to step (B).

12. The method for storing debugging information of a basic input / output system as claimed in claim 9, wherein: Step (D) comprises the following sub-steps: (D-1) the processing module calculates a ratio of messages to be stored according to the total number of messages and the number of output messages; (D-2) the processing module calculates a remaining storage space ratio according to the remaining storage space of the plurality of storage blocks and the total storage space of the plurality of storage blocks; and (D-3) The processing module determines whether the remaining storage space ratio is less than the to-be-stored message ratio, so as to determine whether the debugging messages stored in the plurality of storage blocks need to be compressed.

13. The method for storing debugging information of a basic input / output system as claimed in claim 9, wherein: Step (F) comprises the following sub-steps: (F-1) when the next BIOS routine is the start routine of the driving stage, the processing module decompresses the compressed debugging messages stored in the plurality of storage blocks according to the compressed message length recorded during each compression; and (F-2) The processing module stores all the decompressed debugging information in the second storage module and returns to step (B).