LinuxÏÂÍê³ÉµÄÒ»¸ö×÷Òµ³ÌÐò
Îĵµ´´½¨ÈÕÆÚ£º2010-02-19
01 // P174: 2.±à³ÌÌâ (13)²»ÀûÓÃstrcmpº¯Êý£¬×Ô¼º±à³ÌʵÏÖÁ½¸öÈÎÒâ×Ö·û´®µÄ±È½Ï¡£
02
03 // The beginning of C program: test06-13.c.
04
05 // Header files included.
06 #include <stdio.h>
07
08 // Macro definition.
09 #define MAX_SIZE 100
10
11 // No.1: Subroutine: int getstr ( char ch[], int size );
12 int getstr ( char ch[], int size )
13 {
14 int i=0;
15 if ( size >= MAX_SIZE )
16 {
17 printf ( "Input error, data will overflow!\n" );
18 return (0);
19 }
20 do
21 {
22 ch[i] = getchar();
23 i++;
24 } while ( ch[i-1] != '\n' );
25 ch[i-1] = '\0';
26 // ·µ»Ø0±íʾµ÷Óøú¯ÊýÀ´»ñÈ¡×Ö·û´®Ê±»ñÈ¡Ê
Ïà¹ØÎĵµ£º
LinuxÊÇÒ»ÖÖÀàUnixµÄ²Ù×÷ϵͳ¡£´ÓÀíÂÛÉϽ²£¬Unix±¾ÉíµÄÉè¼Æ²¢Ã»ÓÐÊ²Ã´ÖØ´óµÄ°²È«È±ÏÝ¡£¶àÄêÀ´£¬¾ø´ó¶àÊýÔÚUnix²Ù×÷ϵͳÉÏ·¢ÏֵݲȫÎÊÌâÖ÷Òª´æÔÚÓÚ¸ö±ð³ÌÐòÖУ¬ËùÒԴ󲿷ÖUnix³§É̶¼Éù³ÆÓÐÄÜÁ¦½â¾öÕâЩÎÊÌ⣬Ìṩ°²È«µÄUnix²Ù×÷ϵͳ¡£µ«LinuxÓÐЩ²»Í¬£¬ÒòΪËü²»ÊôÓÚijһ¼Ò³§ÉÌ£¬Ã»Óг§ÉÌÐû³Æ¶ÔËüÌṩ°²È«±£Ö¤£ ......
Ò»¡¢»¨Éú¿ÇFor Linux°²×°²½Öè
¡¡¡¡ÏÂÔØÊʺÏÄúµÄunix/linux°æ±¾µÄ°²×°°üÎļþ,ʹÓÃrootÉí·Ý½âѹËõ°²×°°ü
¡¡¡¡# tar -zvxf phlinux-1.0-install.redhat.9.0.tar.gz
¡¡¡¡°²×°°üÎļþ½«½âѹËõÖÁphlinux_installĿ¼ÖÐ
¡¡¡¡# cd phlinux_install
¡¡¡¡Ö´Ðа²×°½Å±¾
¡¡¡¡# ./install.sh
¡¡¡¡Ö´Ðа²×°½Å±¾ºó,½«×Ô¶¯ÒÔ»¥¶¯ÅäÖÃÄ ......
Internet------(eth1)router1(eth2)------(eth1)router2(eth0)------(eth0)router3(eth1)------(eth0)pc
ÉÏÃæ¾ÍÊÇÎÒµÄÍøÂçÍØÆË½á¹¹£¬ÆäÖзÓÉÆ÷1ÊÇÓÃÀ´Á¬½ÓÍâ²¿ÍøÂçµÄһ̨linux»úÆ÷£¬Í¼ÖÐËùÓзÓÉÆ÷¶¼ÊÇÆÕͨµÄpc»ú£¬ÕâЩpc¶¼°²×°ÁËubuntu×ÀÃæÏµÍ³£¬³ýÁË×îÓұߵÄpc£¬ÆäÓàµÄpc¶¼×°ÁË3ÕÅÍø¿¨£¨ÆäÖÐÒ»Õű¸Óã©¡£
ÓÉÓÚDebianϵ ......
¿ªÊ¼ÔÚlinuxÏÂ×öcÓïÑÔ¿ª·¢
±¾ÆªÎÄÕÂÖ¼ÔÚ½éÉÜÈçºÎ¿ªÊ¼ÔÚlinuxÏÂÃæ½øÐÐCÓïÑÔ³ÌÐòÉè¼Æ£¬ÒÔ¼°ÈçºÎʹÓóÌÐòÉè¼Æ¼°µ÷ÊÔ¹¤¾ß½øÐбàдC³ÌÐò¡£Ñ§»áʹÓÃgcc¼°gdbµÈ¹¤¾ß½øÐÐlinuxϵÄc±àдºÍµ÷ÊÔ¡£
ÔÚ¿ªÊ¼Ö®Ç°£¬Ê×ÏÈҪ˵Ã÷µÄÊÇ£¬linux¿ª·¢³ÌÐò×îÖ÷ÒªµÄ±à¼Æ÷ÊÇvi/vim±à¼Æ÷£¬µ±È»»¹ÓÐemacs,gedit£¬Ö»ÊÇvi/vimµÄÓû§ÊµÔÚÊÇѹµ¹ÐԵĶàÊ ......
ÔÚÖ´ÐÐmake menuconfig ÃüÁî½øÐÐÄÚºËÅäÖÃʱ£¬Êä³öÏÂÃæµÄ³ö´íÐÅÏ¢£º
yyh:~/clfs/sources/linux-2.6.17.13$ make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- menuconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
HOSTCC scripts/kconfig/conf.o
HOSTCC scri ......