An operating system and method for debugging startup information based on universal serial port transmission
By controlling the BIOS settings module and using the selection switch module to switch the serial port connection in different modes, the problem of the computer being unable to output CPU debug serial port startup information was solved. This enabled the acquisition of CPU debug serial port information through the system's general serial port, reducing the difficulty of fault diagnosis and recovery time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU TIANYUXING TECH CO LTD
- Filing Date
- 2022-09-20
- Publication Date
- 2026-04-24
AI Technical Summary
When a computer communicates with external devices via a general serial port or USB interface, it cannot output the startup information of the CPU debug serial port, resulting in a large workload, high difficulty, and low efficiency in fault diagnosis and localization.
The design selects a switch module that, under the control of the BIOS setting module, enables different modes to connect the system's general serial port to the CPU's general serial port or to the CPU's debug serial port, and outputs the CPU debug serial port's boot information through the operating system's inherent system general serial port.
It reduces the workload and difficulty of fault diagnosis and location, shortens fault recovery time, and improves fault handling efficiency.
Smart Images

Figure CN115509976B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer debugging technology, and specifically to an operating system and method based on universal serial port transmission of debugging startup information. Background Technology
[0002] The debug serial port is the first device initialized by the CPU processor. It can receive all processor system messages, so computer motherboard manufacturers typically use it for low-level hardware debugging and diagnosing motherboard hardware anomalies. The general-purpose serial port is an asynchronous communication port provided by the computer motherboard manufacturer to device manufacturers for data communication with external sensors, terminals, etc. The debug serial port is usually fixed and designated by the CPU processor for processor and operating system initialization output information and cannot be arbitrarily changed. For example, the debug serial port of the Phytium processor is COM1, and the debug serial port of the Loongson processor is COM0, etc.
[0003] In practical industrial control applications, communication with external devices is usually achieved through general serial ports or USB interfaces. Unfortunately, these interfaces cannot output the startup information of the CPU debugging serial port. To obtain the startup information of the CPU debugging serial port, it is necessary to disassemble and debug, which not only increases the workload and difficulty of computer fault diagnosis and location, but also reduces the efficiency of fault recovery. Summary of the Invention
[0004] The technical problem this invention aims to solve is that computers typically communicate with external devices via general-purpose serial ports or USB interfaces, but these interfaces cannot output boot information from the CPU debug serial port. Obtaining this information requires disassembling the computer for debugging, which not only increases the workload and difficulty of computer fault diagnosis and localization but also reduces fault recovery efficiency. This invention aims to provide an operating system and method for transmitting debug boot information based on a general-purpose serial port. By designing a selection switch module, under the control of the BIOS setting module, it enables different modes to connect the system's general-purpose serial port to the CPU's general-purpose serial port or to the CPU debug serial port, thus solving the problem that the system's general-purpose interfaces cannot output boot information from the CPU debug serial port.
[0005] This invention is achieved through the following technical solution:
[0006] This solution provides an operating system based on general serial port transmission of debugging and startup information, including: a processing unit and a programmable logic unit;
[0007] The processing unit includes: a CPU general serial port, a CPU debug serial port, and a BIOS setting module; the programmable logic unit includes a selection switch module.
[0008] The selection switch module is used to select whether to connect the system general serial port to the CPU general serial port or to the CPU debug serial port according to the mode command of the BIOS setting module.
[0009] The working principle of this solution: Computers typically communicate with external devices via general-purpose serial ports or USB interfaces. However, these interfaces cannot output boot information from the CPU debug serial port. Obtaining this information requires disassembling the computer for debugging, which not only increases the workload and difficulty of computer fault diagnosis and localization but also reduces the efficiency of fault recovery. The purpose of this invention is to provide an operating system based on general-purpose serial port transmission of debug boot information. By designing a selection switch module, under the control of the BIOS setting module, it enables different modes to connect the system's general-purpose serial port to the CPU's general-purpose serial port or to the CPU debug serial port, thus solving the problem that the system's general-purpose interfaces cannot output boot information from the CPU debug serial port.
[0010] A further optimized solution is that the selection switch module includes: a logic command input terminal, a first buffer, a second buffer, a first double-pole double-throw switch, and a second double-pole double-throw switch; the logic command input terminal receives mode commands from the BIOS setting module;
[0011] The first stationary terminal of the first double-pole double-throw switch is connected to the CPU debugging serial port, the second stationary terminal is connected to the system general serial port, and the logic command input terminal is connected to the moving terminal of the first double-pole double-throw switch through the first buffer.
[0012] The first stationary terminal of the second double-pole double-throw switch is connected to the CPU's general-purpose serial port, the second stationary terminal is connected to the system's general-purpose serial port, and the logic command input terminal is connected to the moving terminal of the second double-pole double-throw switch via the second buffer.
[0013] A further optimization is that the programmable logic unit further includes a mode control module, which includes a command parser and a controller;
[0014] The command parser is connected to the BIOS setup module via communication buses such as SPI, I2C, and LBC. The command parser is used to parse the mode commands of the BIOS setup module.
[0015] The controller is connected between the command parser and the selection switch module. The controller is used to control the selection switch module according to the mode command.
[0016] A further optimization is that the mode control module also includes an emergency diagnostic mode controller; the emergency diagnostic mode controller is connected to the controller.
[0017] The emergency diagnostic mode controller is used to receive external emergency diagnostic commands. The controller also inputs emergency diagnostic commands to the logic command input terminal based on the external emergency diagnostic commands. The emergency diagnostic commands are connected to the system's general serial port and the CPU debugging serial port.
[0018] A further optimized solution is that the external emergency diagnostic command is a segment of signature code repeatedly sent from the external general-purpose data serial port to the system general-purpose serial port.
[0019] To prevent the BIOS setup module's initialization process from being blocked by peripherals, thus preventing the operating system from entering the BIOS selection mode, this solution uses an emergency diagnostic mode controller and related circuitry to switch the serial port from the default CPU general-purpose serial port to the CPU debug serial port. The mechanism is as follows: after the operating system powers on, it first powers on the emergency diagnostic mode receiver, and then powers on the CPU. Simultaneously, after the operating system powers on, the external debugging computer repeatedly sends a 32-bit data segment to the device at a baud rate of 115200 via the general-purpose data serial port to the TxD line. During the period before the CPU powers on, the emergency diagnostic mode receiver detects the waveform on the general-purpose data line. If a changing waveform is detected, and the decoded waveform is an emergency diagnostic mode instruction, the selection switch module switches the serial port to the CPU debug serial port. The device's asynchronous serial interface then becomes the debug serial port, enabling the system's general-purpose interface to output CPU power-on printed information.
[0020] This solution also provides a method for transmitting debug startup information based on a general serial port, including the following steps:
[0021] Step 1, Configuration Mode:
[0022] Configure mode one as diagnostic mode and mode two as user mode in the operating system where the system's general serial port is located;
[0023] Step two, the processor generates mode instructions;
[0024] Step 3: Select either the CPU debug serial port or the CPU general serial port to connect to the processor based on the mode command:
[0025] In diagnostic mode, connect the CPU debug serial port to the system's general serial port;
[0026] In user-mode instructions, connect the CPU's general-purpose serial port to the system's general-purpose serial port.
[0027] The further optimized plan includes, in step three:
[0028] Configure a serial port line selection switch in the operating system where the general serial port is located;
[0029] When the serial port selection switch receives a diagnostic mode command, it closes the path between the CPU debug serial port and the system general serial port.
[0030] When the serial port line selection switch receives a user mode instruction, it closes the path between the CPU general serial port and the system general serial port.
[0031] A further optimized solution includes the following steps before step two:
[0032] By default, the processor's general-purpose serial port is configured to connect to the system's general-purpose serial port;
[0033] After the operating system running the general serial port is powered on, it first searches for external emergency diagnostic commands and executes process A before powering on the processor.
[0034] Process A: When the operating system running the general serial port receives an external emergency diagnostic command, it sets the processor's debug serial port to connect with the system's general serial port.
[0035] A further optimized solution is that the external emergency diagnostic command is a segment of signature code repeatedly sent from the external general-purpose data serial port to the system general-purpose serial port.
[0036] A further optimized solution is to first detect whether there is a change in the waveform of the data line of the system's general serial port when an external emergency diagnostic command is received. If so, decode the waveform to see if it is an emergency diagnostic command. Otherwise, directly power on the processor and proceed to step two.
[0037] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0038] This invention provides an operating system and method based on universal serial port transmission of debugging boot information. By designing a selection switch module, under the control of the BIOS setting module, it enables different modes to connect the system universal serial port to the CPU universal serial port or to the CPU debugging serial port. This solves the problem that the system's universal interface cannot output boot information from the CPU debugging serial port. By using the operating system's inherent system universal serial port to output CPU debugging serial port boot information, it not only reduces the workload and difficulty of operating system fault diagnosis and location but also shortens the operating system fault recovery time and improves fault handling efficiency. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0040] Figure 1 This is a schematic diagram of the operating system structure based on the transmission of debugging and startup information via a general serial port;
[0041] Figure 2 A schematic diagram of the selector switch module structure;
[0042] Figure 3 This is a schematic diagram of the mode control module structure;
[0043] Figure 4 Power-on sequence diagram for the emergency diagnostic receiver;
[0044] Figure 5 This is a flowchart illustrating a method for transmitting debugging startup information via a general serial port. Detailed Implementation
[0045] Because current general-purpose computer serial ports cannot output the startup information of the CPU debug serial port, it is difficult to obtain the underlying hardware initialization information on the debug serial port in a convenient and quick manner when performing fault diagnosis in practical applications. This increases the workload and difficulty of fault diagnosis and location, and reduces the efficiency of fault recovery.
[0046] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0047] Example 1
[0048] This embodiment provides an operating system based on universal serial port transmission of debugging and startup information, such as... Figure 1 As shown, it includes: a processing unit and a programmable logic unit;
[0049] The processing unit includes: a CPU general serial port, a CPU debug serial port, and a BIOS setting module; the programmable logic unit includes a selection switch module.
[0050] The selection switch module is used to select whether to connect the system general serial port to the CPU general serial port or to the CPU debug serial port according to the mode command of the BIOS setting module.
[0051] like Figure 2 As shown, the selection switch module includes: a logic command input terminal, a first buffer, a second buffer, a first double-pole double-throw switch, and a second double-pole double-throw switch; the logic command input terminal SEL receives mode commands from the BIOS setting module;
[0052] The first stationary terminal of the first double-pole double-throw switch is connected to the CPU debugging serial port, the second stationary terminal is connected to the system general serial port, and the logic command input terminal SEL is connected to the moving terminal of the first double-pole double-throw switch through the first buffer.
[0053] The first stationary terminal of the second double-pole double-throw switch is connected to the CPU's general-purpose serial port, and the second stationary terminal is connected to the system's general-purpose serial port. The logic command input terminal SEL is connected to the moving terminal of the second double-pole double-throw switch via the second buffer.
[0054] Under the control of SEL, the CPU debug serial port or the CPU general serial port and the system general serial port are connected. When SEL is logic 1, the running serial port is the CPU general serial port; when SEL is logic 0, the running serial port is the CPU debug serial port.
[0055] The programmable logic unit also includes a mode control module, such as... Figure 3 As shown, the mode control module includes: a command parser and a controller;
[0056] The command parser is connected to the BIOS setup module via communication buses such as SPI, I2C, and LBC. The command parser is used to parse the mode commands of the BIOS setup module.
[0057] The controller is connected between the command parser and the selection switch module. The controller is used to control the selection switch module according to the mode command.
[0058] The mode control module also includes an emergency diagnostic mode controller; the emergency diagnostic mode controller is connected to the controller.
[0059] The emergency diagnostic mode controller is used to receive external emergency diagnostic commands. The controller also inputs emergency diagnostic commands to the logic command input terminal based on the external emergency diagnostic commands. The emergency diagnostic commands are connected to the system's general serial port and the CPU debugging serial port.
[0060] By default, the processor's CPU general serial port is configured to connect to the system's general serial port;
[0061] After the operating system on the general serial port is powered on, the emergency diagnostic mode controller is first instructed to search for external emergency diagnostic commands and execute process A before powering on the processor.
[0062] Process A: When the operating system running the general serial port receives an external emergency diagnostic command, it sets the processor's debug serial port to connect with the system's general serial port.
[0063] The power-on sequence diagram of the emergency diagnostic mode controller is as follows: Figure 4As shown, the power supply is connected to the emergency diagnostic mode controller and the CPU processor unit respectively. Relay T1 is installed between the power supply and the CPU processor unit. The processor is powered on after the emergency diagnostic mode controller receives the external emergency diagnostic command and completes process A.
[0064] The external emergency diagnostic command is a 32-bit data segment repeatedly sent from the external general-purpose data serial port to the TxD line of the operating system to the device at a baud rate of 115200.
[0065] The design method proposed in this embodiment for outputting CPU debug serial port startup information on a general serial port line solves the problem that the startup information of the processor's debug serial port cannot be easily obtained during computer device diagnosis. This not only reduces the workload and difficulty of fault diagnosis and location, but also shortens the fault recovery time and improves fault handling efficiency.
[0066] Example 2
[0067] Based on the previous embodiment, this embodiment provides a method for transmitting debug startup information via a general serial port, such as... Figure 5 As shown, the steps include:
[0068] Step 1, Configuration Mode:
[0069] Configure mode one as diagnostic mode and mode two as user mode in the operating system where the system's general serial port is located;
[0070] Step two, the processor generates mode instructions;
[0071] Step 3: Select either the CPU debug serial port or the CPU general serial port to connect to the processor based on the mode command:
[0072] In diagnostic mode, connect the CPU debug serial port to the system's general serial port;
[0073] In user-mode instructions, connect the CPU's general-purpose serial port to the system's general-purpose serial port.
[0074] Step three includes:
[0075] Configure a serial port line selection switch in the operating system where the general serial port is located;
[0076] When the serial port selection switch receives a diagnostic mode command, it closes the path between the CPU debug serial port and the system general serial port.
[0077] When the serial port line selection switch receives a user mode instruction, it closes the path between the CPU general serial port and the system general serial port.
[0078] The steps preceding step two include:
[0079] By default, the processor's general-purpose serial port is configured to connect to the system's general-purpose serial port;
[0080] After the operating system running the general serial port is powered on, it first searches for external emergency diagnostic commands and executes process A before powering on the processor.
[0081] Process A: When the operating system running the general serial port receives an external emergency diagnostic command, it sets the processor's debug serial port to connect with the system's general serial port.
[0082] The external emergency diagnostic command is a 32-bit data segment repeatedly sent from the external general-purpose data serial port to the system's general-purpose serial port via the TxD line to the device at a baud rate of 115200.
[0083] Upon receiving an external emergency diagnostic command, first detect whether there is a change in the waveform on the TxD line of the system's general serial port to the device. If so, decode the waveform to see if it is an emergency diagnostic command. Otherwise, directly power on the processor and proceed to step two.
[0084] This embodiment enables the hardware initialization startup information of the CPU debug serial port to be output on the system's general serial port, solving low-level hardware problems that cannot be located at the operating system and software levels, and improving the efficiency of device fault analysis.
[0085] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An operating system based on universal serial port transmission of debugging and startup information, characterized in that, include: Processing units and programmable logic units; The processing unit includes: a CPU general serial port, a CPU debug serial port, and a BIOS setting module; the programmable logic unit includes a selection switch module. The selection switch module is used to select whether to connect the system general serial port to the CPU general serial port or to connect the system general serial port to the CPU debug serial port according to the mode command of the BIOS setting module. The programmable logic unit further includes a mode control module, which includes a command parser and a controller. The command parser is connected to the BIOS setup module via SPI, I2C, and LBC communication buses. The command parser is used to parse the mode commands of the BIOS setup module. The controller is connected between the command parser and the selection switch module. The controller is used to control the selection switch module according to the mode command. The mode control module also includes an emergency diagnostic mode controller; the emergency diagnostic mode controller is connected to the controller. The emergency diagnostic mode controller is used to receive external emergency diagnostic commands. The controller also inputs emergency diagnostic commands to the logic command input terminal based on the external emergency diagnostic commands. The emergency diagnostic commands are connected between the system's general serial port and the CPU debugging serial port. The external emergency diagnostic command is a segment of signature code that is repeatedly sent from the external general-purpose data serial port to the operating system's general-purpose serial port; The external emergency diagnostic command is a 32-bit segment repeatedly sent from the external general-purpose data serial port to the operating system's TxD line to the device at a baud rate of 115200. By default, the processor's CPU general-purpose serial port is set to connect to the system's general-purpose serial port. After the operating system where the general-purpose serial port is located is powered on, it first searches for the external emergency diagnostic command, executes it, and then powers on the processor.
2. The operating system based on universal serial port transmission of debugging and startup information according to claim 1, characterized in that, The selection switch module includes: a logic command input terminal, a first buffer, a second buffer, a first double-pole double-throw switch, and a second double-pole double-throw switch; the logic command input terminal receives mode commands from the BIOS setting module; The first stationary terminal of the first double-pole double-throw switch is connected to the CPU debugging serial port, the second stationary terminal is connected to the system general serial port, and the logic command input terminal is connected to the moving terminal of the first double-pole double-throw switch through the first buffer. The first stationary terminal of the second double-pole double-throw switch is connected to the CPU's general-purpose serial port, the second stationary terminal is connected to the system's general-purpose serial port, and the logic command input terminal is connected to the moving terminal of the second double-pole double-throw switch via the second buffer.
3. A method for transmitting debugging startup information based on a general serial port, implemented based on the operating system described in claim 1 or 2, characterized in that, The method includes the following steps: Step 1, Configuration Mode: Configure mode one as diagnostic mode and mode two as user mode in the operating system where the system's general serial port is located; Step two, the processor generates mode instructions; Step 3: Select either the CPU debug serial port or the CPU general serial port to connect to the processor based on the mode command: In diagnostic mode, connect the CPU debug serial port to the system's general serial port; In user-mode instructions, connect the CPU's general-purpose serial port to the system's general-purpose serial port.
4. The method for transmitting debugging startup information based on a general serial port according to claim 3, characterized in that, Step three includes: Configure a serial port line selection switch in the operating system where the general serial port is located; When the serial port selection switch receives a diagnostic mode command, it closes the path between the CPU debug serial port and the system general serial port. When the serial port line selection switch receives a user mode instruction, it closes the path between the CPU general serial port and the system general serial port.
5. The method for transmitting debugging startup information based on a general serial port according to claim 4, characterized in that, The steps preceding step two include: By default, the processor's general-purpose serial port is configured to connect to the system's general-purpose serial port; After the operating system running the general serial port is powered on, it first searches for external emergency diagnostic commands and executes process A before powering on the processor. Process A: When the operating system running the general serial port receives an external emergency diagnostic command, it sets the processor's debug serial port to connect with the system's general serial port.
6. The method for transmitting debugging startup information based on a general serial port according to claim 5, characterized in that, The external emergency diagnostic command is a segment of signature code that is repeatedly sent from the external general-purpose data serial port to the system general-purpose serial port.
7. The method for transmitting debugging startup information based on a general serial port according to claim 6, characterized in that, Upon receiving an external emergency diagnostic command, first check if there is a change in the waveform of the data line of the system's general serial port. If so, decode the waveform to see if it is an emergency diagnostic command. Otherwise, directly power on the processor and proceed to step two.
Citation Information
Patent Citations
Novel automatic switchover emergency processing device and implementing method thereof
CN103809471A
Switching method and device of multiplexing of multiple processor debugging ports on single board
CN106445859A