开发者

Can I get the input data by directly reading the IOport of an USB keyboard

I am working on the Xen platform, Now I want to intercept the interrupt on HVM domain to read the raw data (scan code) of a keyboard .

One idea is开发者_运维技巧 that the hypervisor follows the path UHCI frame list-> TD related to keyboard device -> data buffer to get the raw data. However, when the interrupted is generated, the TD has been remove from the TD list. In this way, the hypervisor can not find the data buffer, and can not read the raw data.

Another idea is that directly read the IOport of keyboard.

I know it is possible to get the input of the PS2 keyboard by reading the IOport 0x60 and 0x64 But my current work device is USB keyboard.

Now my question is that whether it is possible to get the input raw data of USB keyboard by directly reading the IOports.

If can, how to achieve that, please give me an simple example.

or is there other method to read the input raw data?


it seems that there is no exported port (e.g., USB-keyboard) for guest to read such information.

but I found that, the UHCI controller does not automatically remove the TD from the list even if the controller successfully complete the data transfer. The deletion operation is done in the uhci-irq function

In this way, we can read the data buffer before the function uhci-irq is invovled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜