Method and system for printing Debug through BIOS and computer storage medium

By storing debug logs in non-volatile memory during the BIOS runtime phase and reading them through the operating system interface, the problems of slow boot times and difficulty in reproducing issues in debug BIOS versions are solved, achieving efficient debugging without recompiling or rewiring.

CN122044975APending Publication Date: 2026-05-15SHENZHEN CITY MAIDIJIE ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610137904.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, Debug versions of BIOS have slow boot times, and problems are difficult to reproduce in Debug mode.

Method used

During BIOS operation, debug logs are stored in a designated area of ​​non-volatile memory. A log read request is sent through the operating system's management interface, triggering a system management interrupt. The system then enters management mode to read and return the debug logs to the operating system for parsing.

Benefits of technology

No need to recompile the BIOS version or physical wiring, the boot speed remains unchanged, making it easier to reproduce and analyze problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122044975A_ABST
    Figure CN122044975A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computers, and discloses a method and a system for printing Debug by a BIOS (Basic Input / Output System) and a computer storage medium, and the method comprises the following steps: storing a generated debugging log into a specified data area of a nonvolatile memory in a firmware running stage of a computer terminal; sending a log reading request to the firmware of the computer terminal through a management interface of the operating system in an operating stage of the operating system; triggering system management interruption based on the log reading request, and enabling a processor to enter a system management mode and execute a log processing program in computer terminal firmware; reading the debugging log from the specified data area by utilizing the log processing program; and returning the debugging log to the operating system through the management interface so as to analyze and present the debugging log in the operating system. According to the method, the BIOS of the Debug version does not need to be recompiled, a serial port debugging line does not need to be connected, the starting-up speed is not influenced, and recurrence analysis of problems is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer system startup and debugging technology, and in particular to a method, system, and computer storage medium for BIOS print debug. Background Technology

[0002] For BIOS professionals, printing debug logs is often necessary to assist in problem analysis during motherboard debugging. The common practice is to use UART (serial port) to print the log, which requires two conditions: 1. A debug version of the BIOS firmware needs to be compiled specifically. 2. The target motherboard needs to be connected to the host machine via a UART cable, and the log information needs to be displayed on the host machine.

[0003] This method has the following disadvantages: On the one hand, the boot speed of the Debug version of the BIOS is very slow, several times slower than that of the normal BIOS; on the other hand, some problems are less likely to be reproduced because the boot speed is slower when Debug mode is enabled. Summary of the Invention

[0004] The purpose of this application is to provide a method, system, and computer storage medium for printing BIOS debug information, in order to solve the problem that the boot speed of the debug version of the BIOS is very slow in the prior art, and that some problems are not easy to reproduce because the boot speed is slowed down when the debug mode is turned on.

[0005] The embodiments of this application adopt the following technical solutions: This application provides a method for printing debug information in BIOS, the method comprising: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory; During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface; The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The debug log is read from the specified data area using the log processing program. The debugging logs are returned to the operating system through the management interface, so that the debugging logs can be parsed and presented under the operating system.

[0006] This application embodiment also provides a BIOS debugging printing system, the BIOS debugging printing system comprising: The storage module stores the generated debug logs into a designated data area of ​​non-volatile memory during the firmware execution phase of the computer terminal. During the operating system runtime phase, the sending module sends a log read request to the computer terminal firmware through the management interface of the operating system. The triggering module triggers a system management interrupt based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The reading module uses the log processing program to read the debug log from the specified data area. The parsing module returns the debug logs to the operating system through the management interface, so that the debug logs can be parsed and presented under the operating system.

[0007] This application also provides a computer storage medium, including a program for use in conjunction with an electronic device, the program being executed by a processor to complete the following steps: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory; During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface; The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The debug log is read from the specified data area using the log processing program. The debugging logs are returned to the operating system through the management interface, so that the debugging logs can be parsed and presented under the operating system.

[0008] Based on the BIOS debugging method, system, and computer storage medium in the embodiments of this application, the debugging log is stored in a designated data area of ​​non-volatile memory, and then a log read request is sent to the computer terminal firmware through the management interface of the operating system to trigger a system management interrupt, so that the processor enters the system management mode and executes the log processing program in the computer terminal firmware to read the debugging log from the designated data area, and returns the debugging log to the operating system through the management interface, so as to parse and present the debugging log under the operating system.

[0009] In this way, by adopting a new method, the debug logs are directly saved in the ODR of SPIFlash during the boot process. After entering the OS (operating system), all the logs are then transferred out for analysis using tools. The operation is simple, does not require recompiling the debug version of the BIOS, does not require connecting a serial debugging cable, and does not affect the boot speed, making it easier to reproduce and analyze the problem. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of the embodiments of this specification and form part of the embodiments of this specification, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a BIOS debugging printing method provided in an embodiment of this specification; Figure 2 This is a schematic diagram of the application structure of a system module corresponding to a BIOS print debug method provided in the embodiments of this specification; Figure 3 A schematic diagram of the logical function of the BIOS module corresponding to a BIOS print debug method provided in the embodiments of this specification; Figure 4 This is a schematic diagram of the DebugLog read corresponding to a BIOS Debug printing method provided in the embodiments of this specification; Figure 5 This is a schematic diagram of the Debug Log parsed according to the log format, corresponding to a BIOS debugging method for printing debug data provided in the embodiments of this specification. Figure 6 This is a schematic diagram of the overall logic of the WMI interface corresponding to a BIOS print debug method provided in the embodiments of this specification; Figure 7 This specification provides a schematic diagram of the structure of a BIOS print debug system as an embodiment of the present invention. Figure 8 This is a schematic diagram of the computer storage medium corresponding to a BIOS print debug method provided in an embodiment of this specification. Detailed Implementation

[0011] In existing technologies, obtaining the BIOS runtime debug logs is a key method for locating problems during motherboard and firmware development and debugging. Currently, the industry-standard method is serial port debugging: this requires connecting the target motherboard's universal asynchronous receiver / transmitter interface to the host machine via a serial cable, and then viewing the logs on the host machine using terminal software.

[0012] This method has the following significant drawbacks: Depends on dedicated debug firmware: A dedicated debug version of the BIOS must be compiled and flashed. This version of firmware usually contains a lot of debug code, which causes the system boot speed to drop sharply, up to several times the normal speed.

[0013] Interference problem reproduction: Due to the slower startup speed, the timing state of various system components changes, which may make it impossible to reproduce some timing-related faults, thus masking the real problem.

[0014] The hardware connection is cumbersome: physical wiring is required, which increases the complexity of setting up the debugging environment and is not suitable for server debugging scenarios without peripherals or remote computer rooms.

[0015] Therefore, embodiments of this application provide a method, system, and computer storage medium for printing debug logs in BIOS. By storing debug logs in a designated data area of ​​non-volatile memory, and then sending a log read request to the computer terminal firmware through the management interface of the operating system, a system management interrupt is triggered, causing the processor to enter the system management mode and execute the log processing program in the computer terminal firmware to read debug logs from the designated data area. The debug logs are then returned to the operating system through the management interface for parsing and presentation under the operating system.

[0016] In this way, by adopting a new method, the debug logs are directly saved in the ODR of SPIFlash during the boot process. After entering the OS (operating system), all the logs are then transferred out for analysis using tools. The operation is simple, does not require recompiling the debug version of the BIOS, does not require connecting a serial debugging cable, and does not affect the boot speed, making it easier to reproduce and analyze the problem.

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0019] Please see Figure 1 This is a flowchart illustrating a method for printing debug information in BIOS, as provided in this application embodiment.

[0020] In the embodiments described in this specification, the method for printing BIOS debug messages may specifically include the following steps: S101: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​the non-volatile memory. S103: During the operating system operation phase, a log read request is sent to the computer terminal firmware through the management interface of the operating system; S105: Based on the log read request, a system management interrupt is triggered, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; S107: Use the log processing program to read the debug log from the specified data area; S109: The debugging log is returned to the operating system through the management interface so that the debugging log can be parsed and presented under the operating system.

[0021] In the embodiments of this specification, the debug log is stored in a designated data area of ​​non-volatile memory, and then a log read request is sent to the computer terminal firmware through the management interface of the operating system to trigger a system management interrupt, so that the processor enters the system management mode and executes the log processing program in the computer terminal firmware to read the debug log from the designated data area. The debug log is then returned to the operating system through the management interface so that the debug log can be parsed and presented under the operating system.

[0022] In this way, by adopting a new method, the debug logs are directly saved in the ODR of the SPI Flash during the boot process. After entering the OS (operating system), all the logs are then transferred out for analysis using tools. The operation is simple, does not require recompiling the debug version of the BIOS, does not require connecting a serial port debugging cable, and does not affect the boot speed, making it easier to reproduce and analyze the problem.

[0023] As an application embodiment of this specification, for step S101, during the computer terminal firmware running phase, storing the generated debug log into a designated data area of ​​non-volatile memory may specifically include: The debug log is stored in the designated data area according to a preset data format, wherein the non-volatile memory is SPI flash memory, and the designated data area is the original equipment manufacturer (OEM) data area in the SPI flash memory.

[0024] In the embodiments described in this specification, storing the logs in non-volatile memory allows for subsequent log analysis, making the operation more convenient.

[0025] In specific application scenarios, the designated data area, also known as the ODR area, is a predefined storage space in the firmware used to store non-volatile data.

[0026] ODR: OEM Data Region, is a dedicated space in the SPI flash memory for storing OEM (Original Equipment Manufacturer) data.

[0027] The preset data format includes at least a log header to identify the start of the log, a timestamp to record the time the log was generated, a length field indicating the length of the log content, and the specific log content string.

[0028] Specifically, the log header can be a fixed value used to identify the start of a log record.

[0029] Furthermore, the specified address space within the specified data area is configured as a circular buffer.

[0030] The method further includes: When the circular buffer is full, a new debug log is written in a way that overwrites the oldest record.

[0031] In the embodiments described in this specification, when the log data of the written debug log fills the buffer, the new log data will overwrite the oldest data, thereby realizing continuous cyclic log recording under a fixed storage space.

[0032] Furthermore, when writing the debug logs to the ODR area, a checksum is added to each debug log record.

[0033] By adding a verification code, the log data can be verified and audited during subsequent log reading processes.

[0034] As an application embodiment of this specification, step S103, during the operating system operation phase, involves sending a log read request to the computer terminal firmware through the management interface of the operating system. Specifically, this may include: The debugging tools running on the operating system send the log read request through the management interface.

[0035] In the embodiments described in this specification, the management interface may specifically be the WMI (Windows Management Instrumentation) interface, which can provide a standardized programming interface.

[0036] Debugging tools running on the operating system can specifically call WMI methods described by the ACPI table to send the log read request. The ACPI table can specifically be an ACPI driver.

[0037] Specifically, the debugging tool writes a read command to the input parameter buffer provided by the WMI method; after the method is called, the computer terminal firmware fills the debug log data in the ODR area into the output data buffer associated with the WMI method for the debugging tool to read.

[0038] Furthermore, as an application embodiment of this specification, step S105, triggering a system management interrupt based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware, may specifically include: The log read request triggers the system management interrupt by writing to the specified system port; The log processing program is executed in system management mode, wherein the log processing program is configured to directly access the specified data area in non-volatile memory to read debug logs.

[0039] In the embodiments described in this specification, after the processor receives a system management interrupt signal, it automatically saves the current CPU state and switches to a higher privilege level system management mode, which is a hardware-level security isolation environment.

[0040] The processor begins executing the system management interrupt handler that was pre-registered in the computer terminal firmware. Based on the requested parameters, the handler securely and directly accesses the ODR area of ​​the SPI Flash, reads the log data, and prepares it to return to the operating system.

[0041] By applying the system management interrupt mechanism used for system management purposes to the new scenario of debugging log information feedback, secure data transfer across privilege levels and operational phases is achieved.

[0042] As an application embodiment of this specification, for step S107, before reading the debug log from the specified data area using the log processing program, the method further includes: Verify the validity of the log read request.

[0043] As an application embodiment of this specification, step S109, which involves returning the debug log to the operating system through the management interface so that the debug log can be parsed and presented under the operating system, may specifically include: After returning debug log data, the processing program clears or updates the log read status flag of the specified data area.

[0044] In the embodiments described in this specification, the security and reliability of the operation can be further enhanced by clearing or updating the log read status flag of the specified data area.

[0045] This specification provides a method for printing debug logs in BIOS. The debug logs are stored in a designated data area of ​​non-volatile memory. Then, a log read request is sent to the computer terminal firmware through the management interface of the operating system to trigger a system management interrupt. This causes the processor to enter system management mode and execute the log processing program in the computer terminal firmware. The debug logs are read from the designated data area and returned to the operating system through the management interface for parsing and presentation under the operating system.

[0046] In this way, by adopting a new method, the debug logs are directly saved in the ODR of SPIFlash during the boot process. After entering the OS (operating system), all the logs are then transferred out for analysis using tools. The operation is simple, does not require recompiling the debug version of the BIOS, does not require connecting a serial debugging cable, and does not affect the boot speed, making it easier to reproduce and analyze the problem.

[0047] It should be noted that the specific BIOS printing debug method described above is merely a specific application example and does not limit the scope of the embodiments in this specification. Other specific embodiments may also be included, which will not be elaborated here.

[0048] Based on the same inventive concept, this specification also provides specific application examples of the above-described BIOS print debug method.

[0049] like Figure 2 The diagram shown is an application structure diagram of the system module corresponding to a BIOS print debug method provided in an embodiment of this specification.

[0050] In the embodiments of this specification, the method for printing debug BIOS may specifically include the following functional modules: BIOS module, WMI interface module, and APP tool module.

[0051] The BIOS module is a function used to record the Debug Log; the APP tool module is a tool module for reading and parsing the BIOS Debug Log under the OS; and the WMI interface module is an interface used for communication between the OS and BIOS.

[0052] like Figure 3 The diagram shown is a logical function diagram of the BIOS module corresponding to a BIOS print debug method provided in an embodiment of this specification.

[0053] In the embodiments described in this specification, the BIOS module may include a function for recording debug logs.

[0054] The format of the log is defined as shown in Table 1 below.

[0055] Table 1 Log Format Definition Table

[0056] Define a 32K address space in the BIOS ODR specifically for storing the BIOS Debug Log, storing it cyclically from beginning to end.

[0057] The BIOS module can also provide specific functions for storing logs in the ODR. Each debug log is written to the ODR by calling a unified function.

[0058] Furthermore, the BIOS module can provide specific functions for clearing the log. If it is necessary to erase all debug logs, the OS tools can issue a command to the BIOS to call this function to clear all logs.

[0059] As another application example of this specification, for tools that read and parse BIOS Debug Log under the OS, the BIOS ODR can be accessed through the WMI interface.

[0060] According to the log format definition in Table 1 above, extract and parse all the interfaces.

[0061] like Figure 4 The diagram shown is a schematic of the Debug Log read out according to a BIOS Debug printing method provided in an embodiment of this specification.

[0062] like Figure 5 The diagram shown is a schematic of the Debug Log parsed according to the log format, corresponding to a BIOS Debug printing method provided in an embodiment of this specification.

[0063] As another application example of this specification, the WMI interface, which is used for communication between the OS and BIOS, is an important bridge connecting the OS and BIOS. Without this WMI, the tools under the OS cannot use the tools to read the BIOS Debug Log.

[0064] On the one hand, it is necessary to define ASL code that supports WMI access in ACPI (Advanced Configuration and Power Management Interface), which must be marked as such.

[0065] For example, Name(_HID, EISAID("PNP0C14")) must be defined in ASL code.

[0066] On the other hand, WMI access functions and data return functions need to be defined in the mof (managed object format) file.

[0067] For example, the code in a specific application scenario can be described as follows: / / WMI Class Qualifiers [dynamic: ToInstance, provider("WMIProv"), WMI, Description("My WMISample Class"), GUID("{E2E0B817-EA48-4bad-81A6-FBEB8776A7AF}"), locale("MS\\0x409")] / / Required Items in WMI Class class MyClass { [key, read] string InstanceName; [read] Boolean Active; [WmiMethodId(1),Implemented,read, write,Description("Send DataBuffer")]void SendDataBuffer([in] uint8 parameter

[8210] , [out] uint8 return); }; [dynamic: ToInstance, provider("WMIProv"), WMI, Description("ReadReturn Data"), GUID("{E2E0B818-EA48-4bad-81A6-FBEB8776A7AF}"), locale("MS\\0x409")] class MyDataClass { [key, read] string InstanceName; [read] Boolean Active; [WmiDataId(1), read, write, Description("Return Data Buffer")]uint8 ReturnData

[8210] ;}; in, SendDataBuffer is a function called by OS tools to send commands to the BIOS.

[0068] ReturnData is the function that returns the Debug Log.

[0069] Furthermore, it also needs to support triggering SW smi to access the BIOS Debug Log.

[0070] After the OS tools access ACPI through WMI, ACPI must trigger SW wmi to enter SMM Mode and then access the BIOS Debug Log.

[0071] like Figure 6 The diagram shown is a schematic diagram of the overall logic of the WMI interface corresponding to a BIOS print debug method provided in an embodiment of this specification.

[0072] In the embodiments described in this specification, the processing logic of the WMI interface is as follows: Step 1: The OS tool calls SendDataBuffer to access the WMI interface; Step 2: The WMI interface triggers the SW SMI; Step 3: Enter SMM Mode; Step 4: BIOS reads the Debug Log; Step 5: The BIOS sends the Debug Log back to the WMI interface; Step 6: The WMI interface puts the Debug Log into the ReturnData Buffer; Step 7: The WMI interface notifies the OS that the reading has been completed; Step 8: The OS tool obtains ReturnData through a query.

[0073] In step 2, the WMI interface triggers SW SMI, which can specifically trigger a system management interrupt, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware.

[0074] Step 3 involves entering SMM Mode, which can specifically be the system management mode.

[0075] The specific implementation process of the embodiments in this specification can be referred to the various implementation steps corresponding to the above embodiments, and will not be repeated here.

[0076] Based on the same inventive concept, embodiments of this specification also provide a system for printing BIOS debug information. For example... Figure 7 The diagram shown is a structural schematic of a BIOS print debug system provided in an embodiment of this specification.

[0077] Specifically, the system for printing BIOS debug may include: Storage module 701 stores the generated debug logs into a designated data area of ​​non-volatile memory during the computer terminal firmware execution phase. During the operating system runtime phase, the sending module 702 sends a log read request to the computer terminal firmware through the management interface of the operating system. Trigger module 703 triggers a system management interrupt based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The reading module 704 uses the log processing program to read the debug log from the specified data area; The parsing module 705 returns the debug log to the operating system through the management interface, so as to parse and present the debug log under the operating system.

[0078] based on Figure 7 The system described in this specification also provides some specific implementation schemes of the system, which will be described below.

[0079] Furthermore, during the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory, including: The debug log is stored in the designated data area according to a preset data format, wherein the non-volatile memory is SPI flash memory, and the designated data area is the original equipment manufacturer (OEM) data area in the SPI flash memory.

[0080] Furthermore, the preset data format includes at least a log header to identify the start of the log, a timestamp to record the time the log was generated, a length field indicating the length of the log content, and the specific log content string.

[0081] Furthermore, the specified address space within the specified data area is configured as a circular buffer.

[0082] Furthermore, the system also includes: When the circular buffer is full, a new debug log is written in a way that overwrites the oldest record.

[0083] Furthermore, during the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface, including: The debugging tools running on the operating system send the log read request through the management interface.

[0084] Furthermore, based on the log read request, a system management interrupt is triggered, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware, including: The log read request triggers the system management interrupt by writing to the specified system port; The log processing program is executed in system management mode, wherein the log processing program is configured to directly access the specified data area in non-volatile memory to read debug logs.

[0085] Furthermore, before reading the debug log from the designated data area using the log processing program, the system further includes: Verify the validity of the log read request.

[0086] This specification provides a BIOS debugging system that stores debug logs in a designated data area of ​​non-volatile memory, and then sends a log read request to the computer terminal firmware through the operating system's management interface to trigger a system management interrupt. This causes the processor to enter system management mode and execute the log processing program in the computer terminal firmware to read the debug logs from the designated data area. The debug logs are then returned to the operating system through the management interface for parsing and presentation under the operating system.

[0087] In this way, by adopting a new method, the debug logs are directly saved in the ODR of SPIFlash during the boot process. After entering the OS (operating system), all the logs are then transferred out for analysis using tools. The operation is simple, does not require recompiling the debug version of the BIOS, does not require connecting a serial debugging cable, and does not affect the boot speed, making it easier to reproduce and analyze the problem.

[0088] Based on the same inventive concept, embodiments of this specification also provide an electronic device, including at least one processor and a memory, wherein the memory stores a program and is configured to be executed by the at least one processor in the following steps: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory; During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface; The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The debug log is read from the specified data area using the log processing program. The debugging logs are returned to the operating system through the management interface, so that the debugging logs can be parsed and presented under the operating system.

[0089] Other functions of the processor can be found in the above embodiments, and will not be repeated here.

[0090] Based on the same inventive concept, embodiments of this specification also provide a computer-readable storage medium, including a program for use in conjunction with an electronic device, the program being executable by a processor to perform the following steps: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory; During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface; The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The debug log is read from the specified data area using the log processing program. The debugging logs are returned to the operating system through the management interface, so that the debugging logs can be parsed and presented under the operating system.

[0091] Other functions of the processor can be found in the above embodiments, and will not be repeated here.

[0092] like Figure 8 As shown in the figure, this specification also provides a schematic diagram of the structure of a computer storage medium.

[0093] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0094] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0095] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0096] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0099] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0100] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0101] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0102] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0103] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

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

[0105] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of protection of the claims of this application.

Claims

1. A method for printing debug information in BIOS, characterized in that, The BIOS print debug method includes: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory; During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface; The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The debug log is read from the specified data area using the log processing program. The debugging logs are returned to the operating system through the management interface, so that the debugging logs can be parsed and presented under the operating system.

2. The method as described in claim 1, characterized in that, During the firmware execution phase on the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory, including: The debug log is stored in the designated data area according to a preset data format, wherein the non-volatile memory is SPI flash memory, and the designated data area is the original equipment manufacturer (OEM) data area in the SPI flash memory.

3. The method as described in claim 2, characterized in that, The preset data format includes at least a log header to identify the start of the log, a timestamp to record the time the log was generated, a length field indicating the length of the log content, and the specific log content string.

4. The method as described in claim 2, characterized in that, The specified address space within the specified data area is configured as a circular buffer.

5. The method as described in claim 4, characterized in that, The method further includes: When the circular buffer is full, a new debug log is written in a way that overwrites the oldest record.

6. The method as described in claim 1, characterized in that, During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface, including: The debugging tools running on the operating system send the log read request through the management interface.

7. The method as described in claim 1, characterized in that, The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware, including: The log read request triggers the system management interrupt by writing to the specified system port; The log processing program is executed in system management mode, wherein the log processing program is configured to directly access the specified data area in non-volatile memory to read debug logs.

8. The method as described in claim 1, characterized in that, Before using the log handler to read the debug log from the specified data area, the method further includes: Verify the validity of the log read request.

9. A BIOS debugging system, characterized in that, The system mentioned in the BIOS print debug includes: The storage module stores the generated debug logs into a designated data area of ​​non-volatile memory during the firmware execution phase of the computer terminal. During the operating system runtime phase, the sending module sends a log read request to the computer terminal firmware through the management interface of the operating system. The triggering module triggers a system management interrupt based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The reading module uses the log processing program to read the debug log from the specified data area. The parsing module returns the debug logs to the operating system through the management interface, so that the debug logs can be parsed and presented under the operating system.

10. A computer storage medium comprising a program for use in conjunction with an electronic device, the program being executable by a processor to perform the following steps: During the firmware execution phase of the computer terminal, the generated debug logs are stored in a designated data area of ​​non-volatile memory; During the operating system runtime phase, a log read request is sent to the computer terminal firmware through the operating system's management interface; The system management interrupt is triggered based on the log read request, causing the processor to enter system management mode and execute the log processing program in the computer terminal firmware; The debug log is read from the specified data area using the log processing program. The debugging logs are returned to the operating system through the management interface, so that the debugging logs can be parsed and presented under the operating system.