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.
Ïà¹ØÎĵµ£º
´ÅÅÌ·ÖÇø¹¤¾ß--fdisk
fdisk /dev/hda
fdiskÃüÁîµÄ×ÓÃüÁî
-m ÏÔʾ°ïÖú£¨ÃüÁîÇåµ¥£©
-a ¼¤»î·ÖÇøµÄ¿ÉÒýµ¼±êÖ¾
-l Áгö¿ÉÑ¡µÄ·ÖÇøÀàÐÍ
-n Ìí¼ÓзÖÇø
-d ɾ³ýÒѾ´æÔڵķÖÇø
-p ÏÔʾ·ÖÇø±í
-t ¸Ä±ä·ÖÇøµÄÎļþÀàÐÍ
  ......
¶ÔÓÚÒ»¸öÎļþÀ´Ëµ£¬ÓÐΨһµÄË÷Òý½ÓµãÓëÖ®¶ÔÓ¦£¬¶ø¶ÔÓÚÒ»¸öË÷Òý½ÓµãºÅ£¬È´¿ÉÒÔÓжà¸öÎļþÃûÓëÖ®¶ÔÓ¦¡£Òò´Ë£¬ÔÚ´ÅÅÌÉϵÄͬһ¸öÎļþ¿ÉÒÔͨ¹ý²»Í¬µÄ·¾¶È¥·ÃÎÊ
¸ÃÎļþ¡£
¡¡¡¡£±.Á¬½ÓÓÐÈíÁ¬½ÓºÍÓ²Á¬½Ó(hard link)Ö®·ÖµÄ£¬ÈíÁ¬½Ó(symbolic
link)ÓֽзûºÅÁ¬½Ó¡£·ûºÅÁ¬½ÓÏ൱ÓÚWindowsϵĿì½Ý·½Ê½¡£
ÈíÁ´½Óʵ¼ÊÉÏÖ»ÊÇÒ»¶ÎÎÄ× ......
Ö÷ÒªÓÐÏÂÃæÈýÖÖ·½Ê½£º
1.whereis ÎļþÃû
ÌØµã:¿ìËÙ, Ö´ÐÐ׼ȷ²éÕÒ¡£
2.find / -name ÎļþÃû
²é³öºÜ¶à¶«Î÷£¬Óкܶà
“Permission Denied".
#find / -name php.ini
3.locate ÎļþÃû
×î¿ìµÄ·½·¨.Ö´ÐÐÄ£ºý²éÕÒ¡£
×¢Òâ:µÚÒ»´ÎʹÓøÃÃüÁî,¿ÉÄÜÐèÒª¸üÐÂÊý¾Ý¿â,°´ÕÕÌáʾµÄÃüÁîÖ´ÐÐһϾͺÃÁË.
ÕâÀï¾ÍҪ˵˵loc ......
Ò»¡¢±¾´ÎÄں˱àÒëÐÂÄÚºËËùÉæ¼°Èí¼þ°æ±¾
“gcc –version”¿É²éѰGCC°æ±¾------4.3.2 20081105£¨Red Hat 4.3.2-7£©
“make –v”¿É²éѯ Gnu make°æ±¾-----3.81
“ld –V£¨v£©¿É²éѯGNU ld°æ±¾-----2.18.50.0.9-7¡£f c10 20080822
“fdformat --version”ÃüÁî ......
Linux·¢Ðа汾֮¼äµÄ²î±ðÆäʵºÜÉÙ£¬²î±ðÖ÷Òª±íÏÖÔÚϵͳ¹ÜÀíµÄÌØÉ«¹¤¾ßÒÔ¼°Èí¼þ°ü¹ÜÀí·½Ê½µÄ²»Í¬£¬³ý´ËÖ®Í⣬ûÓÐʲô´óµÄ²î±ð£» ±ÈÈçFedoraÈí¼þ°ü¹ÜÀí¹¤¾ßÊÇrpm£¬¶øSlackwareÊÇpkgtool »òinstallpkgµÈ£»
ÑÔ¹éÕý´«£¬ÎÒÃǽÓ×Å˵Îļþϵͳ×éÖ¯½á¹¹¡£
/ LinuxÎļþϵͳµÄÈë¿Ú£¬Ò²ÊÇ´¦ÓÚ×î¸ßÒ»¼¶µÄĿ¼£»
/bin »ù´¡ÏµÍ³ËùÐèÒªµ ......