´ÓºÎ´¦¿ªÊ¼ÔĶÁLinuxÔ´´úÂë(ת)
ÏñLinuxÄÚºËÕâÑùÅÓ´ó¶ø¸´ÔӵijÌÐò¿´ÆðÀ´È·ÊµÈÃÈËÍû¶øÉú磬ËüÏóÒ»¸öºÜ´óµÄÇò£¬Ã»ÓÐÆðµãºÍÖյ㡣ÔÚ¶ÁÔ´´úÂëµÄ¹ý³ÌÖУ¬Äã»áÓöµ½ÕâÑùµÄÇé¿ö£¬µ±¶Áµ½Äں˵Äijһ²¿·ÖʱÓÖ»áÉæ¼°µ½ÆäËü¸ü¶àµÄÎļþ£¬µ±·µ»Øµ½ÔÀ´µÄµØ·½Ïë¼ÌÐøÍù϶Áʱ£¬ÓÖÍüÁËÔÀ´¶ÁµÄÄÚÈÝ¡£ÔÚinternetÉÏ£¬ºÜ¶àÈËΪ´Ë¸¶³öÁ˺ܴóµÄŬÁ¦£¬ÖÆ×÷³öÁËÔ´´úÂëµ¼º½Æ÷£¬ÕâΪԴ´úÂëÔĶÁÌṩÁËÁ¼ºÃµÄÌõ¼þ£¬Õ¾µãΪ£ºhttp://lxr.linux.no/source£¬ÏÂÃæ¸ø³öÔĶÁÔ´´úÂëµÄһЩÏßË÷¡£
1. ϵͳµÄÆô¶¯ºÍ³õʼ»¯
ÔÚ»ùÓÚIntelµÄϵͳÉÏ£¬µ± loadlin.exe »ò LILO°ÑÄÚºË×°Èëµ½ÄÚ´æ²¢°Ñ¿ØÖÆȨ´«µÝ¸øÄÚºËʱ£¬Äں˿ªÊ¼Æô¶¯¡£¹ØÓÚÕâÒ»²¿·Ö£¬¿´arch/i386/kernel/head.S £¬head.S½øÐÐÌض¨½á¹¹µÄÉèÖã¬È»ºóÌøתµ½init/main.cµÄmain()Àý³Ì¡£
2. ÄÚ´æ¹ÜÀí
ÄÚ´æ¹ÜÀíµÄ´úÂëÖ÷ÒªÔÚ/mm£¬µ«Ìض¨½á¹¹µÄ´úÂëÔÚarch/*/mm¡£È±Ò³Öжϴ¦ÀíµÄ´úÂëÔÚmm/memory.c £¬¶øÄÚ´æÓ³ÉäºÍÒ³¸ßËÙ»º´æÆ÷µÄ´úÂëÔÚmm/filemap.c¡£»º³åÆ÷¸ßËÙ»º´æÊÇÔÚmm/buffer.c ÖÐʵÏÖ£¬¶ø½»»»¸ßËÙ»º´æÊÇÔÚmm/swap_state.c ºÍ mm/swapfile.cÖÐʵÏÖ¡£
3. ÄÚºË
ÄÚºËÖУ¬Ìض¨½á¹¹µÄ´úÂëÔÚarch/*/kernel£¬µ÷¶È³ÌÐòÔÚkernel/sched.c£¬forkµÄ´úÂëÔÚkernel/fork.c£¬task_struct Êý¾Ý½á¹¹ÔÚ include/linux/sched.hÖС£
4. PCI
PCI αÇý¶¯³ÌÐòÔÚ drivers/pci/pci.c £¬Æ䶨ÒåÔÚinclude/linux/pci.h¡£Ã¿Ò»Öֽṹ¶¼ÓÐһЩÌض¨µÄ PCI BIOS ´úÂ룬 IntelµÄÔÚarch/alpha/kernel/bios32.c¡£
5. ½ø³Ì¼äͨÐÅ
ËùÓÐSystem V IPC ¶ÔÏóȨÏÞ¶¼°üº¬ÔÚ ipc_perm Êý¾Ý½á¹¹ÖУ¬Õâ¿ÉÒÔÔÚ include/linux/ipc.hÖÐÕÒµ½¡£ System V ÏûÏ¢ÊÇÔÚ ipc/msg.cÖÐʵÏÖ, ¹²ÏíÄÚ´æÔÚ ipc/shm.cÖУ¬ÐźÅÁ¿ÔÚ ipc/sem.cÖУ¬¹ÜµÀÔÚ ipc/pipe.cÖÐʵÏÖ¡£
6. Öжϴ¦Àí
Äں˵ÄÖжϴ¦Àí´úÂëÊǼ¸ºõËùÓеÄ΢´¦ÀíÆ÷ËùÌØÓеġ£Öжϴ¦Àí´úÂëÔÚ arch/i386/kernel/irq.cÖУ¬Æ䶨Òå×ÓÔÚ include/asm-i386/irq.hÖС£
7. É豸Çý¶¯³ÌÐò
LinuxÄÚºËÔ´´úÂëµÄºÜ¶àÐÐÊÇÉ豸Çý¶¯³ÌÐò¡£LinuxÉ豸Çý¶¯³ÌÐòµÄËùÓÐÔ´´úÂ붼±£´æÔÚ/driver£¬¸ù¾ÝÀàÐͿɽøÒ»²½»®·ÖΪ£º
/block
¿éÉ豸Çý¶¯³ÌÐòÈçide(ÔÚide.c)¡£Èç¹ûÄãÏë¿´°üº¬ÎļþϵÍ
Ïà¹ØÎĵµ£º
ϵͳ±ÀÀ£ÁËÒ»´Î£¬ºÜ¶àÎļþ¶¼¶ªÁË£¬ÐҺöªµÄÎļþ²»ÊǺÜÖØÒª¡£µÃÁËÕâ´Î½Ìѵ£¬ÒÔºóÒ»¶¨ÒªÇÚд²©¿Í£¬ÎÞÂÛ¶«Î÷¶àô¼¦Ã«ËâƤ£¬Ò»µ©ÄãÓùýÁËÈ»ºóÍü¼ÇÁËÈ»ºóijһÌìÓÖÐèÒªÓõÄʱºò£¬ÏëÆðÀ´×Ô¼ºÔø¾»á¹ý¶øÏÖÔÚºÍÐÂÊÖÎÞÒ죬ÄÇÖÖÐÄÇé±ðÌáÓжàÓôÃÆÁË¡£
Õýʽתµ½linuxÓÐÁ½¸ö¶àÔÂÁË£¬ÓÃlinuxµÄÔÒò³ýÁËÃâ·ÑÒÔÍ⣬×îÖØÒªµÄ¾ÍÊÇlinuxÖÐÓÐÌ«¶ ......
£±¡¢²é¿´IP¡¡¡¡Ifconfig
¡¡¡¡£²¡¢ÅäÖÃIPµÄ·½·¨£º
¡¡¡¡A¡¢ ÕâÖÖ·½·¨Á¢¼´ÉúЧ¡¡µ«ÊÇÖØÆô½«²»»á±£´æ¡££¨³ýÁËÕâ¸ö·½·¨µÄÆäËü·½·¨¶¼¿ÉÒÔ±£´æÏÂÀ´£©
¡¡¡¡Ifconfig eth£° 1.1.1.1 netmask 255.0.0.0 up
¡¡¡¡Ifconfig eth0:1 1.1.1.3 up¡¡¡¡ÉèÖÃÒ»¸öÍø¿¨¶à¸öIPµÄ·½·¨£¨ÔÚÉèÖÃÐéÄâÖ÷»úʱÓÐ ......
Ç°ÑÔ:
ÕâÊÇһƪºÜ³õ¼¶µ«ÊÇÒ²±È½Ï¼òµ¥ÈÝÒ×ѧϰLinuxĿ¼ȨÏÞÉèÖõÄÎÄÕÂ,֮ǰÎÒʹÓÃWindows Serverϵͳ,ÓÃͼÐνçÃæ¹ÜÀíÎļþµÄ·ÃÎÊȨÏÞ.ºóÀ´ÔÚѧϰGUN/Linux ServerµÄʱºò·¢ÏÖGUN/LinuxµÄȨÏÞ¹ÜÀíÉèÖ÷dz£Ç¿´ó,Ò²·Ç³£·½±ã.µ«ÊÇÎÒ·¢ÏÖÔÚÍø·ÉÏûÓÐһƪÎÄÕÂÊÇÍêÕûÐðÊö+ÈöÁÕߺÜÈÝÒ×Àí½âµÄ,ÓÚÊÇÎÒдÁËÕâƪ¼òµ¥Ò׶®µÄL ......
ת×Ôhttp://blog.163.com/ericxia_gnikam/blog/static/969208792008102545614453/
ÔÚLinux kernelµÄÔ´´úÂëÖУ¬¾³£Äܼûµ½if(likely(x))»òif(unlikely(x))Ö®ÀàµÄÓ÷¨£¬ÆäÈ·Çк¬ÒåÐèҪ˵Ã÷һϣ¬ÒÔ±ã¸üºÃµÄÀí½âkernelµÄÔ´´úÂë¡£
likelyÓëunlikelyÕâÁ½¸öºêÔÚlinux/compiler.hÖеĶ¨ÒåÈçÏ£º
#define likely ......
»ùÓÚI/O RegionµÄ²Ù×÷º¯Êý__XXX_region()£¬LinuxÔÚÍ·Îļþinclude/linux/ioport.hÖж¨ÒåÁËÈý¸ö¶ÔI/OÄÚ´æ×ÊÔ´½øÐвÙ×÷µÄºê£º
¡¡¡¡¢Ùrequest_mem_region()ºê£¬ÇëÇó·ÖÅäÖ¸¶¨µÄI/OÄÚ´æ×ÊÔ´¡£
¡¡¡¡¢Úcheck_ mem_region()ºê£¬¼ì²éÖ¸¶¨µÄI/OÄÚ´æ×ÊÔ´ÊÇ·ñÒѱ»Õ¼Óá£
¡¡¡¡¢Ûrelease_ mem_region()ºê£¬ÊÍ·ÅÖ¸¶¨µÄI/OÄÚ´æ×ÊÔ ......