Linux ×Ö·ûÉ豸Çý¶¯³ÌÐòµÄ±àд¿ò¼Ü
Ò»¡¢Linux device driver µÄ¸ÅÄî
ϵͳµ÷ÓÃÊDzÙ×÷ϵͳÄں˺ÍÓ¦ÓóÌÐòÖ®¼äµÄ½Ó¿Ú£¬É豸Çý¶¯³ÌÐòÊDzÙ×÷ϵͳÄں˺ͻúÆ÷Ó²¼þÖ®¼äµÄ½Ó¿Ú¡£É豸Çý¶¯³ÌÐòΪӦÓóÌÐòÆÁ±ÎÁËÓ²¼þµÄϸ½Ú£¬ÕâÑùÔÚÓ¦ÓóÌ
Ðò¿´À´£¬Ó²¼þÉ豸ֻÊÇÒ»¸öÉ豸Îļþ£¬Ó¦ÓóÌÐò¿ÉÒÔÏó²Ù×÷ÆÕͨÎļþÒ»Ñù¶ÔÓ²¼þÉ豸½øÐвÙ×÷¡£É豸Çý¶¯³ÌÐòÊÇÄں˵ÄÒ»²¿·Ö£¬ËüÍê³ÉÒÔÏµĹ¦ÄÜ:
1¡¢¶ÔÉ豸³õʼ»¯ºÍÊÍ·Å£»
2¡¢°ÑÊý¾Ý´ÓÄں˴«Ë͵½Ó²¼þºÍ´ÓÓ²¼þ¶ÁÈ¡Êý¾Ý£»
3¡¢¶ÁÈ¡Ó¦ÓóÌÐò´«Ë͸øÉ豸ÎļþµÄÊý¾ÝºÍ»ØËÍÓ¦ÓóÌÐòÇëÇóµÄÊý¾Ý£»
4¡¢¼ì²âºÍ´¦ÀíÉ豸³öÏֵĴíÎó¡£
ÔÚLinux²Ù×÷ϵͳÏÂÓÐÈýÀàÖ÷ÒªµÄÉ豸ÎļþÀàÐÍ£¬Ò»ÊÇ×Ö·ûÉ豸£¬¶þÊÇ¿éÉ豸£¬ÈýÊÇÍøÂçÉ豸¡£×Ö·ûÉ豸ºÍ¿éÉ豸µÄÖ÷ÒªÇø±ðÊÇ:ÔÚ¶Ô×Ö·ûÉ豸·¢³ö¶Á/дÇëÇó
ʱ£¬Êµ¼ÊµÄÓ²¼þI/OÒ»°ã¾Í½ô½Ó×Å·¢ÉúÁË£¬¿éÉ豸Ôò²»È»£¬ËüÀûÓÃÒ»¿éϵͳÄÚ´æ×÷»º³åÇø£¬µ±Óû§½ø³Ì¶ÔÉ豸ÇëÇóÄÜÂú×ãÓû§µÄÒªÇ󣬾ͷµ»ØÇëÇóµÄÊý¾Ý£¬Èç¹û²»
ÄÜ£¬¾Íµ÷ÓÃÇëÇóº¯ÊýÀ´½øÐÐʵ¼ÊµÄI/O²Ù×÷¡£¿éÉ豸ÊÇÖ÷ÒªÕë¶Ô´ÅÅ̵ÈÂýËÙÉ豸Éè¼ÆµÄ£¬ÒÔÃâºÄ·Ñ¹ý¶àµÄCPUʱ¼äÀ´µÈ´ý¡£
ÒѾÌáµ½£¬Óû§½ø³ÌÊÇͨ¹ýÉ豸ÎļþÀ´Óëʵ¼ÊµÄÓ²¼þ´ò½»µÀ¡£Ã¿¸öÉ豸Îļþ¶¼¶¼ÓÐÆäÎļþÊôÐÔ(c/b)£¬±íʾÊÇ×Ö·ûÉ豸»¹ÊÇ¿éÉ豸?ÁíÍâÿ¸öÎļþ¶¼ÓÐÁ½¸öÉ豸
ºÅ£¬µÚÒ»¸öÊÇÖ÷É豸ºÅ£¬±êʶÇý¶¯³ÌÐò£¬µÚ¶þ¸öÊÇ´ÓÉ豸ºÅ£¬±êʶʹÓÃͬһ¸öÉ豸Çý¶¯³ÌÐòµÄ²»Í¬µÄÓ²¼þÉ豸£¬±ÈÈçÓÐÁ½¸öÈíÅÌ£¬¾Í¿ÉÒÔÓôÓÉ豸ºÅÀ´Çø·ÖËûÃÇ¡£Éè
±¸ÎļþµÄµÄÖ÷É豸ºÅ±ØÐëÓëÉ豸Çý¶¯³ÌÐòÔڵǼÇʱÉêÇëµÄÖ÷É豸ºÅÒ»Ö£¬·ñÔòÓû§½ø³Ì½«ÎÞ·¨·ÃÎʵ½Çý¶¯³ÌÐò¡£
×îºó±ØÐëÌáµ½µÄÊÇ£¬ÔÚÓû§½ø³Ìµ÷ÓÃÇý¶¯³ÌÐòʱ£¬ÏµÍ³½øÈëºËÐÄ̬£¬Õâʱ²»ÔÙÊÇÇÀÏÈʽµ÷¶È¡£Ò²¾ÍÊÇ˵£¬ÏµÍ³±ØÐëÔÚÄãµÄÇý¶¯³ÌÐòµÄ×Óº¯Êý·µ»Øºó²ÅÄܽøÐÐÆäËûµÄ¹¤
×÷¡£Èç¹ûÄãµÄÇý¶¯³ÌÐòÏÝÈëËÀÑ»·£¬²»ÐÒµÄÊÇÄãÖ»ÓÐÖØÐÂÆô¶¯»úÆ÷ÁË£¬È»ºó¾ÍÊÇÂþ³¤µÄfsck¡£
¶þ¡¢ÊµÀýÆÊÎö
ÎÒÃÇÀ´Ð´Ò»¸ö×î¼òµ¥µÄ×Ö·ûÉ豸Çý¶¯³ÌÐò¡£ËäÈ»ËüʲôҲ²»×ö£¬µ«ÊÇͨ¹ýËü¿ÉÒÔÁ˽âLinuxµÄÉ豸Çý¶¯³ÌÐòµÄ¹¤×÷ÔÀí¡£°ÑÏÂÃæµÄC´úÂëÊäÈë»úÆ÷£¬Äã¾Í»á»ñµÃ
Ò»¸öÕæÕýµÄÉ豸Çý¶¯³ÌÐò¡£
ÓÉÓÚÓû§½ø³ÌÊÇͨ¹ýÉ豸ÎļþͬӲ¼þ´ò½»µÀ£¬¶ÔÉ豸ÎļþµÄ²Ù×÷·½Ê½²»Íâºõ¾ÍÊÇһЩϵͳµ÷Óã¬Èç
open£¬read£¬write£¬close…£¬
×¢Ò⣬²»ÊÇfopen£¬ fread£¬µ«ÊÇÈçºÎ°Ñϵͳµ÷ÓúÍÇý¶¯³ÌÐò¹ØÁªÆðÀ´ÄØ?ÕâÐèÒªÁ˽âÒ»¸ö·Ç³£¹Ø¼ü
Ïà¹ØÎĵµ£º
ÏêÇéÇë·ÃÎÊ£ºhttp://deb.opera.com/
Opera
¹Ù·½Ô´£º
×îеİ汾:
deb http://deb.opera.com/opera/ unstable non-free
»òÕßÑ¡ÔñÎȶ¨µÄ°æ±¾£º
deb http://deb.opera.com/opera/ stable non-free
£¨ÐÞ¸Äsources.listÎļþÖÐÔ´µÄÁÐ±í£¬Ìí¼ÓOpera Ô´£©ÃüÁ
sudo gedit /etc/apt/sources.list
£¨±¸·Ýµ±Ç°µÄÔ´ÁÐ±í£© ......
which Óï·¨ which command ˵Ã÷ ÒÀÐò´Ópath»·¾³±äÁ¿ËùÁеÄĿ¼ÖÐÕÒ³öcommandµÄλÖ㬲¢ÏÔʾÍêÕû·¾¶µÄÃû³Æ¡£ÔÚÕÒµ½µÚÒ»¸ö·ûºÏÌõ¼þµÄ³ÌÐòÎļþʱ£¬¾ÍÁ¢¿ÌÍ£Ö¹ËÑË÷£¬Ê¡ÂÔÆäÓàδËÑË÷Ŀ¼¡£ ·¶Àý£¬ÕÒ³ölsÃüÁîµÄ³ÌÐòÎļþµÄλÖ㺠which ls ϵͳÊä³ö£º /usr/bin/ls whereis Óï·¨ whereis [option] name ˵Ã÷ ÕÒ³öÌض¨ ......
ÔÚFC8ÖÐĬÈÏ°²×°µÄÓÐmysql£¬Ã»ÓеĻ°¿ÉÒԺܷ½±ãµÄ°²×°Ï¡£
ĬÈϵÄmysqlµÄincludeÎļþĿ¼ÔÚ/usr/include/mysql
ĬÈϵÄmysqlµÄlibÎļþ¼ÐÔÚ/usr/lib/mysql
ÕâÁ½¸öĿ¼ÔÚÎÒÃDZàÒëʱºòÐèÒªµ½¡£
ÎҵIJâÊÔÓõÄC´úÂëΪ£º
££include <stdio.h>
#include <stdlib.h>
#include <mysql.h>
#define CONN_HOST ......
µ±ÎÒÃǵijÌÐò±ÀÀ£Ê±£¬ÄÚºËÓпÉÄܰѸóÌÐòµ±Ç°ÄÚ´æÓ³Éäµ½coreÎļþÀ·½±ã³ÌÐòÔ±ÕÒµ½³ÌÐò³öÏÖÎÊÌâµÄµØ·½¡£×î³£³ö
Ïֵģ¬¼¸ºõËùÓÐC³ÌÐòÔ±¶¼³öÏÖ¹ýµÄ´íÎó¾ÍÊÇ“¶Î´íÎó”ÁË¡£Ò²ÊÇ×îÄѲé³öÎÊÌâÔÒòµÄÒ»¸ö´íÎó¡£ÏÂÃæÎÒÃǾÍÕë¶Ô“¶Î´íÎó”À´·ÖÎöcoreÎļþµÄ²úÉú¡¢ÒÔ¼°ÎÒÃÇ
ÈçºÎÀûÓÃcoreÎļþÕÒµ½³öÏÖ±ÀÀ£µÄµØ· ......
Ò»¡¢USB´ÓÉ豸Çý¶¯½éÉÜ
USB×ÜÏßÉÏÖ÷ÒªÓÐÈýÀàÉ豸£ºÖ÷¿ØÖÆÆ÷£¨Host Controller£¬ such as
EHCI¡¢UHCI¡¢OHCI£©¡¢¼¯ÏßÆ÷£¨hub£©ºÍÉ豸£¨device£©¡£Host controller£¨HC£©¸ºÔð×ÜÏߵĹÜÀí
£¬
ÊÇ×ÜÏßµÄÖ¸»Ó¹Ù£¬×ÜÏßÉÏÒ»Çд«Ê䶼ÊÇÓÉHC·¢ÆðµÄ£¬Ö§³ÖOTGµÄDeviceÒ²ÄÜ·¢Æð´«Ê䣻HubÊÇ×ÜÏߵĽڵ㣬ÓÃÀ´À©Õ¹×ÜÏßÉϿɽÓÈëÉ豸µÄÊýÁ¿ ......