Embedded operating system type detection method and device, and storage medium
By using an embedded operating system type detection method on the GDB server side, which utilizes a preset symbol table and query results from the GDB client, the embedded operating system type can be automatically determined, solving the problem of quickly identifying embedded system types and improving debugging and configuration efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ESWIN COMPUTING TECH CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-05-01
AI Technical Summary
In the process of developing and debugging embedded systems, it is difficult to quickly determine the type of real-time operating system, especially when there is a lack of documentation and the source code is unavailable, which leads to additional effort consumption.
An embedded operating system type detection method is provided on the GDB server side. By using a preset symbol table to be queried and the query results of the GDB client, the type of embedded operating system is automatically determined. This includes setting up a symbol table to be queried in the GDB server and sending the identifier symbols to the GDB client for querying in a preset order.
It enables the rapid determination of the type of embedded operating system without additional effort, improving debugging and configuration efficiency and user experience.
Smart Images

Figure CN115809356B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to, but is not limited to, the field of embedded operating system technology, and particularly to an embedded operating system type detection method, apparatus, and storage medium. Background Technology
[0002] In the field of embedded systems, to meet the real-time and multi-tasking requirements of target scenarios, specific functions are typically implemented based on the kernel of a Real-Time Operating System (RTOS). Currently, the mainstream real-time operating systems in the industry include ThreadX, FreeRTOS, and eCos.
[0003] In the development, debugging, and use of embedded systems, it is often necessary to debug or configure the embedded software. This requires identifying the specific real-time operating system (RTOS) kernel used by the embedded system. However, due to various reasons (lack of documentation, unknown software source, inability to obtain source code, etc.), it is often impossible to quickly determine the ROS type. In such cases, considerable extra effort (contacting developers, manually obtaining and analyzing logs, etc.) is required to determine the ROS type. Summary of the Invention
[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0005] This disclosure provides an embedded operating system type detection method, applied to a GDB server side, including:
[0006] In response to receiving a preset detection command from a GDB client, the system sends a preset list of identifiers from a preset query symbol table to the GDB client according to a preset detection order. The GDB client then queries whether the backup program of the embedded operating system contains the identifier based on the identifier, receives the query result from the GDB client, and determines the type of the embedded operating system based on the query result. The query symbol table includes multiple operating system types and identifiers corresponding to each operating system type.
[0007] Optionally, determining the type of the embedded operating system based on the query result of the GDB client includes: when the query result of the GDB client indicates that all the identifiers corresponding to a certain type of operating system are included in the backup program of the embedded operating system, the type of the embedded operating system is determined to be the type of operating system corresponding to all the identifiers included.
[0008] Optionally, the symbol table to be queried includes N rows, where N is the total number of operating system types to be queried, and N is a natural number greater than or equal to 1, wherein the i-th row includes j i There are several identifiers to be queried, where i is between 1 and N, and j is... i ≥1.
[0009] Optionally, the symbol table to be queried includes N+1 rows, where N is the total number of operating system types to be queried, and N is a natural number greater than or equal to 1, wherein the i-th row includes j i There are one query identifier and one end identifier, where i is between 1 and N, and j... i ≥1, the (N+1)th row includes one end marker.
[0010] Optionally, the preset detection order is as follows: detect sequentially from the first row to the (N+1)th row of the symbol table to be queried, and when detecting the i-th row, detect from the first column of the i-th row to the (j)th column of the i-th row. i +1) Columns are checked sequentially.
[0011] Optionally, determining the type of the embedded operating system based on the query results of the GDB client includes:
[0012] When the currently detected symbol is the end marker symbol in the N+1th row, it is determined that the type of the embedded operating system has not been found;
[0013] When the currently detected symbol is the end marker symbol in the i-th row, the type of the embedded operating system is determined to be the operating system type corresponding to all the marker symbols in the i-th row.
[0014] Optionally, when a preset detection command is received from the GDB client, the detection method further includes:
[0015] Check if the operating system type detection switch is enabled;
[0016] When the operating system type detection switch is activated, the step of sending the identifiers in the preset symbol table to be queried to the GDB client according to the preset detection order is triggered.
[0017] When the operating system type detection switch is turned off, a preset response command is output to the GDB client.
[0018] Optionally, the detection method is used during the startup process of remote debugging of the GDB client, and the preset detection command is the qSymbol:: command.
[0019] This disclosure also provides an embedded operating system type detection device, including a memory; and a processor connected to the memory, the memory being used to store instructions, and the processor being configured to execute the steps of the embedded operating system type detection method according to any embodiment of this disclosure based on the instructions stored in the memory.
[0020] This disclosure also provides a storage medium storing a computer program that, when executed by a processor, implements the embedded operating system type detection method described in any embodiment of this disclosure.
[0021] After reading and understanding the accompanying diagrams and detailed descriptions, other aspects can be understood. Attached Figure Description
[0022] The accompanying drawings are provided to further illustrate the technical solutions of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure. The shapes and sizes of the components in the drawings do not reflect actual proportions and are only intended to illustrate the content of this disclosure.
[0023] Figure 1A A schematic diagram of the structure of a detection system provided for an exemplary embodiment of this disclosure;
[0024] Figure 1B A flowchart illustrating an embedded operating system type detection method provided as an exemplary embodiment of this disclosure;
[0025] Figure 2 A flowchart illustrating another embedded operating system type detection method provided as an exemplary embodiment of this disclosure;
[0026] Figure 3 This is a schematic diagram of an embedded operating system type detection device provided as an exemplary embodiment of the present disclosure. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be arbitrarily combined with each other.
[0028] Unless otherwise defined, the technical or scientific terms used in the embodiments of this disclosure shall have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in the embodiments of this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" indicate that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, but do not exclude other elements or objects.
[0029] For debugging embedded software, GDB (GNU Project Debugger) is the most mature and widely used debugging tool. GDB consists of a client and a server. The GDB client runs on the host machine and communicates with the GDB server running on a remote machine to achieve remote debugging.
[0030] This disclosure provides an embedded operating system type detection method, which is implemented based on a detection system, such as... Figure 1A As shown, the detection system includes a host computer and target hardware. The host computer runs a GDB client, and the target hardware runs a target program, which includes an embedded operating system and other applications. In addition, a GDB server runs on the target hardware. The GDB server and the GDB client communicate with each other via a network. It should be noted that in this embodiment, the GDB server is a software program that runs on the target hardware and implements server functions. A backup program for the embedded operating system is located on the host computer. Figure 1B As shown, the detection method includes the following steps:
[0031] Step 101: In response to receiving the preset detection command sent by the GDB client, send the identifiers in the preset symbol table to be queried to the GDB client according to the preset detection order, so that the GDB client can query whether the backup program of the embedded operating system contains the identifiers. The symbol table to be queried includes multiple operating system types and the identifiers corresponding to each operating system type.
[0032] Step 102: Receive the query results from the GDB client and determine the type of embedded operating system based on the query results from the GDB client.
[0033] The embedded operating system type detection method of this disclosure responds to a preset detection command sent by a GDB client, sends the identifiers in a preset query symbol table to the GDB client according to a preset detection order, receives the query results from the GDB client, and determines the type of the embedded operating system based on the query results. It can utilize the existing interface and process between the GDB client and the GDB server to automatically obtain the type of the embedded operating system for further debugging and configuration. The user does not need to spend any extra effort to obtain the type of the operating system, thus improving the user experience.
[0034] The GDB debugging environment of an embedded operating system consists of two parts: the host machine and the target hardware (i.e., the target machine, such as a development board). The GDB client is installed and runs on the host machine, and the GDB server is installed and runs on the target hardware. The GDB server copies the generated binary executable file to the target hardware after successful compilation on the host machine.
[0035] In this embodiment, the host computer stores a backup program of the target program. The GDB client queries the host computer to see if the identifier symbol is included in the backup program of the target program, and sends the query result to the GDB server. This allows the GDB server to determine the type of embedded operating system it is running based on the query result. Specifically, the backup program of the target program can be an Executable and Linkable Format (ELF) file. The ELF file contains the backup program of the embedded operating system. The GDB client can determine whether the identifier symbol is included in the backup program of the target program by detecting whether it is included in the backup program of the embedded operating system.
[0036] In some exemplary embodiments, the detection method further includes, prior to:
[0037] The symbol table to be queried is pre-configured within the GDB server.
[0038] In some exemplary embodiments, in step 101, the symbol table to be queried includes N rows, where N is the total number of operating system types to be queried, and N is a natural number greater than or equal to 1. The i-th row includes j... i There are several identifiers to be queried, where i is between 1 and N, and j is... i ≥1.
[0039] In some other exemplary embodiments, in step 101, the symbol table to be queried may include N+1 rows, where N is the total number of operating system types to be queried, and N is a natural number greater than or equal to 1. The i-th row includes j...i There are one query identifier and one end identifier, where i is between 1 and N, and j... i ≥1, the (N+1)th row includes one end marker.
[0040] The detection method of this disclosure is equivalent to adding an automatic table lookup function to the GDB server. First, a table containing a two-dimensional string array, as shown in Table 1, is added to the GDB server (exemplarily, in Table 1, N=4, j1=3, j2=4, j3=2, j4=3). Each element RTOS_N_Symbol_n in the table can be a string representing the nth symbol of the Nth RTOS type. The iconic symbol names corresponding to multiple mainstream RTOS types that need to be queried can be preset into the table; for example, RTOS_1 can be ThreadX, RTOS_2 can be FreeRTOS, RTOS_3 can be eCos, and so on. Each row corresponds to one RTOS type, and each row can contain one or more symbols, ending with NULL (0) as the terminator. Taking Table 1 as an example, four RTOS types can be detected.
[0041]
[0042] Table 1
[0043] Taking FreeRTOS as an example, "uxCurrentNumberOfTasks" can be used as one of the identifiers. It should be noted that those skilled in the art can set different operating system types to be queried and corresponding identifiers for each operating system type as needed. This disclosure does not limit the type and number of operating systems to be queried, nor the name and number of identifiers corresponding to each operating system type. Furthermore, Table 1 only shows an exemplary structure of a query symbol table; those skilled in the art can set different structures of query symbol tables as needed, and this disclosure does not limit this as well.
[0044] In some exemplary embodiments, step 102, determining the type of embedded operating system based on the query results of the GDB client, includes:
[0045] When the query result from the GDB client shows that all the identifiers corresponding to a certain operating system type are included in the backup program of the embedded operating system, the type of the embedded operating system is determined to be the operating system type corresponding to all the included identifiers.
[0046] For example, still using Table 1, when the GDB client's query result shows that RTOS_1_Symbol_1 to RTOS_1_Symbol_3 are all included in the embedded operating system backup program, the GDB server determines that the embedded operating system type is RTOS_1. When the GDB client's query result shows that any one or more of the identifiers from RTOS_1_Symbol_1 to RTOS_1_Symbol_3 are not included in the embedded operating system backup program, the GDB server determines that the embedded operating system type is not RTOS_1 and continues to check the identifiers in the next row.
[0047] In some exemplary embodiments, in step 102, the preset detection order is: to detect sequentially from the first row to the (N+1)th row of the symbol table to be queried, and when detecting the i-th row, to detect from the first column of the i-th row to the (j)th column of the i-th row. i +1) Columns are detected sequentially. However, this embodiment of the disclosure is not limited to this, and users may use any other detection order for detection.
[0048] In some exemplary embodiments, the marked symbols in a preset symbol table to be queried are sent to the GDB client according to a preset detection order, including:
[0049] Select a marker symbol from a row in the symbol table to be queried and send it to the GDB client so that the GDB client can query whether the backup program of the embedded operating system contains the currently sent marker symbol.
[0050] When the query result from the GDB client indicates that the currently sent identifier is not in the backup program of the embedded operating system, another identifier from the identifier table that is not in the same row as the currently sent identifier is selected and sent to the GDB client.
[0051] When the query result from the GDB client indicates that the currently sent identifier is in the backup program of the embedded operating system, another identifier from the same row as the currently sent identifier is selected from the identifier table and sent to the GDB client.
[0052] In some exemplary implementations, determining the type of embedded operating system based on the query results from the GDB client includes:
[0053] When the current symbol to be detected is the end marker symbol of the N+1th line, it is determined that no embedded operating system type was found;
[0054] When the symbol to be detected is the end marker symbol of the i-th row, the type of the embedded operating system is determined to be the operating system type corresponding to all the marker symbols in the i-th row, where i is between 1 and N.
[0055] In some exemplary embodiments, the identifiers in a preset symbol table to be queried are sent to the GDB client according to a preset detection order, and the query results from the GDB client are received. The type of the embedded operating system is determined based on the query results from the GDB client, including:
[0056] Initialize the first symbol in the first row of the symbol table to be queried to the symbol to be queried (that is, set the row number m of the symbol to be queried to 1, and the column number n of the symbol to be queried to 1);
[0057] Determine if the currently queried symbol is an end marker. If the currently queried symbol is an end marker, determine if the row containing the currently queried symbol is row (N+1). If the row containing the currently queried symbol is row (N+1), it is determined that no embedded operating system type was found; if the row containing the currently queried symbol is not row (N+1), it is determined that the embedded operating system type is the operating system type corresponding to the currently queried symbol.
[0058] When the symbol to be queried is not the end marker symbol, the symbol to be queried is sent to the GDB client so that the GDB client can query whether the backup program of the embedded operating system contains the symbol to be queried.
[0059] The system receives the query results from the GDB client. If the query result indicates that the symbol to be queried is not in the backup program of the embedded operating system, it determines that the type of the embedded operating system is not the type of the operating system corresponding to the symbol to be queried. It then retrieves the first symbol in the next row after the symbol to be queried and updates the retrieved symbol with the symbol to be queried. Finally, it returns to execute the step of determining whether the symbol to be queried is an end marker symbol. If the query result indicates that the symbol to be queried is in the backup program of the embedded operating system, it retrieves the next symbol in the row of the symbol to be queried and updates the retrieved symbol with the symbol to be queried. Finally, it returns to execute the step of determining whether the symbol to be queried is an end marker symbol.
[0060] Since the present invention has designed a query symbol table as shown in Table 1, wherein the N+1th row includes only one column, which is an end marker symbol, and any other row includes at least one marker symbol and an end marker symbol, when the symbol to be queried is an end marker symbol, it is determined whether the row of the symbol to be queried is the (N+1)th row, or it can be replaced by determining whether the column of the symbol to be queried is the first column.
[0061] In some exemplary implementations, such as Figure 2As shown, the system sends the identifiers from the preset symbol table to the GDB client according to the preset detection order, and receives the query results from the GDB client. Based on the query results from the GDB client, it determines the type of the embedded operating system, including:
[0062] Initialize the first symbol in the first row of the symbol table to be queried to the symbol to be queried (that is, set the row number m of the symbol to be queried to 1, and the column number n of the symbol to be queried to 1);
[0063] Determine if the currently queried symbol is an end marker. If the currently queried symbol is an end marker, determine if the column containing the currently queried symbol is the first column. If the column containing the currently queried symbol is the first column, it is determined that no embedded operating system type was found; if the column containing the currently queried symbol is not the first column, it is determined that the embedded operating system type is the type of the operating system corresponding to the currently queried symbol.
[0064] When the symbol to be queried is not the end marker symbol, the symbol to be queried is sent to the GDB client so that the GDB client can query whether the backup program of the embedded operating system contains the symbol to be queried.
[0065] The system receives the query results from the GDB client. If the query result indicates that the symbol to be queried is not in the backup program of the embedded operating system, it determines that the type of the embedded operating system is not the type of the operating system corresponding to the symbol to be queried. It then retrieves the first symbol in the next row after the symbol to be queried and updates the retrieved symbol with the symbol to be queried. Finally, it returns to execute the step of determining whether the symbol to be queried is an end marker symbol. If the query result indicates that the symbol to be queried is in the backup program of the embedded operating system, it retrieves the next symbol in the row of the symbol to be queried and updates the retrieved symbol with the symbol to be queried. Finally, it returns to execute the step of determining whether the symbol to be queried is an end marker symbol.
[0066] In some exemplary embodiments, in step 102, the preset detection command can be the qSymbol:: command.
[0067] The detection method of this embodiment modifies the processing flow of the GDB server for the "qSymbol::" instruction, and sends the symbol name string in the symbol table to be queried to the GDB client for querying in sequence, so as to determine whether the backup program of the embedded operating system contains the symbol.
[0068] The detection method of this disclosure embodiment can set an operating system type detection switch on the GDB server to control whether to enable the automatic detection function of this disclosure embodiment.
[0069] In some exemplary embodiments, in step 102, when a preset detection command is received from the GDB client, the detection method further includes:
[0070] Check if the operating system type detection switch is enabled;
[0071] When the operating system type detection switch is activated, the step of sending the marked symbols in the preset symbol table to be queried to the GDB client is triggered according to the preset detection order;
[0072] When the operating system type detection switch is off, a preset response command is output to the GDB client.
[0073] In some exemplary implementations, the preset response instruction can be a normal status (e.g., "OK").
[0074] In some exemplary implementations, this detection method can be used during the startup process of remote debugging in a GDB client.
[0075] During the remote debugging startup process, the GDB client sends a message packet with the content "qSymbol::" to inquire with the GDB Server whether a symbol lookup is required. At this point, the GDB Server's processing flow for "qSymbol::" is modified so that it sends the symbol name strings from the table above to the GDB client in sequence for querying, determining whether the embedded operating system's backup program contains the symbol.
[0076] In other exemplary embodiments, this detection method can also be used during the debugging process of the GDB client against the GDB server.
[0077] The embedded operating system type detection method of this disclosure utilizes the existing interface and startup process between the GDB client and GDB server to automatically obtain the type of the embedded operating system. This disclosure primarily uses a "table lookup" method, polling the signature symbols of various mainstream RTOSs. If the corresponding symbol is found in the embedded operating system's backup program, the acquisition is considered successful, and the query result is output. Furthermore, an operating system type detection switch can be added to flexibly control whether this detection function is enabled.
[0078] This disclosure also provides an embedded operating system type detection device, including a memory; and a processor connected to the memory, the memory being used to store instructions, the processor being configured to execute the steps of the embedded operating system type detection method as described in any embodiment of this disclosure based on the instructions stored in the memory.
[0079] like Figure 3 As shown, in one example, the embedded operating system type detection device may include: a processor 310, a memory 320, a bus system 330, and a transceiver 340. The processor 310, memory 320, and transceiver 340 are connected via the bus system 330. The memory 320 is used to store instructions and also stores a symbol table to be queried. The symbol table to be queried includes multiple operating system types and a corresponding identifier symbol for each operating system type. The processor 310 is used to execute the instructions stored in the memory 320 to control the transceiver 340 to send and receive signals. Specifically, transceiver 340 can receive a preset detection command sent by GDB client under the control of processor 310. Processor 310 sends the identifiers in the preset query symbol table to GDB client according to the preset detection order, so that GDB client can query whether the backup program of the embedded operating system contains the identifier based on the identifier, and receive the query result of GDB client, determine the type of embedded operating system based on the query result of GDB client, and output the determined type of embedded operating system to GDB client through transceiver 340.
[0080] It should be understood that processor 310 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0081] Memory 320 may include read-only memory and random access memory, and provides instructions and data to processor 310. A portion of memory 320 may also include non-volatile random access memory. For example, memory 320 may also store device type information.
[0082] In addition to a data bus, the bus system 330 may also include a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 3 The general labeled all buses as Bus System 330.
[0083] In implementation, the processing performed by the processing device can be accomplished through integrated logic circuits in the hardware of the processor 310 or through software instructions. That is, the method steps of this embodiment can be executed by a hardware processor, or by a combination of hardware and software modules within the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other storage media. This storage medium is located in memory 320, and the processor 310 reads information from memory 320 and, in conjunction with its hardware, completes the steps of the aforementioned method. To avoid repetition, further details are omitted here.
[0084] This disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the embedded operating system type detection method as described in any embodiment of this disclosure. The method of driving embedded operating system type detection by executing executable instructions is essentially the same as the embedded operating system type detection method provided in the above embodiments of this disclosure, and will not be described in detail here.
[0085] In some possible implementations, various aspects of the embedded operating system type detection method provided in this application can also be implemented as a program product, which includes program code. When the program product is run on a computer device, the program code is used to cause the computer device to perform the steps in the embedded operating system type detection method according to various exemplary embodiments of this application described above. For example, the computer device can execute the embedded operating system type detection method described in the embodiments of this application.
[0086] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0087] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0088] While the embodiments disclosed herein are as described above, the content is merely for the purpose of facilitating understanding of this disclosure and is not intended to limit the invention. Any person skilled in the art may make any modifications and changes to the form and details of the implementation without departing from the spirit and scope of this disclosure; however, the scope of patent protection for this invention shall still be determined by the scope defined in the appended claims.
Claims
1. A method for detecting the type of an embedded operating system, characterized in that, Applied to the GDB server side, the GDB server has a pre-set symbol table to be queried, the GDB server runs on target hardware, and the target hardware runs an embedded operating system. The detection method includes: In response to receiving a preset detection command from the GDB client, the system sends a preset list of identifiers from a pre-defined symbol table to the GDB client according to a preset detection order. The GDB client then queries whether the embedded operating system's backup program contains the identifier, receives the query result from the GDB client, and determines the type of the embedded operating system based on the query result. The GDB client runs on the host machine, which includes the backup program for the embedded operating system. The symbol table includes N+1 rows, where N is the total number of operating system types to be queried, and N is a natural number greater than or equal to 1. The i-th row includes... There are one query identifier and one end identifier, where i is between 1 and N. ≥1, the (N+1)th row includes one end marker.
2. The detection method according to claim 1, characterized in that, Determining the type of the embedded operating system based on the query results of the GDB client includes: When the query result of the GDB client shows that all the iconic symbols corresponding to a certain operating system type are included in the backup program of the embedded operating system, the type of the embedded operating system is determined to be the operating system type corresponding to all the iconic symbols included.
3. The detection method according to claim 1, characterized in that, The preset detection order is as follows: detect sequentially from the first row to the (N+1)th row of the symbol table to be queried, and when detecting the i-th row, detect from the first column of the i-th row to the (N+1)th column of the i-th row. The columns are checked sequentially.
4. The detection method according to claim 3, characterized in that, Determining the type of the embedded operating system based on the query results from the GDB client includes: When the currently detected symbol is the end marker symbol in the N+1th row, it is determined that the type of the embedded operating system has not been found; When the currently detected symbol is the end marker symbol in the i-th row, the type of the embedded operating system is determined to be the operating system type corresponding to all the marker symbols in the i-th row.
5. The detection method according to claim 1, characterized in that, When a preset detection command is received from the GDB client, the detection method further includes: Check if the operating system type detection switch is enabled; When the operating system type detection switch is activated, the step of sending the identifiers in the preset symbol table to be queried to the GDB client according to the preset detection order is triggered. When the operating system type detection switch is turned off, a preset response command is output to the GDB client.
6. The detection method according to claim 1, characterized in that, The detection method is used during the startup process of remote debugging of the GDB client, and the preset detection command is the qSymbol:: command.
7. An embedded operating system type detection device, characterized in that, The method includes a memory; and a processor connected to the memory, the memory being used to store instructions, the processor being configured to perform the steps of the embedded operating system type detection method as described in any one of claims 1 to 6 based on the instructions stored in the memory.
8. A storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the embedded operating system type detection method as described in any one of claims 1 to 6.