Hardware information access system

Accessing hardware simulation programs in the system through hardware information access to hijack access requests and returning simulated hardware information, solving the problem that early drivers of GPU chips cannot obtain hardware information, ensuring the stability and verification efficiency of the driver.

CN119248660AActive Publication Date: 2025-01-03MU XI LING ZHI KE JI (HANG ZHOU) YOU XIAN GONG SI
View PDF 10 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the early days of developing GPU chips, the client's driver was unable to obtain hardware information, which caused abnormal situations. The existing solution required modification of the driver to ensure stability, but additional modifications were still required after obtaining the physical hardware to improve verification efficiency, resulting in verification efficiency Poor.

Method used

Design a hardware information access system to hijack access requests through hardware simulation programs, return simulated hardware information, avoid exceptions, and do not need to modify the driver after obtaining physical hardware to improve verification efficiency.

Benefits of technology

Ensure the stability of the driver's operation and directly use the driver to obtain hardware information after obtaining the physical hardware, which improves the efficiency of driver verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248660A_ABST
    Figure CN119248660A_ABST
Patent Text Reader

Abstract

The invention relates to the field of program verification, in particular to a hardware information access system, which comprises a client, a driving program corresponding to the client, a display management component and a hardware simulation program. And hijacking the access request to a hardware simulation program by adopting a preset hijacking means, and when the access request meets a preset condition, returning simulation hardware information corresponding to the target hardware information to the client by the hardware simulation program, the situation that the display management component cannot obtain the target hardware information due to the fact that no entity hardware equipment exists in the system, and consequently the driving program is abnormal is avoided, the running stability of the driving program is guaranteed, in addition, the driving program does not need to be changed when the hardware simulation program is used, and the driving program is more stable. And after the entity hardware equipment is obtained, the hardware information of the entity hardware equipment can be obtained by directly using the driving program, so that the verification efficiency of the driving program is improved.
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 stages of GPU chip development, there are often no physical GPU chip hardware devices. In this case, if the client driver directly interacts with the display management component to obtain hardware information in the chip verification scenario, the hardware information cannot be obtained due to the lack of real hardware devices, resulting in abnormal situations such as driver jamming, which in turn makes it impossible to successfully verify whether the written driver meets the expected results.

[0003] To address the above issues, existing methods usually modify the driver or the application corresponding to the driver when an abnormal situation occurs in the driver to ensure that the driver can run and verify normally. However, this method modifies the driver. Although the stability of the driver operation is guaranteed, after obtaining the physical hardware device, additional manpower is required to modify the driver again, resulting in poor efficiency of driver verification.

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

[0005] In view of the above technical problems, the technical solution adopted by the present invention is: A hardware information access system, the system comprising: 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, 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; S105: The hardware simulation program returns the target hardware information to the client.

[0006] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, the hardware information access system provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects: 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, 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; S105, the hardware simulation program returns the target hardware information to the client.

[0007] It can be seen that an additional hardware simulation program is constructed. When the driver sends an access request to the display management component to obtain the 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, thereby avoiding the situation where the display management component cannot obtain the target hardware information due to the absence of physical hardware devices in the system, thereby causing the driver to be abnormal, thereby ensuring the stability of the driver operation. Moreover, the use of the hardware simulation program does not require changes to the driver. After obtaining the physical hardware device, the driver can be directly used to obtain the hardware information of the physical hardware device, thereby improving the efficiency of driver verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0009] Figure 1 A flowchart of a computer program executed by a processor in a hardware information access system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0010] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0011] This embodiment provides a hardware information access system, the system comprising: a client and its corresponding driver, a display management component, a hardware simulation program, a processor and a memory storing a computer program, see Figure 1 , is a 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: 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; S105: The hardware simulation program returns the target hardware information to the client.

[0012] The hardware information access system may include at least one client, and the processing flow of the driver corresponding to each client is the same. In this embodiment, a single client is taken as an example for description.

[0013] In this embodiment, the display management component may refer to an X Server component in a Linux system, which may be used to manage graphic display and is mainly responsible for processing graphic output and receiving events from input devices and passing these events to corresponding applications.

[0014] The hardware simulation program may include several 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, and the target hardware information may refer to the hardware information required by the access request. The simulated hardware information may refer to the hardware information contained in the hardware simulation program.

[0015] Specifically, the driver may send multiple access requests to the display management component to obtain 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.

[0016] When the access request does not meet the preset conditions, it means that the target hardware information corresponding to the access request 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.

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

[0018] Among them, since only part of the hardware information may need to be focused on during the driver 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 can 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, and the driver does not need to access the display management component, thereby avoiding the display management component from being unable to obtain the target hardware information due to the absence of the physical hardware device, which in turn causes the driver to have an abnormal situation, thereby ensuring the stability of the driver operation.

[0019] In a specific implementation, the system further includes a GPU core, and 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.

[0020] The GPU kernel also includes some hardware information. 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.

[0021] In a specific implementation, 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.

[0022] Among them, in the complex scenario of driver verification, there may be hardware information that needs special attention but does not exist as simulated hardware information in the hardware simulation program. In this case, 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, the target hardware information is updated to the hardware simulation program as simulated hardware information. 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, which improves the convenience of applying the driver to physical hardware devices, that is, improves the efficiency of driver verification.

[0023] In a specific implementation, 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.

[0024] Among them, the reference hardware information may refer to the hardware information that can be obtained by the display management component. The hardware simulation program includes the simulated hardware information corresponding to all the reference hardware information. It can be indicated that the simulated hardware information contained in the hardware simulation program has covered all the reference hardware information and also includes hardware information that cannot be obtained by the display management component. On this basis, the access request only acts on the hardware simulation program. In this embodiment, the stability of the driver operation is further ensured to avoid abnormal access to the target hardware information.

[0025] In a specific implementation, 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.

[0026] Among them, when the system also includes a GPU chip, it means that the system now includes a physical hardware device of the GPU chip. In this 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 the target hardware information, the reference hardware information corresponding to the target hardware information is directly returned to the client from the display management component. It can be seen that in this embodiment, after obtaining the physical hardware device of the GPU chip, it is only necessary to close the use of the hardware simulation program, 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. There is no need to modify the driver, which improves the convenience of applying the driver to the physical hardware device, that is, improves the efficiency of driver verification.

[0027] In a specific implementation, the hijacking means at least include: function pointer tampering and code injection.

[0028] Among them, hijacking methods can also include DLL hijacking, buffer overflow hijacking, etc. The implementer can choose the appropriate hijacking method according to the actual situation.

[0029] It can be seen that this embodiment additionally constructs a hardware simulation program. When the driver sends an access request to the display management component to obtain the 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, thereby avoiding the situation where the display management component cannot obtain the target hardware information due to the absence of physical hardware devices in the system, thereby causing the driver to be abnormal, thereby ensuring the stability of the driver operation. Moreover, the use of the hardware simulation program does not require changes to the driver. After obtaining the physical hardware device, the driver can be directly used to obtain the hardware information of the physical hardware device, thereby improving the efficiency of driver verification.

[0030] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may 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 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; 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: The system further includes a GPU core, and 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.

4. 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.

5. 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.

6. 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.

7. 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

  • Mainboard attached equipment accessing method, virtual machine manager and computer

    CN102110008A

  • Computer system for testing hardware device based on virtual machine and method thereof

    CN104834576A

  • Data processing method, system, device, equipment and medium

    CN117055875A

  • Driving program debugging method and device, electronic equipment and storage medium

    CN118860878A

  • System and method for hardware and software co-verification

    US20040088150A1