The Linux USB Input Subsystem, Part I
The Linux USB input subsystem is a single, harmonized way to manage all input devices. This is a relatively new approach for Linux, with the system being partly incorporated in kernel version 2.4 and fully integrated in the 2.5 development series.
This article covers four basic areas: a description of what the input subsystem does, a short historical perspective on development, a description of how the input subsystem is implemented in the kernel and an overview of the user-space API for the input subsystem and how you can use it in your programs. The first three areas are discussed in this article. The user-space API, the final topic, will be discussed in Part II of this article.
What Is the Input Subsystem?
The input subsystem is the part of the Linux kernel that manages the various input devices (such as keyboards, mice, joysticks, tablets and a wide range of other devices) that a user uses to interact with the kernel, command line and graphical user interface. This subsystem is included in the kernel because these devices usually are accessed through special hardware interfaces (such as serial ports, PS/2 ports, Apple Desktop Bus and the Universal Serial Bus), which are protected and managed by the kernel. The kernel then exposes the user input in a consistent, device-independent way to user space through a range of defined APIs.
How We Got Here
The Linux input subsystem is primarily the work of Vojtech Pavlik, who saw the need for a flexible input system from his early work on joystick support for Linux and his later work on supporting USB. The first integration for the input subsystem replaced existing joystick and USB drivers in the 2.3 development kernel series. This support carried over to version 2.4, and input support in the 2.4 series is basically limited to joysticks and USB input devices.
The 2.5 development kernel series fully integrates the input subsystem. This tutorial is based on the full integration, which will be the input API for the 2.
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÎļþÊôÐÔ£¬
ÔÚshell»·¾³ÀïÊäÈ룺ls -l ¿ÉÒԲ鿴µ±Ç°Ä¿Â¼Îļþ¡£È磺
drwxr-xr-x 2 nsf users 1024 12-10 17:37 ÏÂÔØÎļþ±¸·Ý
·Ö±ð¶ÔÓ¦µÄÊÇ£º
ÎļþÊôÐÔ Á¬½ÓÊý ÎļþÓµÓÐÕß ËùÊôȺ×é Îļþ´óС ÎļþÐÞ¸Äʱ¼ä ÎļþÃû
ÕâÀïrÊǿɶÁ£¬w¿Éд,x ¿ÉÖ´ÐУ¬ÆäÖÐÎļþÊôÐÔ·ÖΪËĶΣ¬---- --- --- 10¸öλÖÃ
ÀýÈ磺
¡¡¡¡d ......
LinuxϵͳÏ»ù±¾ÃüÁ ÒªÇø·Ö´óСд uname ÏÔʾ°æ±¾ÐÅÏ¢£¨Í¬win2KµÄ ver£© dir ÏÔʾµ±Ç°Ä¿Â¼Îļþ,ls -al ÏÔʾ°üÀ¨Òþ²ØÎļþ£¨Í¬win2KµÄ dir£© pwd ²éѯµ±Ç°ËùÔÚµÄĿ¼λÖà cd cd¡¡..»Øµ½ÉÏÒ»²ãĿ¼£¬×¢Òâcd Óë..Ö®¼äÓпոñ¡£cd¡¡/·µ»Øµ½¸ùĿ¼¡£ cat ÎļþÃû ²é¿´ÎļþÄÚÈÝ cat >abc.txt Íùabc.txtÎļþÖÐдÉÏÄÚÈÝ¡£ more Î ......
------------------------------------------
±¾ÎÄϵ±¾Õ¾Ô´´,»¶ÓתÔØ!
תÔØÇë×¢Ã÷³ö´¦:http://ericxiao.cublog.cn/
------------------------------------------
Ò»£ºÇ°ÑÔ
ÔÚ¼üÅÌÇý¶¯´úÂë·ÖÎöµÄ±Ê¼ÇÖУ¬½Ó´¥µ½ÁËinput×Óϵͳ.¼üÅÌÇý¶¯£¬¼üÅÌÇý¶¯½«¼ì²âµ½µÄËùÓа´¼ü¶¼Éϱ¨¸øÁËinput×Óϵ ......