LinuxÍøÂç´úÂëµ¼¶Áv0.2
1 Ç°ÑÔ
Ðí¶àÈËÔÚ·ÖÎölinux´úÂëʱ¶ÔÍøÂ粿·Ö£¨Ö÷ÒªÊÇsrc/linux/net£¬src/linux/include/net¼°src/linux/include/linuxĿ¼ÏµÄÎļþ£©±È½Ï¸ÐÐËȤ£¬È·Êµ£¬¾¡¹ÜÒѾ´ÓÊé±¾ÉÏѧµ½ÁË´óÁ¿µÄTCP/IPÔÀí£¬²»¶ÁÔ´ÂëµÄ»°£¬Í·ÄÔÖл¹Êǽ¨Á¢²»Æð¾ßÌåµÄÓ¡Ï󡣶ø·ÖÎöÕⲿ·Ö´úÂëµÄÒ»¸öÎÊÌâ±ãÊÇ´úÂëÖÚ¶à¶ø×ÊÁϺÜÉÙ¡£ÕâƪÎÄÕµÄÄ¿µÄ¾ÍÊǹ´ÀÕ³öÒ»¸ö¿ò¼Ü£¬ÈöÁÕßÄܹ»´óÖÂÄܹ»Á˽âTCP/IP¾¿¾¹ÊÇÔõô¹¤×÷µÄ¡£ÒÔÇ°¼ûµ½µÄÐí¶à´úÂë·ÖÎö¶¼ÊÇ»ùÓÚ2.0Äں˵ģ¬ÔÚеÄÄÚºËÖÐÐí¶àº¯Êý±äÁËÃû×Ö£¬ÕâÓÈÆä¸ø³õѧÕß´øÀ´ÁËÀ§ÄÑ£¬±¾ÎÄÊÇÒÔ2.4.0-test9µÄ´úÂë×÷Àý×Ó£¬ÕâÑù¶ÔÕÕ´úÂëʱ¿ÉÄܸüÇåÎúЩ¡£
ÆäʵÍøÂ粿·ÖµÄ´úÂëÎÒÖ»¶Ô·À»ðǽ²¿·ÖÒ»ÐÐÐÐ×Ðϸ·ÖÎö¹ý£¬ÆäËûÐí¶àµØ·½Ò²Ö»ÊÇÒ»Öª°ë½â£¬Èç¹ûÀí½âÓÐÎ󣬻¶ÓÖ¸Õý¡£
½¨ÒéÔÚ¿´±¾ÎĵÄͬʱ£¬ÓÃsource insight(www.soucedyn.com)½¨Á¢Ò»¸öÏîÄ¿£¬Í¬Ê±¿´´úÂ룬ÕâÑù¿ÉÄÜЧ¹û¸üºÃµã¡£ÎÒÒ²ÓùýÆäËûµÄһЩ¹¤¾ß£¬µ«ÔÚ·ÖÎö´óÁ¿µÄ´úÂëµÄʱºò£¬Ã»ÓÐÒ»¸ö¹¤¾ß±ÈËü¸ü·½±ãµÄÁË¡£
2 ÕýÎÄ
ISOµÄÆß²ãÄ£ÐͶ¼·Ç³£ÊìϤÁË£¬µ±È»£¬¶ÔÓÚinternet,ÓÃËIJãÄ£Ð͸üΪÊʺϡ£ÔÚÕâÁ½·ÝÄ£ÐÍÀÍøÂçÐÒéÒÔ²ã´ÎµÄÐÎʽ³öÏÖ¡£¶øLINUXµÄÄں˴úÂëÖУ¬Ñϸñ·Ö³öÇå³þµÄ²ã´ÎÈ´±È½ÏÀ§ÄÑ£¬ÒòΪ³ýÁËһЩ"ÄÚºËÏß³Ì(kernel threadÍâ)"£¬Õû¸öÄÚºËÆäʵÊǸöµ¥Ò»µÄ½ø³Ì¡£Òò´ËËùν"ÍøÂç²ã",Ö»ÊÇÒ»×éÏà¹ØµÄº¯Êý£¬¶ø¸÷²ãÖ®¼ä´ó¶àͨ¹ýÒ»°ãµÄº¯Êýµ÷Óõķ½Ê½Íê³É½»»¥¡£
¶ø´ÓÂß¼ÉÏ£¬ÍøÂ粿·ÖµÄ´úÂë¸üÓ¦¸ÃÕâÑù·Ö²ã¸üΪºÏÀí£º
.BSD socket²ã£ºÕâÒ»²¿·Ö´¦ÀíBSD socketÏà¹Ø²Ù×÷£¬Ã¿¸ösocketÔÚÄÚºËÖÐÒÔstruct socket½á¹¹ÌåÏÖ¡£
ÕâÒ»²¿·ÖµÄÎļþÖ÷ÒªÓУº/net/socket.c /net/protocols.c etc
.INET socket²ã£ºBSD socketÊǸö¿ÉÒÔÓÃÓÚ¸÷ÖÖÍøÂçÐÒéµÄ½Ó¿Ú£¬¶øµ±ÓÃÓÚtcp/ip£¬¼´½¨Á¢ÁËAF_INETÐÎʽµÄsocketʱ£¬»¹ÐèÒª±£ÁôЩ¶îÍâµÄ²ÎÊý£¬ÓÚÊǾÍÓÐÁËstruct sock½á¹¹¡£
ÎļþÖ÷ÒªÓУº/net/ipv4/protocol.c /net/ipv4/af_inet.c /net/core/sock.c etc
.TCP/UDP²ã£º´¦Àí´«Êä²ãµÄ²Ù×÷£¬´«Êä²ãÓÃstruct inet_protocolºÍstruct protoÁ½¸ö½á¹¹±íʾ¡£
ÎļþÖ÷ÒªÓУº/net/ipv4/udp.c /net/ipv4/datagram.c /net/ipv4/tcp.c /net/ipv4/tcp_input.c
/net/ipv4//tcp_output.c /net/ipv4/tcp_minisocks.c /net/ipv4/tcp_output.c
/net/ipv4/tcp_timer.c etc
.IP²ã£º´¦ÀíÍøÂç²ãµÄ²Ù×÷£¬ÍøÂç²ãÓÃstruct packet_type½á¹¹±íʾ¡£
ÎļþÖ÷ÒªÓУº/net/ipv4/ip_forward.c ip_fragment.c ip_input.c ip_output.c etc.
.Êý¾ÝÁ´Â·²ãºÍÇý¶¯³ÌÐ
Ïà¹ØÎĵµ£º
±àÒë²¢°²×°Busybox 1.15.3µ½L inux2.6.11.1,Æô¶¯ÏµÍ³
½øÈëshell Ìáʾ: ./ash : can't access tty; job control turned off.
·ÖÎö·¢ÏÖ
/etc/inittabÎļþÖÐÓÐÒ»ÐÐ:
::askfirst:/bin/ash
ÕâÔÚbusybox 1.2.1ÔËÐÐÕý³£
ÐÞ¸ÄΪ
tty1::askfirst:/bin/ash
ºóÕý³£. ......
ɱËÀ½ø³Ì×ȫµÄ·½·¨Êǵ¥´¿Ê¹ÓÃkillÃüÁ²»¼ÓÐÞÊηû£¬²»´ø±êÖ¾¡£Ê×ÏÈʹÓÃps -efÃüÁîÈ·¶¨ÒªÉ±ËÀ½ø³ÌµÄPID£¬È»ºóÊäÈëÒÔÏÂÃüÁ
# kill pid
×¢ÊÍ£º±ê×¼µÄkillÃüÁîͨ³£¶¼ÄܴﵽĿµÄ£¬ÏÔʾZ״̬µÄ½ø³ÌÒѾËÀÍö¡£ÖÕÖ¹ÓÐÎÊÌâµÄ½ø³Ì£¬²¢°Ñ½ø³ÌµÄ×ÊÔ´ÊͷŸøϵͳ¡£È»¶ø£¬Èç¹û½ø³ÌÆô¶¯ÁË×Ó½ø³Ì£¬Ö ......
Linux·þÎñÆ÷ËäÈ»Ïà¶ÔÀ´Ëµ±ÈWindwos·þÎñÆ÷ÒªÎȶ¨Ó밲ȫ¡£µ«ÊÇÎȶ¨°²È«µÄLinux·þÎñÆ÷£¬ÈÔÈ»Àë²»¿ªºÏÀíµÄ¼°Ê±µÄά»¤¹¤×÷¡£
¡¡¡¡Ò»¡¢ÈÃÈí¼þ°ü±£³Ö×îеİ汾
¡¡¡¡Linux·þÎñÆ÷µÄÈí¼þ°üÒ²ÈçͬWindwos²Ù×÷ϵͳµÄ²¹¶¡Ò»ÑùÔÚ²»¶ÏµÄÉý¼¶¡£Linux·þÎñÆ÷Èí¼þµÄÉý¼¶Ö÷ÒªÓÐÁ½¸öÄ¿µÄ¡£Ò»ÊÇÔöÇ¿Èí¼þµÄ¹¦ÄÜ£¬¶þÊǽâ¾öһЩÒÑÖªµÄ°²È«Â©¶´¡£Èç ......
1.×î¼òµ¥µÄ°ì·¨ÐÞ¸Ä/etc/rc.d/rc.localÎļþ(Õâ¸ö·½·¨ÊÇÔÚ²»ÐèÒªloginµÄÇé¿öϾÍÄÜ×Ô¶¯ÔËÐеÄ)
2.»¹ÓÐÐ޸IJ»Í¬Óû§µÄÓû§Ä¿Â¼ÏµÄ.bashrcÎļþ¿ÉÒÔʵÏÖµ±¸ÃÓû§µÇ½µÄʱºò×Ô¶¯ÔËÐÐһЩ½Å±¾(¼ÇµÃ/etcÏÂÒ²ÓÐÒ»¸ö.bashrcÎļþ,Ð޸ĺó¿ÉÒÔÈÃÈκÎÓû§µÇ½¶¼×Ô¶¯Ö´ÐÐһЩ½Å±¾µÄ)
3.»¹ÓÐÒ»¸öºÜºÃµÄ·½·¨,×öÒ»¸öÊôÓÚ×Ô¼ºµÄrcÆô¶¯½Å± ......