Device and method for outputting BIOS running log based on virtual serial port
Through the output method based on the virtual serial port, the problem of flexibility and low efficiency of BIOS running log collection is solved, efficient and convenient log collection and storage is realized, and hardware cost and design complexity are reduced.
Patent Information
- Application Number
- CN202411319724.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The existing technology has problems of flexibility and low efficiency when collecting BIOS running logs, especially in multi-server environments or remote deployments. The performance of SOL technology is limited by the baud rate of the physical serial port, resulting in BIOS execution speed. Decreases, affecting the efficiency of debugging and fault location.
Using an output method based on the virtual serial port, the BIOS running log is sent to the baseboard management controller through the enhanced serial peripheral interface bus. If the presence of a universal serial bus flash disk is detected, the log information is output to the text of the flash disk. document.
It realizes efficient and convenient collection of BIOS running logs, avoids the limitations of physical connections, improves data transmission efficiency, reduces hardware costs, and reduces the complexity of hardware design.
Smart Images

Figure CN119336687A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hardware control, and in particular to a device and method for outputting a basic input / output system BIOS operation log based on a virtual serial port. Background Art
[0002] In the field of computer technology, BIOS (Basic Input Output System) plays a vital role as the lowest-level hardware setting and control manager of the server motherboard. BIOS not only stores the most important basic input and output programs and system setting information of the computer, but is also responsible for the self-test program and system self-starting program after powering on, providing the necessary underlying support for the normal operation of the computer. BIOS is a set of programs fixed to the FlashROM chip on the motherboard, usually compiled from C language source code.
[0003] In the process of BIOS development and debugging, the collection and analysis of operation logs is an indispensable part. Traditionally, BIOS prints out operation logs with debugging information by controlling the serial COM port of the Super I / O chip. BIOS developers usually use a debugging PC terminal to directly connect to the debugged machine through a serial port line, or remotely collect BIOS operation logs through Serial Over LAN (SOL) technology. SOL technology allows developers to remotely connect to the server's BMC (Board Management Controller) through the network, and then collect the serial port logs output by BIOS, thus avoiding the tediousness of entering the computer room for on-site operations.
[0004] However, the existing log collection methods have significant limitations. First, the use of serial lines to collect logs greatly limits the flexibility and efficiency of debugging. Developers must go to the computer room and use serial lines to directly connect to the server, which is extremely inconvenient for multi-server environments or remotely deployed servers. Secondly, although SOL technology realizes the function of 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 transmission rate of the serial port data often becomes a bottleneck, resulting in a significant decrease in the BIOS execution speed, prolonging the boot time, and seriously affecting the efficiency of debugging and fault location. In addition, when the BMC fails or the network cannot be connected, the SOL technology will not be available, and developers have to return to the traditional serial line connection method, which not only increases the difficulty of debugging, but also reduces the overall work efficiency. More seriously, some domestic BMC chips do not integrate the Super I / O function. In order to realize serial port output, an additional Super I / O chip needs to be added, which not only increases the hardware cost, but also occupies the precious south bridge chip Pin resources, bringing additional challenges to hardware design. Summary of the invention
[0005] The present invention provides a device and method for outputting a basic input / output system operation log based on a virtual serial port, which solves the defect that the BIOS operation log cannot be conveniently collected in the prior art and realizes efficient collection of the BIOS operation log.
[0006] The present invention provides a device for outputting a basic input / output system operation log based on a virtual serial port, comprising: A baseboard management controller, on which a first virtual serial port control module is arranged, and the first virtual serial port control module is used to receive serial port data sent by a host through an enhanced serial peripheral interface bus; A host, wherein a first virtual serial port driver module and a second virtual serial port control module are arranged on a south bridge chip of the host, wherein the first virtual serial port driver module is used to send operation log information to the first virtual serial port control module through an enhanced serial peripheral interface bus, and 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 disk when the existence of the universal serial bus flash disk is detected; The 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.
[0007] According to a device for outputting basic input / output system operation log based on a virtual serial port provided by the present invention, a second virtual serial port driver module is also provided on the south bridge chip of the host, which is used to forward the operation log information output by the virtual serial port to the sending queue of the peripheral component interconnection high-speed expression device without using the first virtual serial port driver module.
[0008] The present invention also provides a method for outputting a basic input / output system operation log based on a virtual serial port, which is applicable to any of the above-mentioned devices for outputting a basic input / output system operation log based on a virtual serial port, and comprises the following steps: when a host is turned 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; judging whether a second virtual serial port control module is set to be enabled in the basic input / output system; if the second virtual serial port control module is set to be enabled, loading the second virtual serial port control module according to a preset default configuration, and checking whether a universal serial bus flash disk exists; if the universal serial bus flash disk exists, creating a text file of serial port output information on the universal serial bus flash disk, and pointing 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, outputting operation log information to the universal serial bus flash disk.
[0009] 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 the operation log information to a first virtual serial port control module, the method further comprises: monitoring, by the first virtual serial port control module, whether there is data from the first virtual serial port driver module on an enhanced serial peripheral interface bus; if there is data, receiving the serial port data on the enhanced serial peripheral interface bus and forwarding it to a local area network serial.
[0010] According to a method for outputting a basic input / output system operation log based on a virtual serial port provided by the present invention, before monitoring an enhanced serial peripheral interface bus through a first virtual serial port control module, the method further includes: loading the first virtual serial port control module after a baseboard management controller is powered on; after the first virtual serial port control module is loaded, monitoring enhanced serial peripheral interface bus communication and waiting for data from the first virtual serial port driver module.
[0011] According to a method for outputting basic input / output system operation logs based on a virtual serial port provided by the present invention, the checking whether a universal serial bus flash disk exists specifically includes: checking whether a universal serial bus memory mounted by a baseboard management controller through a universal serial bus channel and a universal serial bus flash disk that is actually physically connected exist; if either one of the two exists, it is deemed that the universal serial bus flash disk exists.
[0012] A method for outputting a basic input / output system operation log based on a virtual serial port provided by the present invention is applicable to a device including a second virtual serial port driver module for outputting a basic input / output system operation log based on a virtual serial port, comprising: when a host is turned on, when the first virtual serial port driver module is not in use, loading the second virtual serial port driver module to establish a link with a peripheral component interconnection high-speed expression device; after the second virtual serial port driver module is loaded, outputting operation log information to the peripheral component interconnection high-speed expression device.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for outputting a basic input / output system operation log based on a virtual serial port as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for outputting a basic input / output system operation log based on a virtual serial port as described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above methods for outputting a basic input / output system operation log based on a virtual serial port.
[0016] The present invention provides a device and method for outputting a basic input / output system operation log based on a virtual serial port, including the following beneficial effects: through the virtual serial port technology, the device provided by the present invention can conveniently output the operation log of the basic input / output system without complicated physical connections or additional hardware devices. The virtual serial port has high data transmission efficiency and can ensure that a large amount of operation log information is transmitted and stored in a timely and accurate manner. By using a virtual serial port to realize serial port log output, there is no need to match a Super I / O chip, which can greatly save costs and reduce the workload of hardware designers in circuit design. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a structural schematic diagram of a device for outputting basic input / output system operation log based on a virtual serial port provided by the present invention.
[0019] Figure 2 This is one of the flow charts of the method for outputting basic input / output system operation log based on a virtual serial port provided by the present invention.
[0020] Figure 3 This is the second flow chart of the method for outputting basic input / output system operation log based on a virtual serial port provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Some terms involved in the present invention are explained below.
[0024] BIOS (Basic Input Output System) is the most basic and direct hardware setting and control manager of the server motherboard, which can provide more simple and easy-to-use functions for the server. BIOS is the operating system boot program that runs when the system host is powered on. BIOS is a set of programs fixed to a Flash ROM chip on the motherboard. It stores the most important basic input and output programs of the computer, system setting information, self-test programs after power-on, and system self-starting programs. Its main function is to provide the most basic and direct hardware setting and control for the computer. BIOS is a binary file compiled from C language source code. When debugging, BIOS controls the serial COM port of the Super I / O chip to print out the operation log with debugging information. BIOS developers use the debugging PC terminal to collect the BIOS operation output log using a serial port line or SOL, and then analyze the log for debugging.
[0025] eSPI (Enhanced Serial Peripheral Interface) is a synchronous full-duplex serial communication protocol widely used in microcontrollers, sensors and other integrated circuits. Compared with SPI (Serial Peripheral Interface), eSPI has a more complex structure. The eSPI interface is used to replace the LPC (Low Pin Count) interface, so it is fully compatible with the functions of the LPC bus.
[0026] BMC (Baseboard Management Controller) 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 the device, perform remote management operations, and provide monitoring and control functions for the device.
[0027] SOL (Serial Over LAN) is a serial data technology transmitted over the network. It is used to transmit serial data within a LAN and extend the communication of serial devices to other devices within the LAN through network connections. In simple terms, SOL allows traditional serial interface data (such as data from devices such as printers and modems) to be converted into data packets that can be transmitted on the LAN, thereby realizing remote management and monitoring functions.
[0028] Super I / O is an IO management chip connected to high-speed devices such as the south bridge chip, which is responsible for the keyboard, mouse, serial COM port, parallel interface, floppy disk drive and many other low-speed devices.
[0029] The pin resources of the south bridge chip are a collection of all available pins on the south bridge chip, which are used to achieve electrical connection with other components on the motherboard.
[0030] Combine the following Figure 1-Figure 4 Embodiments of the present invention are described in detail.
[0031] When using a serial cable to collect BIOS serial port logs, you need to enter the machine room and use a serial cable to connect to the machine next to the machine, which is extremely inconvenient. Using SOL to collect BIOS serial port logs does not require direct connection to the machine. You only need the Internet Protocol address IP of the debugged machine's BMC to remotely connect to the debugged machine for log collection. For servers, the Super I / O is integrated in the BMC, and the serial port log output is still output to the BMC through the physical serial port, and then forwarded by the BMC to the LAN to form SOL. Therefore, in this SOL mode, the speed of serial port information output is still limited by the baud rate (data transmission rate) of the physical serial port. When the BIOS prints a large amount of debugging information, since the serial port data is generally output at a baud rate of 115200, the BIOS execution speed will be significantly slowed down. For machines with a normal boot time of about 1 minute, the boot time will be extended to more than 5 minutes when the log printing output is turned on. The boot time of some complex configuration machines may even reach more than half an hour after the log is turned on. This situation seriously affects the efficiency of BIOS developers in debugging and locating faults.
[0032] In the special case that the BMC fails or the BMC network cannot be connected, SOL will also be unavailable and remote serial port log collection will be impossible. You can only enter the computer room and use a serial port line to collect logs. If the Super I / O module of the BMC is not configured or the module is damaged, there is no way to collect serial port logs even if a serial port line is used.
[0033] Some domestic BMC chips do not have integrated Super I / O, and need to add a separate Super I / O chip to achieve serial port output (modern servers do not need parallel ports, floppy disks, PS2 keyboards and mice). Adding a Super I / O chip not only increases costs, but also occupies the pin resources of the south bridge chip, which brings challenges to hardware designers in designing circuits.
[0034] In order to solve the problems that the existing physical serial port has a slow log collection speed and cannot collect serial port logs when the BMC fails, and the problem that some BMC chips do not have integrated Super I / O and need to add chips separately, resulting in increased costs and difficult circuit design, the present invention provides a simple and easy-to-use BIOS method for sending debugging print and console information to the BMC through an eSPI bus using a virtual serial port and redirecting the debugging information to a local USB flash disk of a host (HOST).
[0035] like Figure 1 The present invention shows a device for outputting basic input and output system operation log based on a virtual serial port, comprising: The present invention provides a device for outputting a basic input / output system operation log based on a virtual serial port, comprising: The baseboard management controller 110 is provided with a first virtual serial port control module 1101, and the first virtual serial port control module is used to receive serial port data sent by the host through the enhanced serial peripheral interface bus; The host 120 is provided with a first virtual serial port driver module 1202 and a second virtual serial port control module 1204 on the south bridge chip of the host, the first virtual serial port driver module 1202 is used to send the operation log information to the first virtual serial port control module through the enhanced serial peripheral interface bus, and the second virtual serial port control module 1204 is used to output the operation log information to a text file under the universal serial bus flash disk when the existence of the universal serial bus flash disk is detected; The 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.
[0036] Specifically, in the hardware circuit, the BMC chip is connected to the south bridge chip of the host 120 via the eSPI bus 130; 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 regards it as a physical serial port controller that actually exists on the eSPI bus 130 .
[0037] After receiving the serial port data sent by the host 120, the first virtual serial port control module 1101 of the BMC stores the serial port data in a serial port log text file of a one-key log, and when SOL is enabled, forwards the serial port data to a data packet of the network SOL at the same time.
[0038] The eSPI serial port controller driver software module of the host BIOS, i.e., the first virtual serial port driver module 1202, sends the debug print information and the POST information to the first virtual serial port control module 1101 in the BMC via the eSPI bus 130; In the second virtual serial port control module 1204 of the host BIOS, the host regards it as a real physical serial port controller on the PCIE bus; The second virtual serial port control module 1204 checks whether the USB flash drive exists, and if so, outputs the debugging print information and the POST information to a text file under the USB flash drive; According to the BIOS Setup selection and setting, the first virtual serial port control module 1101 and the second virtual serial port control module 1204 can output serial port data simultaneously or separately.
[0039] According to a device for outputting basic input / output system operation log based on a virtual serial port provided by the present invention, a second virtual serial port driver module (not shown in the figure) is also provided on the south bridge chip of the host, which is used to forward the operation log information output by the virtual serial port to the sending queue of the peripheral component interconnection high-speed expression device without using the first virtual serial port driver module 1202.
[0040] Specifically, the host also has PCIE devices such as network cards. Generally, PCIE device drivers are loaded later, after the initialization of the CPU and memory. If the network card driver can be loaded earlier, or the network card is temporarily initialized before loading the network card driver, the virtual serial port can be directly redirected to the network card protocol stack, SOL can be implemented on the host side, and the coupling with the BMC can be released for remote log collection, which is of great significance for remotely operating Setup and OS without BMC.
[0041] 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 and the device for outputting a basic input / output system operation log based on a virtual serial port described above can correspond to each other.
[0042] Figure 2 It is one of the flow charts of the method for outputting basic input / output system operation log based on virtual serial port provided by the present invention, and is applicable to any of the above-mentioned devices for outputting basic input / output system operation log based on virtual serial port, such as Figure 2 As shown, the method comprises the following steps: S210 , when the host is turned on, the first virtual serial port driver module 1202 is loaded to establish a link with the first virtual serial port control module 1101 .
[0043] Specifically, the host (HOST) starts the power supply and enters the boot process. During the boot initialization process of the host, the operating system or BIOS will load a driver module (i.e., the first virtual serial port driver module 1202) designed specifically for the virtual serial port. The first virtual serial port driver module 1202 is responsible for providing an interface and protocol for communicating with the virtual serial port. The loaded first virtual serial port driver module 1202 will attempt 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) to ensure that the virtual serial port communication between the host and the BMC is unimpeded.
[0044] This step not only simplifies the traditional physical serial port communication method, but also greatly improves the data transmission rate and flexibility. Since the virtual serial port is not limited by the physical baud rate, its transmission speed can be greatly improved in theory, making the collection and debugging of BIOS operation logs faster and more efficient.
[0045] S220 , after the first virtual serial port driver module 1202 is loaded, output the operation log information to the first virtual serial port control module 1101 .
[0046] Specifically, after the host starts and loads the first virtual serial port driver module 1202, the driver module will actively establish a connection with the first virtual serial port control module 1101 on the BMC. Once the connection is successfully established, the host will start to send BIOS operation 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 these log information into a data packet that complies with the protocol and sends it to the first virtual serial port control module 1101 through the eSPI bus 130.
[0047] According to a method for outputting a basic input / output system operation log based on a virtual serial port provided by the present invention, before monitoring an enhanced serial peripheral interface bus through a first virtual serial port control module 1101, when a baseboard management controller is powered on and started, the first virtual serial port control module 1101 is loaded; after the first virtual serial port control module 1101 is loaded, the enhanced serial peripheral interface bus communication is monitored, and data from the first virtual serial port driver module 1202 is waited for.
[0048] 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 the operation log information to the first virtual serial port control module 1101, the first virtual serial port control module 1101 monitors 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.
[0049] Specifically, when the baseboard management controller (BMC) is powered 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 to simulate the behavior of real physical serial ports. After loading, the first virtual serial port control module 1101 starts to monitor the communication on the eSPI bus 130 and waits for data from the host. Once a data packet from the first virtual serial port driver module 1202 is detected, the module will immediately receive the data and store it locally or forward it to other destinations (such as a log server on the network).
[0050] By preloading the virtual serial port control module and starting to monitor the eSPI bus immediately after the BMC is started, the response time is greatly shortened and the overall performance of the system is improved. Through the continuous monitoring and interaction mechanism, the system can respond to log transmission needs in real time and avoid data loss or delay.
[0051] S230, determining whether the second virtual serial port control module 1204 is set to be enabled in the basic input and output system; if the second virtual serial port control module 1204 is set to be enabled, loading the second virtual serial port control module 1204 according to a preset default configuration, and checking whether a universal serial bus flash disk exists.
[0052] According to a method for outputting basic input / output system operation logs based on a virtual serial port provided by the present invention, checking whether a universal serial bus flash disk exists specifically includes: checking whether a universal serial bus memory mounted by a baseboard management controller through a universal serial bus channel and a universal serial bus flash disk that is actually physically connected exist; if either of the two exists, it is deemed that the universal serial bus flash disk exists.
[0053] Specifically, when the host is turned on and the BIOS setup is initialized, the system checks the enabled state of the second virtual serial port control module 1204 according to the configuration in the BIOS Setup. The system reads the corresponding option in the BIOS setup to determine whether the second virtual serial port control module is enabled by the user or administrator.
[0054] If the second virtual serial port control module is set to 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, parity, and the internal buffer size of the virtual serial port. After the configuration is completed, the system will perform an additional step to check whether a 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 USB channel of the BMC (such as a temporary storage medium during network startup), and the other is a USB flash drive that is directly physically connected to the host. The system will traverse these device interfaces to find out whether there is a recognizable USB storage device. If any one is found, it is considered that the USB flash drive exists and log information is prepared to be output to the device.
[0055] By intelligently detecting and configuring the second virtual serial port control module 1204, and flexibly identifying USB storage devices, more flexibility and convenience are provided to users. It allows users to enable or disable the function of the virtual serial port output to the USB flash drive according to actual needs, so as to conveniently collect and analyze the BIOS operation log without affecting the normal operation of the system. In addition, by supporting both network-mounted USB storage and physically connected USB flash drives, the compatibility and availability of the system 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.
[0056] S240: If the USB flash disk exists, create a text file of the serial port output information on the USB flash disk, and point the output handle of the second virtual serial port control module 1204 to the text file.
[0057] Specifically, after confirming the existence of the USB flash drive, the system will create 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 log can be easily found and read later. At the same time, the system will point the output handle of the second virtual serial port control module to the newly created text file so that the subsequent serial port information can be directly written into the file.
[0058] S250: After the host finishes loading the second virtual serial port control module 1204, output the operation log information to the universal serial bus flash disk.
[0059] Specifically, when the host completes loading of the second virtual serial port control module 1204, the module will begin to capture and process the debugging print information and POST (Power On Self Test) information during the BIOS operation. According to the previous configuration, these information will be redirected to the specified text file on the USB flash drive. Whenever new log information is generated, the second virtual serial port control module 1204 will write this information to the text file through its output handle. In this way, developers can find and read these log information on the USB flash drive for subsequent debugging and analysis.
[0060] By intelligently creating and managing text files of 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 of developers obtaining and analyzing log information. In addition, by storing log information on a removable USB flash drive, it also facilitates the sharing and transmission of log information, improves the efficiency of team collaboration, and makes the BIOS development and debugging process more efficient, convenient and flexible.
[0061] A method for outputting a basic input / output system operation log based on a virtual serial port provided by the present invention is applicable to a device including a second virtual serial port driver module for outputting a basic input / output system operation log based on a virtual serial port, comprising: when a host is turned on, when the first virtual serial port driver module 1202 is not in use, loading the second virtual serial port driver module to establish a link with a peripheral component interconnection high-speed expression device; after the second virtual serial port driver module is loaded, outputting operation log information to the peripheral component interconnection high-speed expression device.
[0062] Specifically, when the host is powered on, the system will first check whether the first virtual serial port driver module 1202 is already 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 link with the peripheral component interconnection high-speed expression PCIE device (such as a network card), and send the operation log to the SOL through the network card.
[0063] Although serial port debugging information cannot be output before the network card driver protocol stack is loaded, which has a great impact on BIOS debugging because CPU and memory occupy a large part in BIOS debugging, this method is of great significance for remote operation of Setup and OS without BMC. It ensures that when the first virtual serial port driver module fails and cannot be used, the system can flexibly switch to the second virtual serial port for log output, realizes remote log collection, and reduces coupling with BMC.
[0064] like Figure 3The figure shows the second flow chart of the method for outputting basic input / output system operation log based on the virtual serial port provided by the present invention.
[0065] S1: After power-on, the BMC starts the first virtual serial port control module process, allocates storage space to simulate the register of the serial port controller, and simulates interrupt resources.
[0066] S2: After the first virtual serial port control module on the BMC side is loaded and started, it monitors the eSPI bus communication and waits for the host configuration.
[0067] S3: When the host is powered on, it first loads the first virtual serial port driver module, establishes a link with the first virtual serial port control module on the BMC side, configures the register and interrupt of the first virtual serial port according to the preset default configuration, and waits for serial port data output.
[0068] S4: The host determines whether the second virtual serial port control module is set to be enabled in the enable control option of BIOS Setup.
[0069] S5: When the second virtual serial port control module is set to be enabled, according to the preset default configuration, configure the basic parameters of the second virtual serial port (such as baud rate, data bit, stop bit, etc.), configure the virtual registers and interrupts and other resources of the second virtual serial port control module, and make it enter the ready-to-send state.
[0070] S6: When the second virtual serial port control module is set to be enabled, check whether the USB flash disk exists. The USB storage mounted by the BMC through the USB channel and the USB flash disk actually physically connected are both considered to exist.
[0071] S7: If the USB flash drive exists, create a text file of the 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.
[0072] S8: After the first virtual serial port driver module and the second virtual serial port control module are loaded, the host outputs operation log information from the two virtual serial ports.
[0073] S9: When the host fails to load the first virtual serial port driver module at startup, it loads the second virtual serial port driver module, establishes a link with a PCIE device such as a network card, and configures the registers and interrupts of the third virtual serial port according to the preset default configuration, and waits for serial port data output.
[0074] The present invention provides a method for increasing the serial port output speed by replacing the physical serial port output with a virtual serial port, and can output serial port information in the special case of a BMC chip failure. Because the virtual serial port does not have the baud rate limit of the physical serial port configuration, the theoretical maximum transmission rate is only limited by the eSPI bus transmission rate. eSPI generally 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 use, and is convenient for server BIOS developers to debug and use. Using a virtual serial port to realize serial port log output, there is no need to match a Super I / O chip, which can greatly save costs and reduce the workload of hardware designers in line design.
[0075] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor (processor) 410 , a communication interface (Communications Interface) 420 , a memory (memory) 430 and a communication bus 440 , wherein the processor 410 , the communication interface 420 , and the memory 430 communicate with each other through the communication bus 440 . The processor 410 can call the logic instructions in the memory 430 to execute a method for outputting a basic input and output system operation log based on a virtual serial port, the method comprising: when the host is turned 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; judging whether a second virtual serial port control module is set to be enabled in the basic input and output system; if the second virtual serial port control module is set to be enabled, loading the second virtual serial port control module according to a preset default configuration, and checking whether a universal serial bus flash disk exists; if the universal serial bus flash disk exists, creating a text file of serial port output information on the universal serial bus flash disk, and pointing 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, outputting the operation log information to the universal serial bus flash disk.
[0076] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0077] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program 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 a basic input and output system operation log based on a virtual serial port provided by the above methods. The method includes: when the host is turned 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; judging whether a second virtual serial port control module is set to be enabled in the basic input and output system; if the second virtual serial port control module is set to be enabled, loading the second virtual serial port control module according to a preset default configuration, and checking whether a universal serial bus flash disk exists; if the universal serial bus flash disk exists, creating a text file of serial port output information on the universal serial bus flash disk, and pointing 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, outputting the operation log information to the universal serial bus flash disk.
[0078] On the other hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for outputting a basic input / output system operation log based on a virtual serial port provided by the above methods is implemented. The method includes: when the host is turned 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; judging whether a second virtual serial port control module is set to be enabled in the basic input / output system; if the second virtual serial port control module is set to be enabled, loading the second virtual serial port control module according to a preset default configuration, and checking whether a universal serial bus flash disk exists; if the universal serial bus flash disk exists, creating a text file of serial port output information on the universal serial bus flash disk, and pointing 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, outputting the operation log information to the universal serial bus flash disk.
[0079] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0080] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A device for outputting basic input and output system operation log based on a virtual serial port, characterized in that: include: A baseboard management controller, on which a first virtual serial port control module is arranged, and the first virtual serial port control module is used to receive serial port data sent by a host through an enhanced serial peripheral interface bus; A host, wherein a first virtual serial port driver module and a second virtual serial port control module are arranged on a south bridge chip of the host, wherein the first virtual serial port driver module is used to send operation log information to the first virtual serial port control module through an enhanced serial peripheral interface bus, and 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 disk when the existence of the universal serial bus flash disk is detected; The 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.
2. The device for outputting basic input and output system operation log based on a virtual serial port according to claim 1, characterized in that: The south bridge chip of the host is also provided with a second virtual serial port driver module, which is used for forwarding the operation log information output by the virtual serial port to the sending queue of the peripheral component interconnection high-speed expression device without using the first virtual serial port driver module.
3. A method for outputting basic input / output system operation log based on a virtual serial port, applicable to the device for outputting basic input / output system operation log based on a virtual serial port according to claim 1 or 2, characterized in that: include: When the host is powered on, the first virtual serial port driver module is loaded to establish 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; Determine whether the second virtual serial port control module is set to be enabled in the basic input and output system; If the second virtual serial port control module is set to be enabled, the second virtual serial port control module is loaded according to a preset default configuration, and a check is made as to whether the universal serial bus flash disk exists; If the universal serial bus flash disk exists, creating a text file of serial port output information on the universal serial bus flash disk, and pointing the output handle of the second virtual serial port control module to the text file; After the host finishes loading the second virtual serial port control module, the operation log information is output to the universal serial bus flash disk.
4. The method for outputting basic input / output system operation log based on a virtual serial port according to claim 3, characterized in that: After outputting the operation log information to the first virtual serial port control module, the method further includes: Monitoring, by the first virtual serial port control module, 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.
5. The method for outputting basic input / output system operation log based on a virtual serial port according to claim 4, characterized in that: Before monitoring the enhanced serial peripheral interface bus through the first virtual serial port control module, the method further includes: When the baseboard management controller is powered on and started, the first virtual serial port control module is loaded; When the first virtual serial port control module is loaded, it monitors the enhanced serial peripheral interface bus communication and waits for data from the first virtual serial port driver module.
6. The method for outputting basic input / output system operation log based on a virtual serial port according to claim 3, characterized in that: The checking whether the universal serial bus flash disk exists specifically includes: Check whether the Universal Serial Bus memory mounted by the baseboard management controller through the Universal Serial Bus channel and the Universal Serial Bus flash disk actually physically connected exist. If either of the two exists, it is deemed that the Universal Serial Bus flash disk exists.
7. The method for outputting basic input / output system operation log based on a virtual serial port according to claim 3 is applicable to the device for outputting 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, in the case where the first virtual serial port driver module is not in use, the second virtual serial port driver module is loaded to establish a link with the peripheral component interconnection high-speed expression device; After the second virtual serial port driver module is loaded, the operation log information is output to the peripheral component interconnect high-speed expression device.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for outputting a basic input / output system operation log based on a virtual serial port as described in any one of claims 3 to 7 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for outputting a basic input / output system operation log based on a virtual serial port as claimed in any one of claims 3 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for outputting a basic input / output system operation log based on a virtual serial port as claimed in any one of claims 3 to 7 is implemented.
Citation Information
Patent Citations
Method and system for carrying out linux log management through virtual serial port
CN104461953A
Server fault diagnosis method and device
CN113835942A
Serial port debugging method and device, computer equipment and storage medium
CN116483635A
Server, baseboard management controller and management method of server
CN117950946A
Enhanced Serial Peripheral Interface (eSPI) Signaling for Crash Event Notification
US20190251010A1
Cited By
Communication management machine system based on domestic single-chip microcomputer
CN119807129A
Basic input and output system diagnosis method and device, storage medium and server
CN120872793A