Ubuntu Linux gcc °²×° ʹÓ÷½·¨
×¼±¸¹¤×÷
Èç¹ûÄ㻹ûװ±àÒë»·¾³»ò×Ô¼º²»È·¶¨×°Ã»×°£¬²»·ÁÏÈÖ´ÐÐ
sudo apt-get install build-essential
Èç¹ûÄãÐèÒª±àÒë Fortran ³ÌÐò£¬ÄÇô»¹ÐèÒª°²×° gfortran(»ò g77)
sudo apt-get install gfortran
Èç¹ûÄãÒѾÁ˽âһЩ vim
µÄ֪ʶ£¬¶øÇÒÏëÓÃËüÀ´±à¼Ô´´úÂ룬ÄÇôÎÒÃDz»·Á×°¸öÍêÕû°æ
sudo apt-get install vim-full
Èç¹ûÄã²»Á˽âvim£¬Ñ¡Ôñgedit¡¢kate»òmousepadÀ´±à¼Ô´´úÂë¾ÍºÃÁË
×¢Ò⣺
±¾ÎÄ¿ÉÄÜ»áÈÃÄãʧÍû£¬Èç¹ûÄã¿´ÍêºóÓÐÏÂÁÐÒÉÎʵĻ°£ºÎªÊ²Ã´ÒªÔÚÖÕ¶ËÊäÃüÁî°¡£¿ GCC
ÊÇʲô¶«Î÷£¬ÔõôÔڲ˵¥ÖÐÕÒ²»µ½£¿ GCC ²»ÄÜÓÐÏñ VC ÄÇÑùµÄ´°¿ÚÂ𣿅… ÄÇôÄãÕæÕýÏëÒªÁ˽âµÄ¿ÉÄÜÊÇ
anjuta£¬kdevelop£¬geany£¬code blocks£¬eclipse£¬neatbean µÈ IDE ¼¯³É¿ª·¢»·¾³
¡£¼´Ê¹ÔÚÕâÖÖÇé¿öÏ£¬ÓÉÓÚ GCC ÊÇÒÔÉÏ IDE µÄºǫ́µÄ±àÒëÆ÷£¬±¾ÎÄÈÔÖµµÃÄãÉÔ×÷Á˽⡣
[±à¼
]
±àÒë¼òµ¥µÄ C ³ÌÐò
C ÓïÑÔ¾µäµÄÈëÃÅÀý×ÓÊÇ Hello World
£¬ÏÂÃæÊÇһʾÀý´úÂ룺
#include <stdio.h>
int
main
(
void
)
{
printf
(
"Hello, world!
\n
"
);
return
0
;
}
ÎÒÃǼٶ¨¸Ã´úÂë´æΪÎļþ‘hello.c’¡£ÒªÓà gcc
±àÒë¸ÃÎļþ£¬Ê¹ÓÃÏÂÃæµÄÃüÁ
$ gcc -Wall hello.c -o hello
¸ÃÃüÁÎļþ‘hello.c’ÖеĴúÂë±àÒëΪ»úÆ÷Âë²¢´æ´¢ÔÚ¿ÉÖ´ÐÐÎļþ ‘hello’ÖС£»úÆ÷ÂëµÄÎļþÃûÊÇͨ¹ý -o
Ñ¡ÏîÖ¸¶¨µÄ¡£¸ÃÑ¡Ïîͨ³£×÷ΪÃüÁîÐÐÖеÄ×îááÒ»¸ö²ÎÊý¡£Èç¹û±»Ê¡ÂÔ£¬Êä³öÎļþĬÈÏΪ ‘a.out’¡£
×¢Òâµ½
Èç¹ûµ±Ç°Ä¿Â¼ÖÐÓë¿ÉÖ´ÐÐÎļþÖØÃûµÄÎļþÒѾ´æÔÚ£¬Ëü½«±»¸´¸Ç¡£
Ñ¡Ïî -Wall
¿ªÆô±àÒëÆ÷¼¸ºõËùÓг£Óõľ¯¸æ©¤©¤Ç¿ÁÒ½¨ÒéÄãʼÖÕʹÓøÃÑ¡Ïî
¡£±àÒëÆ÷ÓкܶàÆäËûµÄ¾¯¸æÑ¡Ïµ« -Wall
ÊÇ×î³£Óõġ£Ä¬ÈÏÇé¿öÏÂGCC ²»»á²úÉúÈκξ¯¸æÐÅÏ¢¡£µ±±àд C »ò C++ ³ÌÐòʱ±àÒëÆ÷¾¯¸æ·Ç³£ÓÐÖúÓÚ¼ì²â³ÌÐò´æÔÚµÄÎÊÌâ¡£
±¾ÀýÖУ¬±àÒëÆ÷ʹÓÃÁË -Wall
Ñ¡Ïî¶øû²úÉúÈκξ¯¸æ£¬ÒòΪʾÀý³ÌÐòÊÇÍêÈ«ºÏ·¨µÄ¡£
ÒªÔËÐиóÌÐò£¬ÊäÈë¿ÉÖ´ÐÐÎļþµÄ·¾¶ÈçÏ£º
$ ./hello
Hello, world!
Õ⽫¿ÉÖ´ÐÐÎļþÔØÈëÄڴ棬²¢Ê¹ CPU ¿ªÊ¼Ö´ÐÐÆä°üº¬µÄÖ¸Áî¡£ ·¾¶ ./
Ö¸´úµ±Ç°Ä¿Â¼£¬Òò´Ë ./hello
ÔØÈë²¢Ö´Ðе±Ç°Ä¿Â¼ÏµĿÉÖ´ÐÐÎļþ ‘hello’¡£
µã»÷´Ë´¦
ÏÂÔر¾½ÚµÄ²Ù×÷ÊÓƵ
[±à¼
]
²¶×½´íÎó
ÈçÉÏËùÊö£¬µ±Óà C »ò C++ ±à³Ìʱ£¬±àÒëÆ÷¾¯¸æÊǷdz£ÖØÒªµÄÖúÊÖ¡£ÎªÁË˵Ã÷ÕâÒ»µã£¬ÏÂÃæµÄÀý×
Ïà¹ØÎĵµ£º
Ò»¡¢¶¨Ò壺ʲôÊǹ¶ù½ø³ÌºÍ½©Ê¬½ø³Ì
½©Ê¬½ø³Ì£ºÒ»¸ö×Ó½ø³ÌÔÚÆ丸½ø³Ì»¹Ã»Óе÷ÓÃwait()»òwaitpid()µÄÇé¿öÏÂÍ˳ö¡£Õâ¸ö×Ó½ø³Ì¾ÍÊǽ©Ê¬½ø³Ì¡£
¹Â¶ù½ø³Ì£ºÒ»¸ö¸¸½ø³ÌÍ˳ö£¬¶øËüµÄÒ»¸ö»ò¶à¸ö×Ó½ø³Ì»¹ÔÚÔËÐУ¬ÄÇôÄÇЩ×Ó½ø³Ì½«³ÉΪ¹Â¶ù½ø³Ì¡£¹Â¶ù½ø³Ì½«±»init½ø³Ì(½ø³ÌºÅΪ1)ËùÊÕÑø£¬²¢ÓÉinit½ø³Ì¶Ô ......
INTRO
¾¡¹ÜLinuxµÄ¸ùÎļþϵͳÔÚÐÎʽ±íÏÖÉÏÊÇÒ»ÌåµÄ£¨ËùÓÐÊý¾ÝĿ¼¾ùΪ¸ùĿ¼ÏµÄ×ÓĿ¼£©£¬µ«Êµ¼ÊËüÃÇÊǶà¸ö²»Í¬µÄ¡¾Âß¼Ö÷Ìå¡¿£¨ÎªÁËʵÏÖ²»Í¬µÄÂß¼¹¦ÄÜ£©×éºÏÔÚÒ»ÆðµÄ£¬²Î¼ûÏÂͼ¡£ÕâÒ²½âÊÍÁËΪʲôÓÐЩ½Úµã£¨Èç/var£©¿ÉÒÔ¹Ò½Óµ½²»Í¬´ÅÅÌ·ÖÇøÉÏ¡£»®·ÖÕâЩÂß¼²¿·Ö¶ÔÇåÎú°ÑÎÕ¸ùÎļþϵͳ½á¹¹£¬ÒÔ¼°Õû¸öϵͳµÄÐÐΪ¶¼Óкܴó ......
Ò»¡¢ÌáÇ°µÄ»°
¡¡¡¡ÒªËµCÓïÑÔºÍLinuxµÄ¹Øϵ´ó¼ÒÓ¦¸Ã¶¼²»»áÄ°Éú£¬LinuxϵͳÄں˾ÍÊÇÓÃCÓïÑÔ¿ª·¢µÄ£¬ËùÒÔËùÓеÄLinuxϵͳÏÂÃæ ¶¼»áÓÐCµÄ±àÒëµ÷ÊÔ¹¤¾ß£¬²»¹ýÕâЩ¹¤¾ß¶¼ÊÇÃüÁîʽµÄ£¬Õýʽ¿ª·¢µÄ»°»áºÜ²»·½±ã¡£FedoraÔÚ°²×°µÄʱºò¿ÉÒÔÑ¡Ôñ°²×°Fedora Eclipse£¬Õâ¸öIDEºÜÇ¿´ó£¬C£¬C++£¬Java£¬PythonµÈµÈ¶¼Ö§³Ö£¬¶øÇÒ±àÒ룬µ÷ÊÔºÍ ......
linuxϵͳÎļþ½éÉÜ
Îļþϵͳ·ÖΪÐí¶à²¿·Ö£¬Í¨³£´Ó¸ùÎļþϵͳÓУº /bin , /lib , /etc , /dev ,
¼°Ò»Ð©ÆäËû£» /usr Îļþϵͳ°üº¬³ÌÐòºÍ²»¸Ä±äµÄÊý¾Ý£» /var Îļþϵͳ°üº¬¸Ä±äµÄÊý¾Ý(ÀýÈçlogÎļþ)£» /home
Îļþϵͳ°üº¬Ã¿¸öÓû§µÄ¸öÈËÎļþ¡£
ÿ̨»úÆ÷¶¼ÓиùÎļþϵͳ/
(Ò»°ãÔÚ±¾µØÅÌÖУ¬µ±È»Ò²¿ÉÒÔÔ ......
×÷Õߣº²ÜÖÒÃ÷,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
PCIÊÇÍâΧÉ豸»¥ÁªµÄ¼ò³Æ(Peripheral Component Interconnect)µÄ¼ò³Æ£¬×÷ΪһÖÖͨÓõÄ×ÜÏß½Ó¿Ú±ê×¼£¬ËûÔÚ¼ÆËã»úϵͳÖеõ½Á˹㷺µÄʹÓá£PCIµÄËÙ¶ÈÄܹ»´ïµ½132M/s¡£ÔÚÕâÀï¼òµ¥µÄ½éÉÜһϠlinux ÏÂPCIÇý¶¯µÄʵÏÖ¡£
ÔÚ±àдһ¸öPCIÇý¶¯µÄʱºòÎÒÃÇÏȵÃÈ·¶¨ÏµÍ³ÖÐÊÇ·ñÓÐÎÒÃǵÄÉ豸¡£Î ......