linuxÉ豸Çý¶¯Ö®¿ØÖÆÌ¨Çý¶¯
¡¡Ò»:ǰÑÔ
¡¡¡¡ÎÒÃÇÔÚ֮ǰ·ÖÎö¹ýinput×ÓϵͳºÍttyÉ豸Çý¶¯¼Ü¹¹.½ñÌìÐèÒª½«Á½Õß½áºÏÆðÀ´.¿´¿´linuxÖеĿØÖÆÌ¨ÊÇÔõôÑùʵÏÖµÄ.
¡¡¡¡¶þ:¿ØÖÆÌ¨Çý¶¯µÄ³õʼ»¯
¡¡¡¡Ö®Ç°ÔÚ·ÖÎöttyÇý¶¯¼Ü¹¹µÄʱºòÔø·ÖÎöµ½.Ö÷É豸Ϊ4,´ÎÉ豸Ϊ0µÄÉ豸½Úµã,¼´/dev/tty0Ϊµ±Ç°µÄ¿ØÖÆÖÕ¶Ë.
¡¡¡¡ÓÐtty_init()ÖÐ,ÓÐÒÔÏ´úÂë¶Î:
¡¡¡¡static int __init tty_init(void)
¡¡¡¡{
¡¡¡¡……
¡¡¡¡……
¡¡¡¡#ifdef CONFIG_VT
¡¡¡¡cdev_init(&vc0_cdev, &console_fops);
¡¡¡¡if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
¡¡¡¡register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
¡¡¡¡panic("Couldn't register /dev/tty0 driver\n");
¡¡¡¡device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), "tty0");
¡¡¡¡vty_init();
¡¡¡¡#endif
¡¡¡¡return 0;
¡¡¡¡}
¡¡¡¡CONFIG_VT:ÊÇÖ¸ÅäÖÃÐéÄâÖÕ¶Ë.¼´ÎÒÃÇËù˵µÄ¿ØÖÆÌ¨.ÔÚ´Ë¿ÉÒÔ¿´µ½TTY_MAJOR(4),0¶ÔÓ¦µÄÉ豸½Úµã²Ù×÷¼¯Îªconsole_fops.
¡¡¡¡¼ÌÐø¸ú½øvty_init()
¡¡¡¡int __init vty_init(void)
¡¡¡¡{
¡¡¡¡vcs_init();
¡¡¡¡console_driver = alloc_tty_driver(MAX_NR_CONSOLES);
¡¡¡¡if (!console_driver)
¡¡¡¡panic("Couldn't allocate console driver\n");
¡¡¡¡console_driver->owner = THIS_MODULE;
¡¡¡¡console_driver->name = "tty";
¡¡¡¡console_driver->name_base = 1;
¡¡¡¡console_driver->major = TTY_MAJOR;
¡¡¡¡console_driver->minor_start = 1;
¡¡¡¡console_driver->type = TTY_DRIVER_TYPE_CONSOLE;
¡¡¡¡console_driver->init_termios = tty_std_termios;
¡¡¡¡console_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
¡¡¡¡tty_set_operations(console_driver, &con_ops);
¡¡¡¡if (tty_register_driver(console_driver))
¡¡¡¡panic("Couldn't register console driver\n");
¡¡¡¡kbd_init();
¡¡¡¡console_map_init();
¡¡¡¡#ifdef CONFIG_PROM_CONSOLE
¡¡¡¡prom_con_init();
¡¡¡¡#endif
¡¡¡¡#ifdef CONFIG_MDA_CONSOLE
¡¡¡¡mda_console_init();
¡¡¡¡#endif
¡¡¡¡return 0;
¡¡¡¡}
¡¡¡¡¾¹ýÎÒÃÇ֮ǰµÄttyÇý¶¯¼Ü¹¹·ÖÎö,Õâ¶Î´úÂë¿´ÆðÀ´¾Í±È½Ï¼òµ¥ÁË,Ëü¾ÍÊÇ×¢²áÁËÒ»¸öttyÇý¶¯.Õâ¸öÇý¶¯¶ÔÓ¦µÄ²Ù×÷¼¯ÊÇλÓÚcon_opsÀïÃæµÄ.
¡¡¡¡×Ðϸ¿´.ÔÚÖ®ºó»¹»áµ÷ÓÃkbd_init().¹ËÃû˼Òå,Õâ¸öÊÇÒ»¸öÓй
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,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 ......
×¢£ºÒÔÏÂÄÚÈÝת×Ô£º
http://blog.chinaunix.net/u2/81965/showart_1674967.html
¹úÄÚÕ¾µã£º
ftp://ftp.altera.com/outgoing/release/
http://www.china-vision.net/blog/user1/6/archives/2006/200696114213.html
http://mail.google.com
shao_»ªºã¹«Ë¾µÄÖ÷Ò³£¬ÀïÃæÓкܶàµÄÏà¹Ø×ÊÁÏ£¬Óдý´ó¼ÒÈ¥·¢ÏÖ
......
gprof½éÉÜ
gprofÊÇGNU profiler¹¤¾ß£¬´æÔÚÓÚbinutils¹¤¾ß°ü¡£¿ÉÒÔÏÔʾ³ÌÐòÔËÐеēflat profile”£¬°üÀ¨Ã¿¸öº¯ÊýµÄµ÷ÓôÎÊý£¬Ã¿¸öº¯ÊýÏûºÄµÄ´¦ÀíÆ÷ʱ¼ä¡£Ò²¿ÉÒÔÏÔʾ“µ÷ÓÃͼ”£¬°üÀ¨º¯ÊýµÄµ÷ÓùØÏµ£¬Ã¿¸öº¯Êýµ÷Óû¨·ÑÁ˶àÉÙʱ¼ä¡£»¹¿ÉÒÔÏÔʾ“×¢Ê͵ÄÔ´´úÂ딣¬ÊdzÌÐòÔ´´úÂëµÄÒ»¸ö¸´±¾£¬±ê¼Ç ......