A hardware information access system

The driver's access request is hijacked through the hardware simulation program and provided simulated hardware information, solving the problem that the driver cannot obtain hardware information when physical hardware devices are lacking, ensuring the stability and verification efficiency of the driver.

CN119248660BActive Publication Date: 2025-05-30MU XI LING ZHI KE JI (HANG ZHOU) YOU XIAN GONG SI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411757065.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-05-30
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In the early days of developing GPU chips, the lack of physical hardware devices caused the driver to fail to obtain hardware information, and abnormal situations occurred, which in turn affected the efficiency of driver verification.

Method used

Design a hardware information access system to hijack driver access requests through hardware simulation programs, provide simulated hardware information, and avoid abnormal situations caused by the lack of physical hardware.

Benefits of technology

Ensure that the driver runs stably, avoid exceptions, and improve the efficiency of driver verification after obtaining the physical hardware device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248660B_ABST
    Figure CN119248660B_ABST
Patent Text Reader

Abstract

This application relates to the field of program verification, and particularly to a hardware information access system. The system includes: a client and its corresponding driver, a display management component, and a hardware simulation program. When the driver sends an access request to the display management component to obtain target hardware information, a preset hijacking method is used to hijack the access request to the hardware simulation program. When the access request meets the preset conditions, the hardware simulation program returns the simulated hardware information corresponding to the target hardware information to the client, avoiding the situation where the display management component cannot obtain the target hardware information due to the absence of an entity hardware device in the system, thereby causing an exception in the driver, ensuring the stability of the driver operation. Moreover, using the hardware simulation program does not require modifying the driver. After obtaining the entity hardware device, the driver can directly be used to obtain the hardware information of the entity hardware device, improving the efficiency of driver verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of program verification, and in particular, to a hardware information access system. Background Art

[0002] In the early stage of developing a GPU chip, there is often no physical GPU chip hardware device. In this case, if in the chip verification scenario, the driver program of the client directly interacts with the display management component to obtain hardware information, it will be unable to obtain the hardware information due to the absence of a real hardware device, resulting in abnormal situations such as the driver program getting stuck, and further leading to the inability to smoothly verify whether the written driver program meets the expected results.

[0003] In response to the above problems, existing means usually modify the driver program or the application program corresponding to the driver program when the driver program encounters an abnormal situation to ensure that the driver program can run and be verified normally. However, this means modifies the driver program, and although it ensures the stability of the driver program's operation, after obtaining the physical hardware device, additional manpower is required to modify the driver program again, resulting in poor efficiency of driver program verification.

[0004] Therefore, how to improve the efficiency of driver program verification while ensuring the stability of the driver program's operation has become an urgent problem to be solved. Summary of the Invention

[0005] In response to the above technical problems, the technical solution adopted by the present invention is as follows:

[0006] A hardware information access system, the system includes: a client and its corresponding driver program, a display management component, a hardware simulation program, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented:

[0007] S101, when the driver program sends an access request to the display management component to obtain target hardware information, hijack the access request to the hardware simulation program by using a preset hijacking means;

[0008] S102, when the access request meets a preset condition, return the simulated hardware information corresponding to the target hardware information from the hardware simulation program to the client;

[0009] S103, when the access request does not meet the preset condition, send the access request from the hardware simulation program to the display management component;

[0010] S104, return the target hardware information from the display management component to the hardware simulation program;

[0011] S105. The hardware simulation program returns the target hardware information to the client.

[0012] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, a hardware information access system provided by the present invention can achieve quite remarkable technological progressiveness and practicality, and has wide utilization value in the industry. It has at least the following beneficial effects:

[0013] The present invention provides a hardware information access system, which includes: a client and its corresponding driver, a display management component, a hardware simulation program, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: S101. When the driver sends an access request to the display management component to obtain target hardware information, the access request is hijacked to the hardware simulation program by using a preset hijacking means; S102. When the access request meets the preset conditions, the hardware simulation program returns the simulated hardware information corresponding to the target hardware information to the client; S103. When the access request does not meet the preset conditions, the hardware simulation program sends the access request to the display management component; S104. The display management component returns the target hardware information to the hardware simulation program; S105. The hardware simulation program returns the target hardware information to the client.

[0014] It can be seen that a hardware simulation program is additionally constructed. When the driver sends an access request to the display management component to obtain target hardware information, the access request is hijacked to the hardware simulation program, and the hardware simulation program returns the simulated hardware information corresponding to the target hardware information to the client, avoiding the situation that the display management component cannot obtain the target hardware information due to the absence of an entity hardware device in the system, thus preventing the driver from malfunctioning, ensuring the stability of the driver operation. Moreover, using the hardware simulation program does not require changing the driver. After obtaining the entity hardware device, the driver can directly be used to obtain the hardware information of the entity hardware device, improving the efficiency of driver verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0016] Figure 1 It is a schematic flowchart of the computer program executed by the processor in a hardware information access system provided by an embodiment of the present invention. Detailed implementation manners

[0017] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the protection scope of the present invention.

[0018] This embodiment provides a hardware information access system, and the system includes: a client and its corresponding driver, a display management component, a hardware simulation program, a processor, and a memory storing a computer program. Refer to Figure 1 , which is a schematic flowchart of a computer program executed by a processor in a hardware information access system provided by an embodiment of the present invention. When the computer program is executed by the processor, the following steps are implemented:

[0019] S101, when the driver sends an access request to the display management component to obtain target hardware information, hijack the access request to the hardware simulation program by using a preset hijacking means;

[0020] S102, when the access request meets a preset condition, the hardware simulation program returns the simulated hardware information corresponding to the target hardware information to the client;

[0021] S103, when the access request does not meet a preset condition, the hardware simulation program sends the access request to the display management component;

[0022] S104, the display management component returns the target hardware information to the hardware simulation program;

[0023] S105, the hardware simulation program returns the target hardware information to the client.

[0024] Among them, the hardware information access system may include at least one client, and the processing processes of the drivers corresponding to the respective clients are the same. In this embodiment, a single client is taken as an example for description.

[0025] In this embodiment, the display management component may refer to the X Server component in the Linux system, which can be used to manage graphic display, mainly responsible for processing graphic output and receiving events from input devices, and passing these events to corresponding application programs, etc.

[0026] The hardware simulation program may include several pieces of simulated hardware information. Both the simulated hardware information and the target hardware information may refer to the hardware information corresponding to the physical hardware device of the GPU chip, while the target hardware information may refer to the hardware information required by the access request, and the simulated hardware information may refer to the hardware information included in the hardware simulation program.

[0027] Specifically, the driver program may send multiple access requests to the display management component to obtain the target hardware information corresponding to each access request. Similarly, the processing flow corresponding to each access request is the same. In this embodiment, a single access request is taken as an example for description.

[0028] When the access request does not meet the preset condition, it indicates that the target hardware information corresponding to the access request at this time may not be the hardware information that needs to be focused on, or the target hardware information can be obtained from the display management component. At this time, the hardware simulation program accesses the display management component to obtain the target hardware information, and then returns the target hardware information to the client.

[0029] In a specific implementation manner, the preset condition is that the target hardware information has corresponding simulated hardware information in the hardware simulation program.

[0030] Among them, since only some hardware information may need to be focused on during the driver program verification process, when writing the hardware simulation program, only the simulated hardware information corresponding to the part of the hardware information that needs to be focused on may be included. When the target hardware information required by the access request is consistent with the simulated hardware information, the hardware simulation program directly returns the simulated hardware information corresponding to the target hardware information to the client, without the driver program accessing the display management component, thereby avoiding the situation that the display management component cannot obtain the target hardware information due to the absence of a physical hardware device, and further avoiding abnormal situations of the driver program, ensuring the stability of the driver program operation.

[0031] In a specific implementation manner, the system further includes a GPU kernel, and step S104 further includes the following steps:

[0032] S1041, when the display management component includes the target hardware information, the display management component returns the target hardware information to the hardware simulation program;

[0033] S1042, when the display management component does not include the target hardware information, the display management component accesses the GPU kernel to obtain the target hardware information, and returns the target hardware information to the hardware simulation program.

[0034] Among them, the GPU kernel also contains some hardware information. When the display management component does not contain the target hardware information, the display management component accesses the GPU kernel to obtain the target hardware information.

[0035] In a specific implementation manner, when the computer program is executed by a processor, the following steps are further implemented:

[0036] S201, when an abnormal situation occurs when the display management component returns the target hardware information to the hardware simulation program, update the target hardware information as simulated hardware information to the hardware simulation program.

[0037] Among them, in the complex scenario of driver verification, there may be hardware information that needs to be focused on and does not exist as simulated hardware information in the hardware simulation program. In such cases, an abnormal situation will occur when the display management component returns the target hardware information to the hardware simulation program. According to the abnormal situation, update the target hardware information as simulated hardware information to the hardware simulation program. In this embodiment, when an abnormal situation occurs, the update object is the hardware simulation program, while in the prior art, when an abnormal situation occurs, the update object is the driver. It can be seen that this embodiment does not need to modify the driver, improving the convenience of applying the driver to the physical hardware device, that is, improving the efficiency of driver verification.

[0038] In a specific implementation manner, the display management component includes a number of reference hardware information;

[0039] The hardware simulation program includes simulated hardware information corresponding to all the reference hardware information respectively.

[0040] Among them, the reference hardware information may refer to the hardware information that the display management component can obtain. The hardware simulation program includes simulated hardware information corresponding to all the reference hardware information respectively, which can indicate that the simulated hardware information included in the hardware simulation program has covered all the reference hardware information and also includes hardware information that the display management component cannot obtain. On this basis, the access request only acts on the hardware simulation program. This embodiment further ensures the stability of the driver operation and avoids the situation of abnormal access to the target hardware information.

[0041] In a specific implementation manner, when the system further includes a GPU chip, the display management component includes a number of reference hardware information corresponding to the GPU chip;

[0042] When the computer program is executed by a processor, the following steps are implemented:

[0043] S301. When the driver sends an access request to the display management component to obtain target hardware information, the display management component returns the reference hardware information corresponding to the target hardware information to the client.

[0044] Among them, when the system further includes a GPU chip, it means that the physical hardware device containing the GPU chip is included in the system at this time. In such a case, there is no need to use a hardware simulation program. When the driver sends an access request to the display management component to obtain target hardware information, the display management component directly returns the reference hardware information corresponding to the target hardware information to the client. It can be seen that in this embodiment, after obtaining the physical hardware device of the GPU chip, only the use of the hardware simulation program needs to be turned off, and then the driver can be directly used to access the display management component to obtain the reference hardware information of the physical hardware device without modifying the driver, which improves the convenience of the driver applied to the physical hardware device, that is, improves the efficiency of driver verification.

[0045] In a specific implementation manner, the hijacking means at least includes: function pointer tampering, code injection.

[0046] Among them, the hijacking means may further include DLL hijacking, buffer overflow hijacking, etc. The implementer can select a suitable hijacking means according to the actual situation.

[0047] It can be known that in this embodiment, a hardware simulation program is additionally constructed. When the driver sends an access request to the display management component to obtain target hardware information, the access request is hijacked to the hardware simulation program, and the hardware simulation program returns the simulated hardware information corresponding to the target hardware information to the client, avoiding the situation that the display management component cannot obtain the target hardware information due to the absence of a physical hardware device in the system, resulting in an exception of the driver, ensuring the stability of the driver operation. Moreover, using the hardware simulation program does not require modifying the driver. After obtaining the physical hardware device, the driver can be directly used to obtain the hardware information of the physical hardware device, improving the efficiency of driver verification.

[0048] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for illustration purposes and not for limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A hardware information access system, characterized in that: The system includes: a client and its corresponding driver, a display management component, a hardware simulation program, a GPU core, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: S101, when the driver sends an access request to the display management component to obtain target hardware information, a preset hijacking method is used to hijack the access request to the hardware simulation program; S102, when the access request meets a preset condition, the hardware simulation program returns the simulated hardware information corresponding to the target hardware information to the client; S103, when the access request does not meet the preset condition, the hardware simulation program sends the access request to the display management component; S104, the display management component returns the target hardware information to the hardware simulation program, wherein step S104 further includes the following steps: S1041, when the display management component includes the target hardware information, the display management component returns the target hardware information to the hardware simulation program; S1042, when the display management component does not include the target hardware information, the display management component accesses the GPU kernel to obtain the target hardware information, and returns the target hardware information to the hardware simulation program; S105: The hardware simulation program returns the target hardware information to the client.

2. The hardware information access system according to claim 1, characterized in that: The preset condition is that the target hardware information has corresponding simulated hardware information in the hardware simulation program.

3. The hardware information access system according to claim 1, characterized in that: When the computer program is executed by a processor, the following steps are also implemented: S201, when an abnormal situation occurs when the display management component returns the target hardware information to the hardware simulation program, the target hardware information is updated to the hardware simulation program as simulated hardware information.

4. The hardware information access system according to claim 1, characterized in that: The display management component includes a number of reference hardware information; The hardware simulation program includes simulation hardware information corresponding to all reference hardware information.

5. The hardware information access system according to claim 1, characterized in that: When the system further includes a GPU chip, the display management component includes a plurality of reference hardware information corresponding to the GPU chip; When the computer program is executed by a processor, the following steps are implemented: S301, when the driver sends an access request to the display management component to obtain target hardware information, the display management component returns reference hardware information corresponding to the target hardware information to the client.

6. The hardware information access system according to claim 1, characterized in that: The hijacking means at least include: function pointer tampering and code injection.

Citation Information

Patent Citations

  • Partial virtualization on computing device

    US20070288228A1