Debugging information output method and device of microkernel operating system and storage medium

By setting the first process to receive and output debugging information in the user space of the microkernel operating system and using a ring buffer and a backup driver module, the problem of unstable debugging information output in the microkernel operating system is solved, and efficient and reliable debugging information transmission is achieved.

CN115016999BActive Publication Date: 2025-10-17ZEBRED NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210674827.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-15
Publication Date
2025-10-17
Estimated Expiration
2042-06-15

AI Technical Summary

Technical Problem

How to efficiently and stably output debugging information in a microkernel operating system to help developers understand the system status, especially in safety-critical fields such as aviation, medical equipment, and automotive systems.

Method used

By setting up a first process in the user space of the microkernel operating system, debugging information from M functional modules is received and output to the UART hardware device through the UART driver module. A ring buffer is used to ensure that the information is not confused, and a backup driver module is provided when the microkernel starts to ensure stability.

Benefits of technology

The accuracy and stability of debug information output are improved, ensuring that debug information can still be output normally when user space or microkernel exceptions occur, and improving the system's debugging and fault location capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115016999B_ABST
    Figure CN115016999B_ABST
Patent Text Reader

Abstract

The application provides a method and device for outputting debugging information of a microkernel operating system and a storage medium. In the technical solution of the application, a Console process in a user space of a microkernel operating system can receive first debugging information of a plurality of functional modules in the user space and / or a kernel space, the Console process determines second debugging information based on the first debugging information, and the Console process sends the second debugging information to a UART through a driving module of the UART to realize output of the debugging information. Based on the debugging information, a developer can more accurately master the running status of the microkernel operating system, and thus assist the developer in improving the performance of the microkernel operating system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the computer technical field, and in particular to a microkernel operating system debugging information output method, device and storage medium. BACKGROUND

[0002] The core idea of the microkernel operating system is that the kernel only provides the most basic mechanism, and most other functions of the kernel are moved from the kernel to the service processes in the user space, and each service process is independent of each other, so that an error generated in a service process will not affect other processes. Because of the above advantages, the microkernel operating system is widely used in the fields of aviation, medical devices, vehicle-mounted systems and other highly dependent on safety and reliability.

[0003] In order to improve the performance of the microkernel operating system, the microkernel operating system needs to be debugged, and the debugging information of the microkernel operating system needs to be obtained. Therefore, how to obtain the debugging information of the microkernel operating system becomes a technical problem to be solved. SUMMARY

[0004] The present application provides a microkernel operating system debugging information output method, device and storage medium, which can help developers more accurately master the running status of the microkernel operating system.

[0005] In a first aspect, the present application provides a microkernel operating system debugging information output method, which comprises: a first process in a user space of the microkernel operating system receiving first debugging information of each of M function modules in the microkernel operating system, M being a positive integer, and the first process being a running process of a driver module of a universal asynchronous receiver transmitter (UART); and the first process sending second debugging information of each of the function modules to the UART, the second debugging information comprising the first debugging information of each of the function modules.

[0006] In the method, the first process in the microkernel operating system receives the first debugging information from each of the M function modules, and the first process sends the second debugging information of each of the function modules to the UART after receiving the first debugging information. Because the first process and each of the function modules in the microkernel operating system are independent processes, the first process and each of the function modules only run in their own address spaces and do not affect each other, which can improve the stability of the first process and each of the function modules.

[0007] In a possible implementation, the M function modules comprise: a function module in a user application process in the user space and / or a microkernel module in the microkernel operating system.

[0008] In a possible implementation, the functional modules in the user application process include: a user space upper layer module and / or a user space core functional module.

[0009] In this implementation, because these functional modules come from user space and / or kernel space, both user space and / or kernel space can output debugging information, and developers can more comprehensively reflect the overall operating status of the system based on the debugging information.

[0010] In a possible implementation, after the first process receives the first debugging information of each functional module from each functional module, the method further includes: the first process determines second debugging information based on the first debugging information, and stores the second debugging information in a ring buffer; accordingly, the first process sends the second debugging information of each functional module to the UART, including: the first process sends the second debugging information stored in the ring buffer to the UART.

[0011] In this implementation, the ring buffer is a cyclic buffer with a first-in-first-out mechanism. Storing the second debugging information in the ring buffer can ensure that the contents of each second debugging information will not be stored in an interleaved manner and thus improve the accuracy of the debugging information output.

[0012] In a possible implementation, the first process includes M+1 threads, where M threads among the M+1 threads correspond one-to-one to the M functional modules; accordingly, the first process receives the first debugging information of each functional module from each functional module, including: each thread among the M threads receives the first debugging information of the corresponding functional module from the functional module corresponding to each thread; the first process sends the second debugging information stored in the ring buffer to the UART, including: threads among the M+1 threads other than the M threads send the second debugging information stored in the ring buffer to the UART.

[0013] In this implementation, the first process receives the first debugging information from the M functional modules through M threads included in the M+1 threads, which can improve the output efficiency of the first debugging information. In addition, the threads other than the M threads in the M+1 threads included in the first process may not be the same threads as the M threads receiving the first debugging information, which can improve transmission efficiency.

[0014] In a possible implementation, the microkernel module of the microkernel operating system further includes a driver module for the UART; accordingly, the method further includes: sending debugging information of the microkernel module to the UART via the driver module for the UART in the microkernel module.

[0015] In the implementation, the microkernel module contains a driver module of the UART, when the microkernel module is started, the debugging information of the microkernel module can be output through the driver module of the UART in the microkernel module; when the first process in the user space crashes, the debugging information of other processes in the user space and the debugging information of the microkernel module can be output through the driver module of the UART in the microkernel module, so that the output stability and security of the debugging information can be improved.

[0016] In a possible implementation, the second debugging information further includes an output time of the first debugging information.

[0017] In the implementation, the second debugging information further includes an output time of the first debugging information, so that the UART can output the output time information of the first debugging information, and thus the debugging personnel can know the output time of the debugging information after the operating system is started, and the accuracy of program debugging is improved.

[0018] In a second aspect, the present application provides an apparatus for outputting debugging information of a microkernel operating system, which comprises various functional modules for implementing the method in the first aspect. Each functional module can be implemented by software and / or hardware.

[0019] As an example, the apparatus can comprise: a receiving module, configured to receive, by a first process in a user space of the microkernel operating system, first debugging information of each of M functional modules in the microkernel operating system, M being a positive integer, the first process being a running process of a driver module of a universal asynchronous receiver transmitter (UART);

[0020] a sending module, configured to send, by the first process, second debugging information of the each functional module to the UART, the second debugging information comprising the first debugging information of the each functional module.

[0021] In a possible implementation, the M functional modules comprise functional modules in a user application process in the user space and / or a microkernel module in the microkernel operating system.

[0022] In a possible implementation, the functional modules in the user application process comprise a user space upper layer module and / or a user space core functional module.

[0023] In a possible implementation, the sending module is specifically configured to: determine, by the first process, second debugging information according to the first debugging information, and store the second debugging information into the ring buffer; and send, by the first process, the second debugging information stored in the ring buffer to the UART.

[0024] In a possible implementation, the first process includes M+1 threads, and the M threads in the M+1 threads correspond to the M functional modules one by one.

[0025] In a possible implementation, the receiving module is specifically configured to: receive, by each thread in the M threads, first debugging information of a corresponding functional module from the corresponding functional module.

[0026] In a possible implementation, the sending module is specifically configured to: send, by a thread other than the M threads in the M+1 threads, the second debugging information stored in the ring buffer to the UART.

[0027] In a possible implementation, the microkernel module of the microkernel operating system further includes a driver module of the UART.

[0028] In a possible implementation, the sending module is specifically configured to: send, by the driver module of the UART in the microkernel module, debugging information of the microkernel module to the UART.

[0029] In a possible implementation, the second debugging information further includes an output time of the first debugging information.

[0030] Because the device in the second aspect includes various functional modules for implementing the method in the first aspect, the technical effects in the first aspect are also applicable to the device in the second aspect, which will not be repeated here.

[0031] In a third aspect, the present application provides a device for outputting debugging information of a microkernel operating system, including: at least one processor and a memory.

[0032] The memory stores computer execution instructions; and the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor can execute the method in any one of the first aspect.

[0033] The device can be an output device, an output server or an output service system, or a device that can be applied to an output device, an output server or an output service system, for example, a chip that can be applied to an output device, an output server or an output service system.

[0034] Since the device in the third aspect comprises various functional modules for implementing the method in the first aspect, the technical effects in the first aspect are also applicable to the device in the third aspect, which will not be repeated here.

[0035] In a fourth aspect, the present application provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, the method in the first aspect is implemented.

[0036] In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises a computer program, and when a processor executes the computer program, the method in the first aspect is implemented. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 An exemplary architecture diagram of a microkernel operating system provided by an embodiment of the present application is shown in FIG. 1.

[0038] Figure 2 An exemplary architecture diagram of a microkernel operating system provided by another embodiment of the present application is shown in FIG. 2.

[0039] Figure 3 A flowchart of a microkernel operating system debugging information output method provided by an embodiment of the present application is shown in FIG. 3.

[0040] Figure 4 An exemplary architecture diagram of a microkernel operating system provided by yet another embodiment of the present application is shown in FIG. 4.

[0041] Figure 5 An exemplary architecture diagram of a microkernel operating system provided by still another embodiment of the present application is shown in FIG. 5.

[0042] Figure 6 An exemplary architecture diagram of a microkernel operating system provided by yet another embodiment of the present application is shown in FIG. 6.

[0043] Figure 7 A schematic structural diagram of a microkernel operating system debugging information output device provided by an embodiment of the present application is shown in FIG. 7.

[0044] Figure 8 A structural schematic diagram of a microkernel operating system debugging information output device provided by an embodiment of the present application is shown in FIG. 8. DETAILED DESCRIPTION

[0045] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall into the scope of the present application.

[0046] Figure 1 An exemplary architecture diagram of a microkernel operating system is provided for one embodiment of the present application. As shown in Figure 1 the system can include a microkernel 10, a user space 12, and a UART hardware device 17.

[0047] The microkernel 10 is a slimmed down version of a kernel that provides core operating system functionality, providing a modular design in a small memory space, connected to other services in the user space through interfaces in the microkernel. Typically, the microkernel provides only essential services, which can include process scheduling, inter-process communication, and memory management, among others. The microkernel 10 includes a microkernel information output interface 11, which is primarily responsible for outputting information from the microkernel.

[0048] The user space 12 is the runtime space for user programs, which can include multiple user programs. A user program is typically a computer program designed to perform one or more specific tasks, and can interact with a user, having a visual user interface. The user space 12 in the present embodiment includes a user application process 13 and a UART driver module 16. The UART driver module 16 is responsible for transmitting information to the UART hardware device 17 for output. The user application process 13 includes a user space upper layer module 14 and a user space core function module 15. The user space upper layer module 14 includes logic methods for implementing user application programs, such as sequential structures, branching structures, and loop structures. The user space core function module 15 includes core software components, specifically, the user space core function module 15 provides support for the implementation of logic methods in the upper layer module 14, such as C libraries and file systems.

[0049] The universal asynchronous receiver-transmitter (UART hardware device) 17 converts data to be transmitted between serial and parallel communication. Specifically, the UART hardware device can be a standalone modular chip, or a peripheral device integrated in a microprocessor. In the present application, the UART hardware device is a serial port device, mainly used for information output.

[0050] In order to improve the performance of the microkernel operating system, the microkernel operating system needs to be debugged, and the debugging information of the microkernel operating system needs to be output during the debugging process to help the relevant technical personnel better master the state of the microkernel operating system based on the debugging information.

[0051] The debugging information can be a symbol. During the program running process, the debugging information is usually output in the form of a string. Specifically, the string can be a string of characters composed of numbers, letters and underscores. The debugging information is used to help the program designer analyze the layout of the debugging program, and the debugging information can locate the addresses of local variables and functions and display the values of the variables. In addition, the debugging information can also be used to record user operations, system failures or system security information. Usually, in the development of an operating system or a program, the output of the debugging information is mainly realized by calling a system function, and the debugging information is output through a UART hardware device. The system function can include a formatted output function (such as a Printf function and a Printk function). An application scenario suitable for the embodiments of the present application is as follows: the microkernel operating system includes a plurality of independent processes running in a user space and a microkernel running in a kernel space. During the program running process, a plurality of errors can occur, and the developer needs to locate the error position occurring during the program running process based on the debugging information output by each process or the microkernel during the running process, and then solve the errors to realize the optimization of the program.

[0052] In view of the above problems, the present application provides a method for outputting debugging information in a microkernel operating system. In the technical scheme of the present application, a user-mode service process in the microkernel operating system receives the debugging information of other processes or the microkernel in the operating system, and transmits the debugging information to a UART hardware device through a UART driver module located in the user space and managed by the service process, so as to complete the output of the debugging information.

[0053] In addition, because the UART driver module is deployed in the user space, the debugging information of the user-mode function module can also be output through the UART driver module when the microkernel has not been started completely.

[0054] Optionally, a copy of the UART driver module can also be retained in the microkernel. When the microkernel is started, the debugging information of the microkernel can be output through the UART driver module in the microkernel. If the user-space service process crashes, the debugging information of other processes in the microkernel operating system and the debugging information of the microkernel can be output to the UART hardware device through the UART driver module in the microkernel. The deployment of the UART driver module in the user space or the microkernel can enable the UART driver module in either of the user space and the microkernel to continue to provide services for the output of the debugging information when the UART driver module in the other one abnormally crashes, that is, the problem of any UART driver module does not cause the entire debugging information output system to be unable to be used, thereby improving the stability of the output of the debugging information. In addition, the backup UART driver module is located in the microkernel, which can improve the security of the debugging information.

[0055] Optionally, the debugging information can be output to the UART device through the ring buffer, so that the disorder of the debugging information can be avoided.

[0056] Figure 2 An exemplary architecture diagram of the microkernel operating system is provided for another embodiment of the present application. As shown in the figure, the microkernel operating system can include a microkernel 20, a user space 22, and a UART hardware device 28. Figure 2

[0057] The microkernel 20 is a core module of the microkernel operating system, and is mainly responsible for providing inter-process communication services. In the embodiment, the microkernel 20 includes an information output interface 21. The main function of the information output interface 21 is to output information in the microkernel.

[0058] The user space 22 is a running space of a user program. In the embodiment, the user space 22 includes a user application process 23 and a console (Console) process 26.

[0059] The user application process 23 is responsible for managing a user space upper-layer module 24 and a user space core function module 25. The Console process 26 is responsible for managing a UART driver module 27.

[0060] The user space upper-layer module 24 mainly includes logical methods for implementing user application programs, such as sequential structures, branching structures, and loop structures. The user space core function module 25 mainly includes core software parts. Specifically, the user space core function module 25 is a core software part that provides support for the implementation of logical methods in the upper-layer module 24, for example, C libraries and file systems.

[0061] ​The main function of the Console process 26 is to provide information output for the kernel. In this embodiment, the Console process 26 serves as a user-mode service process, mainly providing output functions for information from user application processes in user space, such as user space upper modules, user space core function modules, and the microkernel.

[0062] The console process 26 manages the UART driver module 27 to transmit the information to be output to the UART hardware device 28.

[0063] The console process 26 may include multiple threads, each of which is responsible for processing and transmitting received information. For example, a thread in the console process 26 may be responsible for acquiring information from the console process 26 and transmitting the acquired information to the UART driver module 27.

[0064] The function of the UART driver module 27 is to transmit the information in the user space to the output completed by the UART hardware device 28.

[0065] Figure 3 This is a flow chart of a method for outputting debugging information of a microkernel operating system provided by one embodiment of the present application. Figure 3 As shown, the method may include S301 and S302.

[0066] S301. A first process in a user space of a microkernel operating system receives first debugging information of each of M functional modules in the microkernel operating system, where M is a positive integer and the first process is a running process of a UART driver module.

[0067] As an example, the first process may be Figure 2 The Console process in the system shown.

[0068] As an example, the first debugging information of each functional module may include a description of an event occurring during the operation of each functional module and a level of the event occurring during the operation.

[0069] Optionally, the description of events occurring during the operation of each functional module may include status or data information, usually displayed in the form of a string; the level of the event may be pre-configured by the user, or may be set by each functional module based on the severity of the exception or error corresponding to the debugging information.

[0070] In this embodiment, the level of the event occurring during the operation of each functional module included in the first debugging information is used to indicate the importance or urgency of the first debugging information. For example, the level of the first debugging information can be divided into levels 1 to 7, where level 1 is the most urgent and level 7 is the least urgent.

[0071] Optionally, the M function modules can include function modules in a user space of the microkernel operating system and / or microkernel modules in the microkernel operating system.

[0072] When the M function modules include function modules in a user space of the microkernel operating system, as an example, the M function modules can include user space upper layer modules and / or user space core function modules in the user space.

[0073] Optionally, the first process can receive the first debugging information from the user space upper layer module through a Printf function.

[0074] Optionally, the first process can receive the first debugging information from the user space core function module through a Printk function. When the M function modules include microkernel modules in the microkernel operating system, as an example, a thread in the first process initiates a system call function, specifically, the thread can initiate a system call number, the operating system finds a corresponding microkernel function through the system call number, the operating system calls the function to obtain the first debugging information in the microkernel, and returns the first debugging information to the thread in the first process through an output interface in the microkernel module, so that the thread in the first process receives the first debugging information from the microkernel module.

[0075] For example, the first process includes a thread corresponding to each function module. In this case, each thread of the first process receives the first debugging information output by the corresponding function module through a corresponding inter-process communication (IPC) channel.

[0076] S302, the first process sends the second debugging information of each function module to the UART, and the second debugging information includes the first debugging information of each function module.

[0077] In the embodiment, optionally, the first process can also send the output time of each first debugging information to the UART device, that is, the second debugging information can also include the output time of the first debugging information.

[0078] When the thread in the first process receives the first debugging information, the output time of the first debugging information can be recorded, and the output time is the time when the first debugging information is output after the operating system is started. In this way, the UART device can transmit the output time information of the first debugging information, so that the debugging personnel can obtain the output time information of the debugging information, and the accuracy of program debugging is improved.

[0079] For example, thread 2 receives the first debug information from the user space core function module, the user space core function module can call the Printk function to send the first debug information, when the first debug information reaches the first process, the Printk function will add the output time of the first debug information after the operating system is started before the content of the first debug information. For example, the content of the first debug information includes "a, b, c, 7", and the second debug information can include "4.12s, a, b, c, 7", wherein 4.12s represents the 4.12s after the operating system is started, and the first debug information "a, b, c, 7" is outputted.

[0080] Optionally, before the first process outputs the second debug information, it can be judged whether the level of the first debug information is higher than or equal to the level threshold. If it is higher than or equal to the level threshold, the second debug information is outputted, otherwise it can not be outputted. In this way, resources can be allocated to more important debug information for output, ensuring the output reliability of important debug information and reducing the output delay.

[0081] For example, the levels represented by numbers 1 to 7 decrease in turn, when the level threshold is 4, the thread in the first process can judge whether the level of the first debug information is less than or equal to 4. If the level of the first debug information is 3, the thread outputs the second debug information corresponding to the first debug information; if the level of the second information is 6, the second debug information corresponding to the first debug information is not outputted.

[0082] As an example, the "Console" process starts another thread to transmit the second debug information to the UART device to output the second debug information through the UART device.

[0083] In the embodiments of the application, optionally, the first process can receive the first debug information of different function modules through different threads. For example, the first process creates a corresponding thread for each function module that needs to report the first debug information, and receives the first debug information of the function module through the thread. In this way, the output efficiency of the first debug information can be improved.

[0084] As an example, when the M function modules include function modules in the user space of the microkernel operating system, the "Console" process creates a corresponding IPC channel and a corresponding thread for each function module in the user space that needs to report the first debug information, and receives the first debug information from the function module through the IPC channel and the corresponding thread corresponding to the function module.

[0085] As an example, Figure 4 The exemplary architecture diagram of the microkernel operating system provided by another embodiment of the application is as follows: Figure 4As shown, the Console process establishes an IPC 1 channel, an IPC 2 channel, a thread 1 and a thread 2. A user space upper layer module in a user space sends first debug information of the user space upper layer module through the IPC 1 channel, the thread 1 receives the first debug information from the IPC 1 channel and sends second debug information corresponding to the first debug information to a UART device.

[0086] For example, the user space upper layer module in the user space can call a Printf function to output the first debug information through the IPC 1 channel, and the thread 1 in the Console process receives the first debug information from the IPC 1 channel. The Printf function is a formatted output function for outputting information, and the Printf function is usually used by the user space upper layer module.

[0087] Alternatively, the user space upper layer module needs to call the Printf function to output the first debug information through the IPC 1 channel based on a Portable Operating System Interface (Posix) standard. The Posix standard defines a function standard provided by a micro-kernel operating system for the user space upper layer module, and the Printf function needs to meet the requirements of the Posix standard to be called by the user space upper layer module. Generally, the Posix standard requires that the Printf function be called, and a corresponding device node needs to be registered in a file system.

[0088] In any operating system, the user space upper layer module needs to operate a hardware device by reading and writing a device node, and the device node contains the location and information of the hardware device. The upper layer module operates the hardware device by reading and writing the device node, and correspondingly, the lower layer module can receive information from the upper layer module and send the information to a driver module of the hardware device.

[0089] In this embodiment, a UART device node needs to be registered in a file system of the core function module, and the device node can be a character device file, a block device file or the like special file. The UART device node contains the location and information of the UART hardware device, and the user space upper layer module calls the Printf function based on the Posix standard to access the UART device node. The UART driver module reads the UART device node by calling a function to obtain the location and information of the UART hardware device, and the first process outputs the debug information.

[0090] As another example, a user space core function module in a user space sends first debug information of the user space core function module through an IPC 2 channel, and a thread 2 receives the first debug information from the IPC 2 channel and sends second debug information corresponding to the first debug information to a UART device.

[0091] For example, a user space core function module in the user space can call a Printk function to output the first debug information through the IPC 2 channel, and a thread 2 in the Console process receives the first debug information from the IPC 2 channel. The Printk function is a formatted output function, which is used to output information, and the Printk function is usually used in the user space core function module.

[0092] Optionally, Figure 5 An exemplary architecture diagram of a microkernel operating system provided by another embodiment of the present application is shown in FIG. 6. Figure 5 As shown in FIG. 6, after the thread in the first process receives the first debug information, the thread can first store second debug information corresponding to the first debug information in a ring buffer, and then transmit the second debug information from the ring buffer to the UART device.

[0093] The ring buffer is a circular buffer of a first-in-first-out mechanism, and transmitting the second debug information to the ring buffer can ensure that the various debug information will not be disordered. The disorder of information can be understood as interleaved storage of the contents of multiple second debug information.

[0094] For example, one second debug information contains "d, e, f, 1", and another second debug information contains "a, b, c, 3". If the information is disordered, one output second debug information can contain the following content "d, b, f, 3".

[0095] Figure 5 As shown in FIG. 6, optionally, the thread that transmits the second debug information from the ring buffer to the UART device can be different from the thread that receives the first debug information. In this way, the transmission efficiency can be improved.

[0096] Optionally, Figure 6 An exemplary architecture diagram of a microkernel operating system provided by another embodiment of the present application is shown in FIG. 6. Figure 6 As shown in FIG. 6, the microkernel can include a UART driver module.

[0097] When the microkernel in the operating system is started, the debug information in the microkernel can be transmitted to the UART driver module in the microkernel through an output interface in the microkernel, and the UART driver module inputs the debug information into a register of the UART hardware device through an interface for output.

[0098] In addition, if the Console process fails to start, as an example, the functional module in the user space can initiate a system call, specifically, the functional module in the user space can initiate a system call number, and the operating system finds a corresponding microkernel function through the system call number, the operating system calls the function to obtain the debugging information in the microkernel, and outputs the debugging information to the UART driver module in the microkernel through a debugging information output interface in the microkernel, and the UART driver module inputs the debugging information into the register of the UART hardware device through an interface for output.

[0099] As another example, the debugging information in the microkernel can directly call a function in the microkernel to output the information to the UART driver module in the microkernel through a debugging information output interface in the microkernel, and the UART driver module inputs the debugging information into the register of the UART hardware device through an interface for output.

[0100] As an example, if the debugging information in the microkernel needs to be output preferentially, that is, the microkernel needs to stop the use of the UART device by the user space, the microkernel can return a command for stopping the use of the UART device by the user space to the Console process together with the debugging information when the Console process initiates the system call, so that the microkernel has the right to output the debugging information preferentially.

[0101] Figure 7 A schematic structural diagram of an output device of debugging information of a microkernel operating system is provided for an embodiment of the present application. Referring to FIG. 7, Figure 7 The device 700 can include a receiving module 701 and a sending module 702.

[0102] The device 700 can be used to implement the method in the embodiments shown. Figure 3 For example, the receiving module 701 can be used to implement S301, and the sending module 702 can be used to implement S302.

[0103] Figure 8 A structural schematic diagram of an output device of debugging information of a microkernel operating system is provided for an embodiment of the present application. Referring to FIG. 8, Figure 8 The device 800 can include at least one processor 801 and a memory 802. The processor 801 and the memory 802 are connected to each other through a bus 803.

[0104] As an example, the processor 801 is configured to execute program instructions stored in the memory 802, so that the at least one processor 801 implements the method in the embodiments shown. Figure 3

[0105] In the above Figure 8 ​In the illustrated embodiment, it is to be understood that the processor can be a central processing unit (CPU), but can also be other general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), and so on. The general purpose processor can be a microprocessor or the processor can be any conventional processor. The steps of the methods disclosed in connection with the present application can be directly embodied in hardware processor execution, or be executed by a combination of hardware and software modules in the processor.

[0106] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory.

[0107] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, and so on. The bus can be divided into an address bus, a data bus, a control bus, and so on. For the sake of convenience, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0108] The embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, when the computer execution instructions are executed by a processor, the computer execution instructions are used for implementing the above method.

[0109] The embodiment of the present application can also provide a computer program product, comprising a computer program, when the computer program is executed by a processor, the computer program can implement the above method.

[0110] The term "module" used in the specification can be used to represent a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.

[0111] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks

[0112] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks

[0113] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks

[0114] Obviously, persons having ordinary skill in the art can be various modifications and variations for the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application belong to the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for outputting debugging information of a microkernel operating system, characterized in that: include: M threads in a first process in a user space of the microkernel operating system receive first debugging information corresponding to each functional module from a functional module corresponding to each thread in the microkernel operating system, where M is a positive integer, and the first process is a running process of a driver module of a universal asynchronous receiver / transmitter (UART); and the first process includes M+1 threads; The first process determines second debugging information according to the first debugging information, and stores the second debugging information in a ring buffer; Threads other than the M threads in the M+1 threads in the first process send second debugging information stored in the ring buffer to the UART, where the second debugging information includes the first debugging information of each functional module.

2. The method according to claim 1, characterized in that The M functional modules include: functional modules in the user application process in the user space, and / or microkernel modules in the microkernel operating system.

3. The method according to claim 2, characterized in that The functional modules in the user application process include: a user space upper layer module and / or a user space core functional module.

4. The method according to any one of claims 1 to 3, characterized in that The microkernel module of the microkernel operating system also includes a driver module of the UART; Accordingly, the method further comprises: The debugging information of the microkernel module is sent to the UART through the UART driver module in the microkernel module.

5. The method according to any one of claims 1 to 3, characterized in that The second debugging information also includes the output time of the first debugging information.

6. A device for outputting debugging information of a microkernel operating system, characterized in that: include: a receiving module, configured for receiving, by M threads in a first process in a user space of the microkernel operating system, first debugging information corresponding to each functional module from a functional module corresponding to each thread in the microkernel operating system, where M is a positive integer, and the first process is a running process of a driver module of a universal asynchronous receiver / transmitter (UART); and the first process includes M+1 threads; A sending module, configured for the first process to determine second debugging information according to the first debugging information, and store the second debugging information in a ring buffer; Threads other than the M threads in the M+1 threads in the first process send second debugging information stored in the ring buffer to the UART, where the second debugging information includes the first debugging information of each functional module.

7. A device for outputting debugging information of a microkernel operating system, characterized in that: include: at least one processor and memory; wherein the memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor can perform the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Operating system detection method and device

    CN112463545A

  • Method and apparatus for debugging internal core state programm of operation system

    CN1779652A