Linux device driver 3 ±Ê¼Ç Ö® ÄÚ´æÓ³Éä
½ñÌì×Ô¼ºÑ§Ï° LinuxÉ豸Çý¶¯³ÌÐò µÚÈý°æ µÚ15Õ ÄÚ´æÓ³ÉäºÍDMA. ¸Ð¾õÓеã³ÔÁ¦¡£Ö÷ÒªÊǶÔÄÚ´æÓ³ÉäºÜ¶àÊõÓïºÍ¸ÅÄî²»ÊǺÜÇå³þ£¬Àí½âÆðÀ´Óеã·Ñ¾¢¡£
ºóÀ´½áºÏÓ¢ÎÄ԰棬¾²ÏÂÐÄÀ´×Ðϸѧϰ£¬²ÅËãÊÇÓÐÁËÒ»µã½øÕ¹¡£
ÏÖÔÚÔÚÕâÀï×öÒ»¸ö±Ê¼Ç£¬ÒÔ±¸ÒÔºó¸´Ï°Óá£
µÍ¶ËÄÚ´æºÍ¸ß¶ËÄÚ´æ
ÊéÖеÄͼ15-1ÓеãÎóµ¼ÈË¡£Í¼Öн« ÄÚºËÐéÄâµØÖ· ºÍ ÄÚºËÂß¼µØÖ· ·Ö¿ªÁË¡£ÆäʵӦ¸ÃÊDz¢ÔÚÒ»ÆðµÄ¡£
ÄÚºËÐéÄâµØÖ· ÊÇ ÄÚºËÂß¼µØÖ· µÄÒ»¸ö³¬¼¯¡£ ËùÓеÄÄÚºËÂß¼µØÖ·¶¼ÊÇÄÚºËÐéÄâµØÖ·¡£ µ«ÄÚºËÐéÄâµØÖ·²»Ò»¶¨ÊÇÄÚºËÂß¼µØÖ·¡£
ÔÚ32λϵͳÖУ¬ÓÃ32λ×î´óÄܱíʾ4GÄÚ´æ¡£Õâ4G¾ÍÐγÉÁËÐéÄâµØÖ·µÄ·¶Î§¡£Äں˽«Õâ4G×öÁËÒ»¸ö»®·Ö¡£
Ò»°ã½«3G»®¸øÓû§¿Õ¼ä£¬1G»®¸øÄں˿ռ䡣Õâ1G¾ÍÊÇËùνµÄÄں˵ØÖ·¿Õ¼ä¡£Ò²¾ÍÊÇ1GÄÚºËÐéÄâµØÖ·¡££¨×¢ÒâÇ°Ãæ˵ÁË£¬ÄÚºËÐéÄâµØÖ·ÊÇÄÚºËÂß¼µØÖ·µÄ³¬¼¯£©
ÄÚºËÖ»ÄÜ·ÃÎÊÕâ1GµÄÄں˵ØÖ·¿Õ¼ä¡£¶ÔËùÓÐÎïÀíÄÚ´æµÄ·ÃÎÊ£¬¶¼±ØÐëÓ³Éäµ½Õâ1GÄں˵ØÖ·¿Õ¼ä¡£
ÔÚÕâ1GÄں˵ØÖ·¿Õ¼äÖУ¬ÓÐÒ»²¿·ÖµØÖ·ÊÇÓëÎïÀíµØÖ·¾ßÓÐÒ»Ò»¶ÔÓ¦¹ØϵµÄ£¬ËûÃÇÖ®¼äÖ»²»¹ýÊDzîÁËÒ»¸ö¹Ì¶¨µÄÆ«ÒÆÁ¿¡£
Õⲿ·ÖµØÖ·¾ÍÊÇÄÚºËÂß¼µØÖ·ÁË¡£Ò²¾ÍÊÇ˵ÄÚºËÂß¼µØÖ·ÓëÎïÀíÄÚ´æµÄÓ³ÉäÊÇÏßÐԵġ£
¶øÓëÄÚºËÂß¼µØÖ·¶ÔÓ¦µÄÎïÀíÄڴ棬»òÕß˵ͨ¹ýÄÚºËÂß¼µØÖ·Ó³Éäµ½ÎïÀíÄڴ棬¾ÍÊÇËùνµÄµÍ¶ËÄÚ´æ¡£
Ç°Ãæ˵ÁË£¬Äں˵ØÖ·¿Õ¼äÖ»ÓÐ1G£¬ÄÇÆäÖеÄÄÚºËÂß¼µØÖ··¶Î§Ò»¶¨»áÂÔСÓÚ1G¡£ÄÇÔÚÅäÖÃÁ˺ܴóÄÚ´æµÄϵͳÖУ¨³¬¹ý1G£©£¬Óв¿·ÖÄÚ´æ¾Í¿Ï¶¨ÎÞ·¨Í¨¹ýÄÚºËÂß¼µØÖ·À´Ö±½ÓÓ³Éä¡£
Õⲿ·ÖÎÞ·¨Í¨¹ýÄÚºËÂß¼µØÖ·À´Ö±½ÓÓ³ÉäµÄÄÚ´æ¾ÍÊÇ ¸ß¶ËÄÚ´æ¡£
ÄÚºËÖ»ÄÜͨ¹ý×Ô¼ºµÄ1GµÄÄں˵ØÖ·¿Õ¼äÀ´·ÃÎÊÄÚ´æ¡£ÄÇÒª·ÃÎÊÕâЩ¸ß¶ËÄڴ棬¾Í±ØÐë½øÐбØÒªµÄÓ³Éä¡£°Ñ¸ß¶ËÄÚ´æÓ³Éäµ½Äں˵ØÖ·¿Õ¼ä·¶Î§ÄÚ¡£
ÒýÓÃLinux device driver Ò»Êé µÚÈý°æ µÚ15Õ ÖÐ kmap() º¯ÊýµÄ½éÉÜ£º
¶ÔÓڸ߶ËÄڴ棬kmapÔÚרÓõÄÄں˵ØÖ·¿Õ¼ä´´½¨ÌØÊâµÄÓ³Éä¡£¶Ô¸ÃÖÖÓ³ÉäµÄÊýÁ¿ÊÇÓÐÏ޵ġ£
Ò²¼´ÊÇ˵£¬ÄÚºËÔÚÄں˵ØÖ·¿Õ¼ä£¨1G£©Öл®·Ö³öÒ»²¿·Ö£¬×¨ÃÅÓÃÀ´Ó³Éä¸ß¶ËÄÚ´æ¡£
µÈÓÚ˵£¬Õⲿ·ÖÄں˵ØÖ·¿Õ¼äµÄµØÖ·ÊÇËùÓи߶ËÄÚ´æ¹²ÏíµÄ¡£ÒªÓõÄʱºò£¬Í¨¹ýkmap½øÐÐÓ³É䣬ÓÃÍêÁË£¬Í¨¹ýkunmap·µ»¹¡£
ÄÚ´æÓ³Éä ºÍ page struct
Ìáµ½page£¬Ïëµ½µÄÓ¦¸ÃÊÇÎïÀíÄÚ´æ¡£¿ÉÒÔ°ÑpageÀí½â³ÉÎïÀíÄÚ´æµÄÒ»¸öµ¥Î»¡£Äں˲»ÊÇÒÔ×Ö½ÚΪµ¥Î»À´¹ÜÀíÄÚ´æµÄ£¬¶øÊÇÒÔҳΪµ¥Î»À´¹ÜÀíÄÚ´æµÄ¡£
ËùÓеÄpage£¬¶¼ÊÇÖ¸ÎïÀíÄÚ´æ¡£
ÒòΪÄں˵ØÖ·¿Õ¼äÎÞ·¨Ö±½Ó±íʾËùÓеÄÎïÀíÄڴ棬ËùÒÔ½öͨ¹ýÒ»¸öÄÚ´æµØÖ·ÎÞ·¨´ú±íÒ»¸ö
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
http://hi.baidu.com/j_fo/blog/item/a43fa60fa6e2f4eaab6457d5.html
Linux2.6ÄÚºËepoll½éÉÜ
2008-11-05 16:35
http://blog.csdn.net/rstevens/archive/2007/10/30/1858067.aspx
http://hi.baidu.com/jmlover/blog/item/24c28b131e6b48d7f7039ee6.html
http://hi.baidu.com/jmlover/blog/item/e64df724f12926348744f9 ......
......
ÔÌû£ºhttp://www.cnscn.org/read.php?tid-44684.html
iptablesÓÐÈýÖÖÁ´
1£ºINPUT (½øÀ´µÄÁ´)
2£ºOUTPUT(³öÈ¥µÄÁ´)
3£ºFORWARD(ת·¢µÄÁ´)
iptables -A INPUT -p icmp -j DROP
-A(Ìí¼ÓÒ»¸öÁ´) -p ÐÒé -j(Ìí¼Ó¶¯×÷) ˵Ã÷Ìí¼ÓÒ»¸ö½øÀ´µÄÁ´¡£ÐÒéÊÇicmp¶¯×÷¾Ü¾ø¡£
iptables -L -n (ÓÃÊ÷ÐνṹÀ´¿´Ò»ÏÂiptablesµÄÉèÖÃ)
......
http://blog.chinaunix.net/u2/69889/showart_971040.html
LinuxÖеŤ×÷¶ÓÁÐ
£ÛÇ°¼Ç£ÝLinux×Ô´Ó2.6.20Ö®ºó£¬¹¤×÷¶ÓÁз¢ÉúÁËһЩ±ä»¯£¬Ä¿Ç°´ÓÍøÂçÉÏËÑË÷µÄ×ÊÁÏÒ»°ã¶¼ÊǽéÉÜÀÏ°æ±¾µÄ¹¤×÷¶ÓÁУ¬ºÜÉÙ¼ûµ½¶Ôа汾µÄ½éÉÜ¡£±¾ÎĶÔÐÂÀÏ°æ±¾¶¼×öÁ˼òÒª¸ÅÊö£¬²¢·Ö±ðÌṩÁ˼òµ¥µÄʵ×÷°¸Àý¡£
********************************** ......