Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux miscÉ豸

²Î¿¼£º
http://longer.spaces.eepw.com.cn/articles/article/item/60415
http://imganquan.org/blog/?p=350
ÍøÉÏÕҵģ¬¹éÄÉһϣº
ÔÓÏîÉ豸£¨misc device£©
ÔÓÏîÉ豸ҲÊÇÔÚǶÈëʽϵͳÖÐÓõñȽ϶àµÄÒ»ÖÖÉ豸Çý¶¯¡£ÔÚ Linux Äں˵Äinclude\linuxĿ¼ÏÂÓÐMiscdevice.hÎļþ£¬Òª°Ñ×Ô¼º¶¨ÒåµÄmisc device´ÓÉ豸¶¨ÒåÔÚÕâÀï¡£ÆäʵÊÇÒòΪÕâЩ×Ö·ûÉ豸²»·ûºÏÔ¤ÏÈÈ·¶¨µÄ×Ö·ûÉ豸·¶³ë£¬ËùÓÐÕâЩÉ豸²ÉÓÃÖ÷±àºÅ10 £¬Ò»Æð¹éÓÚmisc device£¬Æäʵmisc_register¾ÍÊÇÓÃÖ÷±êºÅ10µ÷ÓÃregister_chrdev()µÄ¡£
Ò²¾ÍÊÇ˵£¬miscÉ豸ÆäʵҲ¾ÍÊÇÌØÊâµÄ×Ö·ûÉ豸¡£
×Ö·ûÉ豸(char device)
ʹÓÃregister_chrdev(LED_MAJOR,DEVICE_NAME,&dev_fops)×¢²á×Ö·ûÉ豸Çý¶¯³ÌÐòʱ£¬Èç¹ûÓжà¸öÉ豸ʹÓøú¯Êý×¢²áÇý¶¯³ÌÐò£¬LED_MAJOR²»ÄÜÏàͬ£¬·ñÔò¼¸¸öÉ豸¶¼ÎÞ·¨×¢²á(ÎÒÒÑÑéÖ¤)¡£Èç¹ûÄ£¿éʹÓø÷½Ê½×¢²á²¢ÇÒ LED_MAJORΪ0(×Ô¶¯·ÖÅäÖ÷É豸ºÅ )£¬Ê¹ÓÃinsmodÃüÁî¼ÓÔØÄ£¿éʱ»áÔÚÖÕ¶ËÏÔʾ·ÖÅäµÄÖ÷É豸ºÅºÍ´ÎÉ豸ºÅ£¬ÔÚ/devĿ¼Ï½¨Á¢¸Ã½Úµã£¬±ÈÈçÉ豸leds£¬Èç¹û¼ÓÔظÃÄ£¿éʱ·ÖÅäµÄÖ÷É豸ºÅºÍ´ÎÉ豸ºÅΪ253ºÍ0£¬Ôò½¨Á¢½Úµã:mknod leds c 253 0¡£Ê¹ÓÃregister_chrdev (LED_MAJOR,DEVICE_NAME,&dev_fops)×¢²á×Ö·ûÉ豸Çý¶¯³ÌÐòʱ¶¼ÒªÊÖ¶¯½¨Á¢½Úµã £¬·ñÔòÔÚÓ¦ÓóÌÐòÎÞ·¨´ò¿ª¸ÃÉ豸¡£
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/lanmanck/archive/2009/10/22/4713978.aspx


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨Èý£© HCI²ã±à³Ì

1. HCI²ãЭÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI)  ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈЭÒé ......

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

linux vi µÄ¼òµ¥Ó÷¨

 ½øÈëviºó ÓÐÁ½ÖÖģʽ
1.±à¼­Ä£Ê½
2.ÃüÁîģʽ
½øÈëviºóĬÈÏÊÇÃüÁîģʽ£¬ËùÒÔ²»ÒªÂÒ°´ ¾Í»áµÃµ½ddµÄ¾¯¸æÉù£¬ÒªÊäÈëÎÄ×ֵĻ° Çë°´aºói ¾Í¿ÉÒÔ¿ªÊ¼ÊäÈëÎÄ×ÖÀ­£¡
ÊäÈë½áÊøºó Çë°´esc¼ü»ØÃüÁîģʽ
ÊäÈëq¾ÍÊÇÍ˳ö
ÊäÈëwq¾ÍÊÇ´æÅ̺óÍ˳ö
ÊäÈëq!·ÅÆú´æÅÌÇ¿ÐÐÍ˳ö
.
Vi µÄʹÓÃ
Vi ÒѾ­ÊÇ Unix ϵͳÖбê×¼µÄÎÄ×Ö±à¼­Æ ......

linux cÎÊÌ⼯½õ

1.ΪʲôÎÒдµÄMakefile£¬Ôڱ༭ÁËÔ´´úÂëÎļþºó£¬Ê¹ÓÃmake£¬makeÈ´ÌáʾĿ±êÎļþÒѾ­Îª×îеÄÁË£¡
2.OpenGL,ÔÚ´°¿ÚÖл­µãʱ£¬ÔõÑùʹÓÃglVertexi()º¯Êý£¿ÒòΪ´«µÝµÄ²ÎÊýÈç¹ûÊÇ´óÓÚ1µÄintÐÍ£¬Ôò²»ÐУ¬¶ø±ØÐë´«µÝ[-0.1~0.1]Ö®¼äµÄfloat£¬¶øÇÒʹÓú¯Êý
gVertex2f().
3.OpenGL,ʹÓò˵¥Ê±£¬ÔõÑù½â¾öµã»÷²Ëµ¥ºó²»Òª²¶×½GLUT_UPÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ