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

תÌù£ºLinux I/OÖض¨ÏòµÄһЩС¼¼ÇÉ

¼¶±ð£º ³õ¼¶
·®Ææ (fanqi@cn.ibm.com), Xseries eServer ¹¤³Ìʦ, IBM TSS China Beijing
2004 Äê 11 ÔÂ 01 ÈÕ
Linux I/O Öض¨ÏòËäÈ»ºÜ¼òµ¥£¬µ«Ôڽű¾±àд¡¢ÏµÍ³¹ÜÀíʱȴҪ³£³£´ò½»µÀ£¬¸ãÇåÆäÖÐʹÓü¼Çɷdz£ÓÐÓá£
Ê×ÏÈ˵һÏÂʲôÊÇI/OÖض¨Ïò£¬ËùνI/OÖض¨Ïò¼òµ¥À´Ëµ¾ÍÊÇÒ»¸ö¹ý³Ì£¬Õâ¸ö¹ý³Ì²¶×½Ò»¸öÎļþ£¬»òÕßÃüÁ³ÌÐò£¬½Å±¾£¬ÉõÖÁ½Å±¾ÖеĴúÂë¿é£¨code block£©µÄÊä³ö£¬È»ºó°Ñ²¶×½µ½µÄÊä³ö£¬×÷ΪÊäÈë·¢Ë͸øÁíÍâÒ»¸öÎļþ£¬ÃüÁ³ÌÐò£¬»òÕ߽ű¾¡£
Èç¹û̸µ½I/OÖض¨Ïò£¬¾ÍÉæ¼°µ½Îļþ±êʶ·û(File Descriptor)µÄ¸ÅÄî, ÔÚLinuxϵͳÖУ¬ÏµÍ³ÎªÃ¿Ò»¸ö´ò¿ªµÄÎļþÖ¸¶¨Ò»¸öÎļþ±êʶ·ûÒÔ±ãϵͳ¶ÔÎļþ½øÐиú×Ù£¬ÕâÀïÓÐЩºÍCÓïÑÔ±à³ÌÀïµÄÎļþ¾ä±úÏàËÆ£¬Îļþ±êʶ·ûÊÇÒ»¸öÊý×Ö£¬²»Í¬Êý×Ö´ú±í²»Í¬µÄº¬Ò壬ĬÈÏÇé¿öÏ£¬ÏµÍ³Õ¼ÓÃÁË3¸ö£¬·Ö±ðÊÇ0±ê×¼ÊäÈ루stdin£©,1±ê×¼Êä³ö(stdout), 2±ê×¼´íÎó(stderr), ÁíÍâ3-9ÊDZ£ÁôµÄ±êʶ·û£¬¿ÉÒÔ°ÑÕâЩ±êʶ·ûÖ¸¶¨³É±ê×¼ÊäÈ룬Êä³ö»òÕß´íÎó×÷ΪÁÙʱÁ¬½Ó¡£Í¨³£ÕâÑù¿ÉÒÔ½â¾öºÜ¶à¸´ÔÓµÄÖض¨ÏòÇëÇó¡£
±ê×¼ÊäÈëͨ³£Ö¸¼üÅ̵ÄÊäÈë
±ê×¼Êä³öͨ³£Ö¸ÏÔʾÆ÷µÄÊä³ö
±ê×¼´íÎóͨ³£Ò²ÊǶ¨Ïòµ½ÏÔʾÆ÷
Çë¿´ÒÔÏÂÀý×Ó£¬À´ÃèÊöÒ»ÏÂËûÃǵĹØϵ#ls /dev
Õâ¸öÃüÁîÁгö/devĿ¼ÏµÄËùÓÐÎļþ£¬ÔÚÆÁÄ»ÉÏÊä³ö½á¹û¡£
ÕâÀï /dev ¾ÍÊÇ×÷ΪÃüÁîlsµÄ±ê×¼ÊäÈ루´Ó¼üÅÌÊäÈ룩£¬¶ø´òÓ¡ÔÚÆÁÄ»µÄ½á¹û¾ÍÊDZê×¼Êä³ö£¨/devĿ¼ÖеÄÄÚÈÝ£©
»¹Êǻص½±êÌ⣬Öض¨Ïò¾ÍÊǰѱê×¼µÄÊäÈë»òÕßÊä³ö¸ü¸Ä³ÉÆäËûµÄ·½Ê½£¬Çë²Î¿´ÈçÏÂÀý×Ó
»òÕßµÈͬÓÚ
#ls /dev 1>filename #×¢Ò⣺"1"ºÍ">"ÖмäûÓпոñ
ÒÔÉÏÃüÁî»á°ÑÃüÁîµÄ±ê×¼Êä³öÖØж¨Ïòµ½Ò»¸öÎļþfilename,¶ø²»ÊÇÏÔʾµ½ÆÁÄ»ÉÏ£¬Èç¹û²»Ö¸Ã÷Îļþ±êʶ·û£¬ÏµÍ³Ä¬ÈϵľÍÊÇ1, Òò´Ë1¿ÉÒÔÊ¡ÂÔ
Èç¹û°ÑÉÏÃæÀý×ÓÖصÄ">"¸Ä³É">>"Ôò±íʾ°ÑÊä³ö×·¼Óµ½filenameÎļþµÄĩ⣬Èç¹ûÎļþ²»´æÔÚÔò´´½¨Ëü¡£ÈçÏÂ
#ls /dev >>filename
Ò²¿ÉÒ԰ѱê×¼´íÎóÖØж¨Ïòµ½Îļþ
#ls -qw /dev 2>filename
ÏÔÈ» -qwÊÇÒ»¸ö´íÎó²ÎÊý£¬Í¨³£»áÔÚÏÔʾÆ÷Éϱ¨¸æÒ»¸ö´íÎóÐÅÏ¢£¬µ«ÓÉÓÚ°Ñ2±ê×¼´íÎó£¨stderr£©ÖØж¨Ïòµ½ÁËÎļþfilename£¬Òò´ËÏÔʾÆ÷ûÓдíÎóÐÅÏ¢£¬¶øÐÅϢдµ½ÁËÎļþÀïÃæ
ÒÔÏÂÃüÁîÊǰѱê×¼Êä³öºÍ´íÎ󶼶¨Ïòµ½Îļþ
#ls /dev &>filename
"&"ÔÚÕâÀï´ú±í±ê×¼Êä³öºÍ±ê×¼´íÎó£¬ÕâÀïÎÞÂÛÊÇÕý³£Êä³ö»¹ÊÇ´íÎóÐÅÏ¢¶¼Ð´µ½filenameÖÐÁË¡£
ÖØж¨Òå±ê×¼ÊäÈ룬Êä³ö£¬ºÍ´íÎóµÄÎļþ±êʶ·û


Ïà¹ØÎĵµ£º

libjpegµÄARM linuxÒÆÖ²

Ò»¡¢ÏÂÔØjpeg¿â
¶þ¡¢ÅäÖñàÒ룬Éú³ÉMakefileÎļþ¡£
#./configure --prefix=/usr/arm/arm-linux --exec-prefix=/usr/arm/arm-linux \
--enable-shared --enable-static
×¢Ò⣺prefixÊÇ×îºó°²×°Ê±¿â´æ·ÅµÄÎļþ£¬sharedÊDZàÒë³É¶¯Ì¬¿â£¬staticÊDZàÒë³É¾²Ì¬¿â
Èý¡¢ÐÞ¸ÄÉú³ÉµÄMakefile¡£
ʹÓÃgedit £Í£á£ë£å£æ£é£ì£å
½«CC ......

Linux manÃüÁîµÄʹÓ÷½·¨

man¾ÍÊÇmanualµÄËõд£¬ÓÃÀ´²é¿´ÏµÍ³ÖÐ×Ô´øµÄ¸÷Öֲο¼Êֲᡣ
Ò»¡¢ËµÃ÷
1£¬ÊÖ²áÒ³·ÖΪºÃ¼¸¸ö²¿·Ö£¬ÈçÏÂËùʾ£º
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File fo ......

Linux²Ù×÷ϵͳµÄConfigure²ÎÊý½âÊÍ˵Ã÷

Linux»·¾³ÏµÄÈí¼þ°²×°£¬²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊÂÇ飻Èç¹ûͨ¹ýÔ´´úÂë±àÒëºóÔÚ°²×°£¬µ±È»ÊÂÇé¾Í¸üΪ¸´ÔÓһЩ£»ÏÖÔÚ°²×°¸÷ÖÖÈí¼þµÄ½Ì³Ì¶¼·Ç³£Æձ飻µ«Íò±ä²»ÀëÆäÖУ¬¶Ô»ù´¡ÖªÊ¶µÄÔúʵÕÆÎÕ£¬°²×°¸÷ÖÖÈí¼þµÄÎÊÌâ¾ÍÓ­Èжø½âÁË¡£Configure½Å±¾ÅäÖù¤¾ß¾ÍÊÇ»ù´¡Ö®Ò»£¬ËüÊÇautoconfµÄ¹¤¾ßµÄ»ù±¾Ó¦Óá£
ÓëһЩ¼¼ÇÉÏà±È£¬ConfigureÏԵûù´ ......

linux tasklet 2

http://hi.baidu.com/j_fo/blog/item/7412bb018deab109728da572.html
LinuxÄÚºË irq/soft irq/tasklet/ͬ²½
2009-10-08 21:22
1.Öжϴ¦Àí³ÌÐò½áÊø֮ǰ£¬²»ÔÊÐí²úÉúÏàͬµÄÖжÏʼþ£»£¨½ûÓÃPICÉϸÃÖжϣ¬µ«¿ÉÒÔ²úÉúÆäËûÖжϣ©
2.Öжϴ¦Àí³ÌÐò¡¢ÈíÖжϡ¢tasklet¼È²»¿É±»ÇÀÕ¼Ò²²»Äܱ»×èÈû£¬×î¶à·¢ÉúÖжÏǶÌ×£»
3.Ö´ÐÐÖÐ¶Ï ......

linux 2.6 kernel epoll

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ