Apparatus and method for outputting bios run log based on virtual serial port
By setting up virtual serial port control modules and driver modules on the baseboard management controller and the host southbridge chip, and using the eSPI bus to transmit BIOS operation logs and store them to a USB flash drive, the problem of inconvenient BIOS operation log collection in the prior art is solved, and efficient and flexible log collection and debugging are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2024-09-20
- Publication Date
- 2026-04-24
AI Technical Summary
Existing methods for collecting BIOS runtime logs suffer from poor flexibility and low efficiency, especially in remote server environments where debugging is inconvenient. Furthermore, the lack of integrated Super I/O functionality in some BMC chips increases hardware costs and design complexity.
The output method based on virtual serial port is adopted. The BIOS operation log is transmitted through the virtual serial port control module and driver module on the baseboard management controller and the host southbridge chip, and stored to USB flash drive or network SOL, avoiding physical connection and the use of Super I/O chip.
It enables efficient and flexible BIOS operation log collection, improves data transmission rate, reduces hardware cost, reduces circuit design complexity, and improves debugging and fault location efficiency.
Smart Images

Figure CN119336687B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hardware control technology, and in particular to an apparatus and method for generating BIOS operation logs based on virtual serial port output. Background Technology
[0002] In the field of computer technology, the BIOS (Basic Input Output System) plays a crucial role as the lowest-level hardware configuration and control manager on the server motherboard. The BIOS not only stores the computer's most important basic input / output programs and system settings information, but also handles the power-on self-test (POST) and system boot processes, providing essential low-level support for the normal operation of the computer. The BIOS is a set of programs embedded in a FlashROM chip on the motherboard, typically compiled from C language source code.
[0003] In the development and debugging of BIOS, the collection and analysis of runtime logs is an indispensable part. Traditionally, the BIOS prints runtime logs containing debugging information through the serial COM port of the Super I / O chip. BIOS developers typically use a debugging PC terminal, connecting directly to the machine being debugged via a serial cable, or remotely collect the BIOS runtime logs using Serial Over LAN (SOL) technology. SOL technology allows developers to remotely connect to the server's BMC (Board Management Controller) via a network, thereby collecting the serial port logs output by the BIOS, thus avoiding the cumbersome process of physically entering the computer room.
[0004] However, existing log collection methods have significant limitations. First, using serial cables to collect logs severely restricts the flexibility and efficiency of debugging. Developers must be physically present in the server room to directly connect to the server using serial cables, which is extremely inconvenient for multi-server environments or remotely deployed servers. Second, while SOL technology enables remote log collection, its performance is limited by the baud rate of the physical serial port. When the BIOS prints a large amount of debugging information, the serial data transmission rate often becomes a bottleneck, causing a significant decrease in BIOS execution speed, extending boot time, and severely impacting the efficiency of debugging and fault location. Furthermore, SOL technology becomes unusable when the BMC malfunctions or the network connection is unavailable, forcing developers to revert to traditional serial cable connections, which not only increases debugging difficulty but also reduces overall work efficiency. Even more serious is the fact that some domestically produced BMC chips do not integrate Super I / O functionality. To achieve serial output, an additional Super I / O chip is required, which not only increases hardware costs but also occupies valuable southbridge chip pin resources, posing additional challenges to hardware design. Summary of the Invention
[0005] This invention provides an apparatus and method for collecting BIOS operation logs based on virtual serial port output, which solves the problem of the inability to conveniently collect BIOS operation logs in the prior art and achieves efficient collection of BIOS operation logs.
[0006] This invention provides a device for outputting a basic input / output system operation log based on a virtual serial port, comprising:
[0007] A baseboard management controller is provided with a first virtual serial port control module, which is used to receive serial port data sent by the host through the enhanced serial peripheral interface bus.
[0008] The host has a first virtual serial port driver module and a second virtual serial port control module on its southbridge chip. The first virtual serial port driver module is used to send the operation log information to the first virtual serial port control module through the enhanced serial peripheral interface bus. The second virtual serial port control module is used to output the operation log information to a text file under the universal serial bus flash drive when the existence of the universal serial bus flash drive is detected.
[0009] An enhanced serial peripheral interface bus is connected between the first virtual serial port control module and the first virtual serial port driver module, and is used for the first virtual serial port control module and the first virtual serial port driver module to transmit data to each other.
[0010] According to the present invention, a device for outputting the basic input / output system operation log based on a virtual serial port is provided. The southbridge chip of the host is further provided with a second virtual serial port driver module, which is used to forward the operation log information output by the virtual serial port to the transmission queue of the high-speed expression device for peripheral component interconnection when the first virtual serial port driver module is not used.
[0011] This invention also provides a method for outputting basic input / output system operation logs based on virtual serial ports, applicable to the apparatus described in any of the above-mentioned methods, comprising the following steps: when the host is powered on, loading a first virtual serial port driver module and establishing a link with the first virtual serial port control module; after the first virtual serial port driver module is loaded, outputting operation log information to the first virtual serial port control module; determining whether a second virtual serial port control module is enabled in the basic input / output system; if the second virtual serial port control module is enabled, loading the second virtual serial port control module according to a preset default configuration and checking whether a universal serial bus flash drive exists; if the universal serial bus flash drive exists, creating a text file of serial port output information on the universal serial bus flash drive and pointing the output handle of the second virtual serial port control module to the text file; after the host has finished loading the second virtual serial port control module, outputting operation log information to the universal serial bus flash drive.
[0012] According to a method for outputting a basic input / output system operation log based on a virtual serial port provided by the present invention, after outputting operation log information to a first virtual serial port control module, the method further includes: monitoring whether there is data from the first virtual serial port driver module on the enhanced serial peripheral interface bus through the first virtual serial port control module; if there is data, receiving the serial port data on the enhanced serial peripheral interface bus and forwarding it to the local area network serial port.
[0013] According to a method for outputting the basic input / output system operation log based on a virtual serial port provided by the present invention, before monitoring the enhanced serial peripheral interface bus through the first virtual serial port control module, the method further includes: loading the first virtual serial port control module after the baseboard management controller is powered on; and after the first virtual serial port control module is loaded, monitoring the enhanced serial peripheral interface bus communication and waiting for data from the first virtual serial port driver module.
[0014] According to the present invention, a method for checking the existence of a Universal Serial Bus (USB) flash drive based on virtual serial port output of a basic input / output system operation log is provided. Specifically, checking whether the USB memory mounted by the baseboard management controller through the USB channel and the USB flash drive actually physically connected exist. If either one exists, it is considered that the USB flash drive exists.
[0015] The present invention provides a method for outputting a basic input / output system operation log based on a virtual serial port, applicable to an apparatus for outputting a basic input / output system operation log based on a virtual serial port, including a second virtual serial port driver module, comprising: when the host is powered on, loading the second virtual serial port driver module when the first virtual serial port driver module is not in use, and establishing a link with a high-speed interconnect device for peripheral components; after the second virtual serial port driver module is loaded, outputting operation log information to the high-speed interconnect device for peripheral components.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for outputting a basic input / output system operation log based on a virtual serial port as described above.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for outputting the basic input / output system operation log based on a virtual serial port as described above.
[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for outputting a basic input / output system operation log based on a virtual serial port as described above.
[0019] This invention provides an apparatus and method for outputting the operation log of a basic input / output system based on a virtual serial port, which has the following advantages: Through virtual serial port technology, the apparatus provided by this invention can conveniently output the operation log of the basic input / output system without complex physical connections or additional hardware devices. The virtual serial port has high data transmission efficiency, ensuring that a large amount of operation log information is transmitted and stored in a timely and accurate manner. Using a virtual serial port to implement serial log output eliminates the need for a Super I / O chip, significantly saving costs and reducing the workload of hardware designers in circuit design. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the device for outputting the basic input / output system operation log based on a virtual serial port, provided by the present invention.
[0022] Figure 2 This is one of the flowcharts illustrating the method for outputting basic input / output system operation logs based on virtual serial port provided by the present invention.
[0023] Figure 3 This is the second flowchart of the method for outputting the basic input / output system operation log based on a virtual serial port provided by the present invention.
[0024] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] The following describes some of the terms involved in this invention.
[0027] The BIOS (Basic Input Output System) is the lowest-level and most direct hardware settings and control manager on the server motherboard, providing the server with more user-friendly functions. The BIOS is the operating system boot program that runs when the system host is powered on. The BIOS is a set of programs embedded in a Flash ROM chip on the motherboard. It stores the computer's most important basic input / output programs, system settings information, power-on self-test (POST) programs, and system startup programs. Its main function is to provide the lowest-level and most direct hardware settings and control for the computer. The BIOS is a binary file compiled from C language source code. During debugging, the BIOS controls the Super I / O chip's serial COM port to print a runtime log containing debugging information. BIOS developers use a debugging PC terminal, a serial cable, or a serial port to collect the BIOS runtime logs, and then analyze the logs for debugging.
[0028] eSPI (Enhanced Serial Peripheral Interface) is a synchronous full-duplex serial communication protocol widely used in microcontrollers, sensors, and other integrated circuits. Compared to SPI (Serial Peripheral Interface), eSPI has a more complex structure. The eSPI interface was designed to replace the LPC (Low Pin Count) interface, therefore it is fully compatible with the functionality of the LPC bus.
[0029] The Baseboard Management Controller (BMC) is a hardware manager integrated into servers, network devices, and other computer systems. It is a core component of the server management system defined by the Intelligent Platform Management Interface (IPMI). Its main functions are to monitor the hardware status of devices, perform remote management operations, and provide monitoring and control functions for devices.
[0030] SOL (Serial Over LAN) is a serial data transmission technology used over a network to transmit serial data within a local area network (LAN). It extends communication between serial devices to other devices within the LAN via a network connection. Simply put, SOL allows traditional serial interface data (such as data from printers, modems, etc.) to be converted into data packets that can be transmitted over a LAN, thus enabling remote management and monitoring.
[0031] Super I / O is a chip connected to high-speed devices such as the Southbridge chip, responsible for the I / O management of a large number of low-speed devices such as keyboards, mice, serial COM ports, parallel interfaces, and floppy disk drives.
[0032] The pin resources of the southbridge chip are the collection of all available pins on the southbridge chip, which are used to make electrical connections with other components on the motherboard.
[0033] The following is combined Figures 1-4 The embodiments of the present invention are described in detail.
[0034] Collecting BIOS serial port logs using a serial cable requires entering the server room and connecting to the machine next to it, which is extremely inconvenient. Using SOL (Search Engine Log) to collect BIOS serial port logs eliminates the need for direct connection to the machine; only the IP address of the BMC (Browser Control Center) of the machine being debugged is required for remote log collection. For servers, Super I / O is integrated into the BMC, and the serial log output still goes through the physical serial port to the BMC, which then forwards it to the LAN (Local Area Network) to form the SOL. Therefore, in SOL mode, the speed of serial port information output is still limited by the baud rate (data transfer rate) of the physical serial port. When the BIOS prints a large amount of debugging information, since serial data is generally output at a baud rate of 115200, the BIOS execution speed will be significantly slowed down. A machine with a normal boot time of about 1 minute will have its boot time extended to more than 5 minutes when log printing is enabled. For some complex configurations, the boot time after enabling logging can even reach more than half an hour. This situation seriously affects the efficiency of BIOS developers in debugging and troubleshooting.
[0035] In special circumstances where the BMC malfunctions or the BMC network is unreachable, SOL will also be unusable and remote serial log collection will be impossible. Logs can only be collected by entering the computer room and using a serial cable. If the BMC's Super I / O module is not configured or is damaged, serial logs cannot be collected even when using a serial cable.
[0036] Some domestically produced BMC chips do not integrate Super I / O, requiring a separate Super I / O chip to achieve serial port output (modern servers do not require parallel ports, floppy disks, PS / 2 keyboards, or mice). Adding a Super I / O chip increases costs and also occupies pin resources on the southbridge chip, posing challenges for hardware designers in circuit design.
[0037] To address the issues of slow log collection speed of existing physical serial ports and the inability to collect serial port logs when the BMC fails, as well as the problems of some BMC chips not integrating Super I / O requiring separate chips, which increases costs and complicates circuit design, this invention provides a simple and easy-to-use method for BIOS to use a virtual serial port to send debug print and console information to the BMC via the eSPI bus and redirect debug information to the host's local USB flash drive.
[0038] like Figure 1 The image shows a device for logging the operation of a basic input / output system based on a virtual serial port, provided by the present invention, comprising:
[0039] This invention provides a device for outputting a basic input / output system operation log based on a virtual serial port, comprising:
[0040] The baseboard management controller 110 is equipped with a first virtual serial port control module 1101, which is used to receive serial port data sent by the host through the enhanced serial peripheral interface bus.
[0041] The host 120 has a first virtual serial port driver module 1202 and a second virtual serial port control module 1204 on its southbridge chip. The first virtual serial port driver module 1202 is used to send the running log information to the first virtual serial port control module through the enhanced serial peripheral interface bus. The second virtual serial port control module 1204 is used to output the running log information to a text file under the universal serial bus flash drive when the existence of the universal serial bus flash drive is detected.
[0042] An enhanced serial peripheral interface bus 130 is connected between the first virtual serial port control module 1101 and the first virtual serial port driver module 1202, and is used for the first virtual serial port control module 1101 and the first virtual serial port driver module 1202 to transmit data to each other.
[0043] Specifically, in terms of hardware circuitry, the BMC chip is connected to the host 120 southbridge chip via the eSPI bus 130.
[0044] The first virtual serial port control module 1101 on the BMC receives serial port data sent by the host 120 via the eSPI bus 130, and the host 120 treats it as a real physical serial port controller on the eSPI bus 130.
[0045] After receiving serial port data sent by host 120, the first virtual serial port control module 1101 of BMC stores the serial port data in the serial port log text file of one-click log. When SOL is enabled, it also forwards the serial port data to the network SOL data packet.
[0046] In the host BIOS, the eSPI serial port controller driver software module, i.e., the first virtual serial port driver module 1202, sends the debug print information and POST information to the first virtual serial port control module 1101 in the BMC via the eSPI bus 130.
[0047] In the second virtual serial port control module 1204 of the host BIOS, the host treats it as a real physical serial port controller that exists on the PCIe bus.
[0048] The second virtual serial port control module 1204 checks whether the USB flash drive exists. If the USB flash drive exists, it outputs the debug print information and POST information to a text file under the USB flash drive.
[0049] According to the BIOS Setup settings, the first virtual serial port control module 1101 and the second virtual serial port control module 1204 can output serial port data simultaneously or output serial port data separately.
[0050] According to the present invention, a device for outputting the basic input / output system operation log based on a virtual serial port is provided. The southbridge chip of the host is further provided with a second virtual serial port driver module (not shown in the figure), which is used to forward the operation log information output by the virtual serial port to the transmission queue of the high-speed expression device for peripheral component interconnection without using the first virtual serial port driver module 1202.
[0051] Specifically, the host also has PCIe devices such as network cards. Generally, PCIe device drivers are loaded relatively late, after CPU and memory initialization. If the network card driver can be loaded earlier, or if temporary initialization is performed on the network card before loading the driver, the virtual serial port can be directly redirected to the network card's protocol stack. Implementing SOL on the host side allows for decoupling from the BMC for remote log collection, which is significant for remotely operating the setup and OS without relying on the BMC.
[0052] The method for outputting a basic input / output system operation log based on a virtual serial port, provided by the present invention, is described below. The method for outputting a basic input / output system operation log based on a virtual serial port described below can be referred to in correspondence with the device for outputting a basic input / output system operation log based on a virtual serial port described above.
[0053] Figure 2 This is one of the flowcharts illustrating the method for outputting a basic input / output system operation log based on a virtual serial port provided by the present invention, applicable to any of the aforementioned apparatuses for outputting a basic input / output system operation log based on a virtual serial port, such as... Figure 2 As shown, the method includes the following steps:
[0054] S210. After the host is powered on, the first virtual serial port driver module 1202 is loaded, and a connection is established with the first virtual serial port control module 1101.
[0055] Specifically, the host computer powers on and enters the boot process. During the host's boot initialization, the operating system or BIOS loads a driver module specifically designed for the virtual serial port (i.e., the first virtual serial port driver module 1202). The first virtual serial port driver module 1202 is responsible for providing the interface and protocol for communication with the virtual serial port. After loading, the first virtual serial port driver module 1202 attempts to establish a communication link with the first virtual serial port control module 1101 installed on the BMC. The link is established through a specific communication protocol (eSPI bus 130), ensuring unimpeded virtual serial port communication between the host and the BMC.
[0056] This step not only simplifies traditional physical serial communication but also significantly improves data transmission rates and flexibility. Since virtual serial ports are not limited by physical baud rates, their transmission speed can theoretically be greatly increased, making BIOS log collection and debugging faster and more efficient.
[0057] S220. After the first virtual serial port driver module 1202 is loaded, the running log information is output to the first virtual serial port control module 1101.
[0058] Specifically, after the host computer boots up and loads the first virtual serial port driver module 1202, this driver module actively establishes a connection with the first virtual serial port control module 1101 on the BMC. Once the connection is successfully established, the host computer begins sending BIOS runtime log information to the BMC through the virtual serial port. This information includes debugging information, POST self-test results, etc. The first virtual serial port driver module 1202 encapsulates this log information into protocol-compliant data packets and sends them to the first virtual serial port control module 1101 via the eSPI bus 130.
[0059] According to the present invention, a method for logging the operation of a basic input / output system based on a virtual serial port is provided. Before listening to the enhanced serial peripheral interface bus through the first virtual serial port control module 1101, the first virtual serial port control module 1101 is loaded after the baseboard management controller is powered on. After the first virtual serial port control module 1101 is loaded, it listens to the enhanced serial peripheral interface bus communication and waits for data from the first virtual serial port driver module 1202.
[0060] According to the present invention, a method for outputting the basic input / output system operation log based on a virtual serial port is provided. After outputting the operation log information to the first virtual serial port control module 1101, the first virtual serial port control module 1101 listens for whether there is data from the first virtual serial port driver module 1202 on the enhanced serial peripheral interface bus. If there is data, the serial port data on the enhanced serial peripheral interface bus is received and forwarded to the local area network serial port.
[0061] Specifically, after the Baseboard Management Controller (BMC) powers on, the system first loads the first virtual serial port control module 1101. This module is responsible for creating and managing virtual serial ports on the BMC side, simulating the behavior of real physical serial ports. After loading, the first virtual serial port control module 1101 begins listening for communication on the eSPI bus 130, waiting for data from the host. Once a data packet is detected from the first virtual serial port driver module 1202, the module immediately receives this data and stores it locally or forwards it to other destinations (such as a log server on the network).
[0062] By preloading the virtual serial port control module and immediately starting to listen to the eSPI bus after BMC startup, the response time is significantly shortened, improving the overall system performance. Through continuous listening and interaction mechanisms, the system can respond to log transmission requests in real time, avoiding data loss or delays.
[0063] S230. Determine whether the second virtual serial port control module 1204 is enabled in the basic input / output system; if the second virtual serial port control module 1204 is enabled, load the second virtual serial port control module 1204 according to the preset default configuration, and check whether the universal serial bus flash disk exists.
[0064] According to the present invention, a method for checking the existence of a Universal Serial Bus (USB) flash drive based on virtual serial port output of a basic input / output system operation log is provided. Specifically, it includes checking whether the USB memory mounted by the baseboard management controller through the USB channel and the USB flash drive actually physically connected exist. If either one exists, it is considered that the USB flash drive exists.
[0065] Specifically, during the host's power-on and BIOS setup initialization process, the system checks the enable status of the second virtual serial port control module 1204 based on the configuration in the BIOS Setup. The system reads the corresponding options in the BIOS settings to determine whether the second virtual serial port control module has been enabled by the user or administrator.
[0066] If the second virtual serial port control module is enabled, the system will initialize it according to the preset default configuration. These default configurations include communication parameters such as serial port baud rate, data bits, stop bits, and parity, as well as the internal buffer size of the virtual serial port. After configuration, the system will perform an additional step to check if the Universal Serial Bus (USB) flash drive exists. This step involves checking two possible sources of USB devices: one is a USB storage device mounted through the BMC's USB channel (such as temporary storage media during network startup), and the other is a USB flash drive directly physically connected to the host. The system will traverse these device interfaces to search for a recognizable USB storage device. If either is found, the USB flash drive is considered to exist, and log information will be prepared to be output to that device.
[0067] By intelligently detecting and configuring the second virtual serial port control module 1204, and flexibly recognizing USB storage devices, users are provided with greater flexibility and convenience. It allows users to enable or disable the virtual serial port output to a USB flash drive according to actual needs, thus facilitating the collection and analysis of BIOS operation logs without affecting normal system operation. Furthermore, by simultaneously supporting network-mounted USB storage devices and physically connected USB flash drives, system compatibility and usability are enhanced, making the log collection process more flexible and efficient. This not only improves the efficiency of BIOS development and debugging but also reduces the complexity and cost of log collection operations.
[0068] S240. If a Universal Serial Bus (USB) flash drive exists, create a text file containing serial port output information on the USB flash drive and point the output handle of the second virtual serial port control module 1204 to the text file.
[0069] Specifically, after confirming the existence of the USB flash drive, the system creates a new text file on the flash drive to store the serial port information output from the second virtual serial port control module 1204. The name and path of this file can be set according to the specific needs of the system to ensure that the logs can be easily found and read later. Simultaneously, the system sets the output handle of the second virtual serial port control module to this newly created text file so that subsequent serial port information can be directly written to that file.
[0070] S250. After the host completes loading the second virtual serial port control module 1204, it outputs the running log information to the universal serial bus flash drive.
[0071] Specifically, after the host completes the loading of the second virtual serial port control module 1204, this module begins to capture and process debug print information and POST (Power On Self Test) information during BIOS operation. According to the previous configuration, this information is redirected to a specified text file on the USB flash drive. Whenever new log information is generated, the second virtual serial port control module 1204 writes this information to the text file through its output handle. In this way, developers can find and read this log information on the USB flash drive for subsequent debugging and analysis.
[0072] By intelligently creating and managing text files containing serial port output information on a USB flash drive, flexible storage and convenient access to BIOS operation logs are achieved. This not only improves the efficiency of log collection but also reduces the complexity and time cost for developers to obtain and analyze log information. Furthermore, storing log information on a portable USB flash drive facilitates log information sharing and transmission, improves team collaboration efficiency, and makes the BIOS development and debugging process more efficient, convenient, and flexible.
[0073] The present invention provides a method for outputting a basic input / output system operation log based on a virtual serial port, applicable to an apparatus for outputting a basic input / output system operation log based on a virtual serial port, including a second virtual serial port driver module, comprising: when the host is powered on, and when the first virtual serial port driver module 1202 is not used, loading the second virtual serial port driver module to establish a link with a high-speed expression device interconnected with peripheral components; and after the second virtual serial port driver module is loaded, outputting operation log information to the high-speed expression device interconnected with peripheral components.
[0074] Specifically, after the host is powered on, the system first checks whether the first virtual serial port driver module 1202 is in use. If the first virtual serial port driver module is not currently in use, the system will load the second virtual serial port driver module and establish a connection with a high-speed PCIe device (such as a network card) for interconnecting peripheral components, and send the operation log to SOL through the network card.
[0075] Although serial port debugging information cannot be output before the network card driver protocol stack is loaded, which has a significant impact on BIOS debugging because CPU and memory account for a large portion of BIOS debugging, this method is of great significance for remotely operating Setup and OS without BMC. It ensures that if the first virtual serial port driver module fails or cannot be used, the system can flexibly switch to the second virtual serial port for log output, realize remote log collection, and reduce coupling with BMC.
[0076] like Figure 3The diagram shown is the second flowchart of the method for outputting the basic input / output system operation log based on a virtual serial port provided by the present invention.
[0077] S1: After power-on, the BMC starts the first virtual serial port control module process, allocates storage space to simulate the registers of the serial port controller, and simulates interrupt resources.
[0078] S2: After the first virtual serial port control module on the BMC side is loaded and started, it listens for eSPI bus communication and waits for host configuration.
[0079] S3: When the host starts up, it first loads the first virtual serial port driver module, establishes a connection with the first virtual serial port control module on the BMC side, and configures the registers and interrupts of the first virtual serial port according to the preset default configuration, and waits for serial port data output.
[0080] S4: The host determines whether the second virtual serial port control module is enabled in the BIOS Setup enable control option.
[0081] S5: When the second virtual serial port control module is enabled, configure the basic parameters of the second virtual serial port (such as baud rate, data bits, stop bits, etc.) according to the preset default configuration, configure the virtual registers and interrupt resources of the second virtual serial port control module, and put it into the ready-to-send state.
[0082] S6: When the second virtual serial port control module is enabled, check if the USB flash drive exists. Both the USB memory mounted by the BMC through the USB channel and the physically connected USB flash drive are considered to exist.
[0083] S7: If the USB flash drive exists, create a text file containing serial port output information on the USB flash drive and point the output handle of the second virtual serial port control module to that text file.
[0084] S8: After the host loads the first virtual serial port driver module and the second virtual serial port control module, it outputs the running log information from the two virtual serial ports.
[0085] S9: If the host fails to load the first virtual serial port driver module during startup, it loads the second virtual serial port driver module, establishes a connection with PCIe devices such as network cards, and configures the registers and interrupts of the third virtual serial port according to the preset default configuration, waiting for serial port data output.
[0086] This invention provides a method to improve serial port output speed by using a virtual serial port instead of a physical serial port, and it can output serial port information even in special circumstances where the BMC chip fails. Because the virtual serial port does not have the baud rate limitation of the physical serial port, its theoretical maximum transmission rate is only limited by the eSPI bus transmission rate. eSPI typically operates at 50MHz, so theoretically, the output speed can reach more than 400 times that of a 115200 baud rate serial port. This method is simple and easy to implement, facilitating debugging and use by server BIOS developers. Using a virtual serial port to implement serial log output eliminates the need for a Super I / O chip, significantly saving costs and reducing the workload of hardware designers in circuit design.
[0087] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communications bus 440. The processor 410 can call logic instructions in the memory 430 to execute a method for outputting the basic input / output system operation log based on a virtual serial port. This method includes: after the host is powered on, loading a first virtual serial port driver module and establishing a link with a first virtual serial port control module; after the first virtual serial port driver module is loaded, outputting operation log information to the first virtual serial port control module; determining whether a second virtual serial port control module is enabled in the basic input / output system; if the second virtual serial port control module is enabled, loading the second virtual serial port control module according to a preset default configuration and checking if a universal serial bus flash drive exists; if the universal serial bus flash drive exists, creating a text file of serial port output information on the universal serial bus flash drive and pointing the output handle of the second virtual serial port control module to the text file; and after the host has finished loading the second virtual serial port control module, outputting operation log information to the universal serial bus flash drive.
[0088] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method for outputting the basic input / output system operation log based on a virtual serial port provided by the above methods. The method includes: when the host is powered on, loading a first virtual serial port driver module and establishing a link with a first virtual serial port control module; after the first virtual serial port driver module is loaded, outputting operation log information to the first virtual serial port control module; determining whether a second virtual serial port control module is enabled in the basic input / output system; if the second virtual serial port control module is enabled, loading the second virtual serial port control module according to a preset default configuration and checking whether a universal serial bus flash drive exists; if the universal serial bus flash drive exists, creating a text file of serial port output information on the universal serial bus flash drive and pointing the output handle of the second virtual serial port control module to the text file; and after the host has finished loading the second virtual serial port control module, outputting operation log information to the universal serial bus flash drive.
[0090] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the method for running a basic input / output system based on a virtual serial port, as provided by the methods described above. This method includes: after the host is powered on, loading a first virtual serial port driver module and establishing a link with a first virtual serial port control module; after the first virtual serial port driver module is loaded, outputting running log information to the first virtual serial port control module; determining whether a second virtual serial port control module is enabled in the basic input / output system; if the second virtual serial port control module is enabled, loading the second virtual serial port control module according to a preset default configuration and checking if a universal serial bus flash drive exists; if the universal serial bus flash drive exists, creating a text file containing serial port output information on the universal serial bus flash drive and pointing the output handle of the second virtual serial port control module to the text file; and after the host has finished loading the second virtual serial port control module, outputting running log information to the universal serial bus flash drive.
[0091] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0092] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A device for outputting a basic input / output system operation log based on a virtual serial port, characterized in that, include: A baseboard management controller is provided with a first virtual serial port control module, which is used to receive serial port data sent by the host through the enhanced serial peripheral interface bus. The host has a first virtual serial port driver module and a second virtual serial port control module on its southbridge chip. The first virtual serial port driver module is used to send the operation log information to the first virtual serial port control module through the enhanced serial peripheral interface bus. The second virtual serial port control module is used to output the operation log information to a text file under the universal serial bus flash drive when the existence of the universal serial bus flash drive is detected. An enhanced serial peripheral interface bus is connected between the first virtual serial port control module and the first virtual serial port driver module, and is used for the first virtual serial port control module and the first virtual serial port driver module to transmit data to each other. The host's southbridge chip is also equipped with a second virtual serial port driver module, which is used to forward the running log information output by the virtual serial port to the sending queue of the high-speed expression device for peripheral component interconnection when the first virtual serial port driver module is not used.
2. A method for outputting a basic input / output system operation log based on a virtual serial port, applicable to the apparatus for outputting a basic input / output system operation log based on a virtual serial port as described in claim 1, characterized in that, include: When the host is powered on, the first virtual serial port driver module is loaded, and a connection is established with the first virtual serial port control module. After the first virtual serial port driver module is loaded, it outputs the running log information to the first virtual serial port control module; Determine whether the second virtual serial port control module is enabled in the basic input / output system; If the second virtual serial port control module is enabled, the second virtual serial port control module is loaded according to the preset default configuration, and the existence of the Universal Serial Bus flash drive is checked. If a Universal Serial Bus (USB) flash drive exists, create a text file containing serial port output information on the USB flash drive and point the output handle of the second virtual serial port control module to the text file. After the host completes loading the second virtual serial port control module, it outputs operation log information to the universal serial bus flash drive.
3. The method for outputting the basic input / output system operation log based on a virtual serial port according to claim 2, characterized in that, After outputting the operation log information to the first virtual serial port control module, the method further includes: The first virtual serial port control module monitors whether there is data from the first virtual serial port driver module on the enhanced serial peripheral interface bus. If data exists, the serial port data on the enhanced serial peripheral interface bus is received and forwarded to the local area network serial port.
4. The method for outputting the basic input / output system operation log based on a virtual serial port according to claim 3, characterized in that, Before monitoring the enhanced serial peripheral interface bus via the first virtual serial port control module, the method further includes: When the baseboard management controller is powered on, the first virtual serial port control module is loaded. Once the first virtual serial port control module is loaded, it listens for enhanced serial peripheral interface bus communication and waits for data from the first virtual serial port driver module.
5. The method for outputting the basic input / output system operation log based on a virtual serial port according to claim 2, characterized in that, The check for the presence of a Universal Serial Bus (USB) flash drive specifically includes: Check whether the Universal Serial Bus (USB) memory connected to the baseboard management controller via the USB channel and the actual physically connected USB flash drive exist. If either one exists, it is considered that the USB flash drive exists.
6. The method for outputting the basic input / output system operation log based on a virtual serial port according to claim 2, characterized in that, include: When the host is powered on, if the first virtual serial port driver module is not in use, the second virtual serial port driver module is loaded to establish a connection with the high-speed expression device interconnected with the peripheral components. After the second virtual serial port driver module is loaded, it outputs operation log information to the high-speed expression device interconnected with the peripheral components.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for outputting the basic input / output system operation log based on a virtual serial port as described in any one of claims 2 to 6.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for outputting the basic input / output system operation log based on a virtual serial port as described in any one of claims 2 to 6.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for outputting the basic input / output system operation log based on a virtual serial port as described in any one of claims 2 to 6.
Citation Information
Patent Citations
Server fault diagnosis method and device
CN113835942A
Serial port debugging method and device, computer equipment and storage medium
CN116483635A