¹ØÓÚLinux¾²Ì¬¿âºÍ¶¯Ì¬¿âµÄ·ÖÎö
²é¿´ÎÄÕÂ
¹ØÓÚLinux¾²Ì¬¿âºÍ¶¯Ì¬¿âµÄ·ÖÎö
2009-12-15 11:44
1.ʲôÊÇ¿â
ÔÚwindowsƽ̨ºÍlinuxƽ̨϶¼´óÁ¿´æÔÚ×Å¿â¡£
±¾ÖÊÉÏÀ´Ëµ¿âÊÇÒ»ÖÖ¿ÉÖ´ÐдúÂëµÄ¶þ½øÖÆÐÎʽ£¬¿ÉÒÔ±»²Ù×÷ϵͳÔØÈëÄÚ´æÖ´ÐС£
ÓÉÓÚwindowsºÍlinuxµÄ±¾Öʲ»Í¬£¬Òò´Ë¶þÕß¿âµÄ¶þ½øÖÆÊDz»¼æÈݵġ£
±¾ÎĽöÏÞÓÚ½éÉÜlinuxϵĿ⡣
2.¿âµÄÖÖÀà
linuxϵĿâÓÐÁ½ÖÖ£º¾²Ì¬¿âºÍ¹²Ïí¿â£¨¶¯Ì¬¿â£©¡£
¶þÕߵIJ»Í¬µãÔÚÓÚ´úÂë±»ÔØÈëµÄʱ¿Ì²»Í¬¡£
¾²Ì¬¿âµÄ´úÂëÔÚ±àÒë¹ý³ÌÖÐÒѾ±»ÔØÈë¿ÉÖ´ÐгÌÐò£¬Òò´ËÌå»ý½Ï´ó¡£
¹²Ïí¿âµÄ´úÂëÊÇÔÚ¿ÉÖ´ÐгÌÐòÔËÐÐʱ²ÅÔØÈëÄÚ´æµÄ£¬ÔÚ±àÒë¹ý³ÌÖнö¼òµ¥µÄÒýÓã¬Òò´Ë´úÂëÌå»ý½ÏС¡£
3.¿â´æÔÚµÄÒâÒå
¿âÊDZðÈËдºÃµÄÏÖÓеģ¬³ÉÊìµÄ£¬¿ÉÒÔ¸´ÓõĴúÂ룬Äã¿ÉÒÔʹÓõ«Òª¼ÇµÃ×ñÊØÐí¿ÉÐÒé¡£
ÏÖʵÖÐÿ¸ö³ÌÐò¶¼ÒªÒÀÀµºÜ¶à»ù´¡µÄµ×²ã¿â£¬²»¿ÉÄÜÿ¸öÈ˵ĴúÂ붼´ÓÁ㿪ʼ£¬Òò´Ë¿âµÄ´æÔÚÒâÒå·ÇͬѰ³£¡£
¹²Ïí¿âµÄºÃ´¦ÊÇ£¬²»Í¬µÄÓ¦ÓóÌÐòÈç¹ûµ÷ÓÃÏàͬµÄ¿â£¬ÄÇôÔÚÄÚ´æÀïÖ»ÐèÒªÓÐÒ»·Ý¸Ã¹²Ïí¿âµÄʵÀý¡£
4.¿âÎļþÊÇÈçºÎ²úÉúµÄÔÚlinuxÏÂ
¾²Ì¬¿âµÄºó׺ÊÇ.a£¬ËüµÄ²úÉú·ÖÁ½²½
Step 1.ÓÉÔ´Îļþ±àÒëÉú³ÉÒ»¶Ñ.o£¬Ã¿¸ö.oÀﶼ°üº¬Õâ¸ö±àÒëµ¥ÔªµÄ·ûºÅ±í
Step 2.arÃüÁºÜ¶à.oת»»³É.a£¬³ÉÎľ²Ì¬¿â
¶¯Ì¬¿âµÄºó׺ÊÇ.so£¬ËüÓÉgcc¼ÓÌض¨²ÎÊý±àÒë²úÉú¡£
ÀýÈç:
$ gcc -fPIC -c *.c $ gcc -shared -Wl,-soname, libfoo.so.1 -o libfoo.so.1.0 *.
5.¿âÎļþÊÇÈçºÎÃüÃûµÄ£¬ÓÐûÓÐʲô¹æ·¶
ÔÚlinuxÏ£¬¿âÎļþÒ»°ã·ÅÔÚ/usr/lib /libÏ£¬
¾²Ì¬¿âµÄÃû×ÖÒ»°ãΪlibxxxx.a£¬ÆäÖÐxxxxÊǸÃlibµÄÃû³Æ
¶¯Ì¬¿âµÄÃû×ÖÒ»°ãΪlibxxxx.so.major.minor£¬xxxxÊǸÃlibµÄÃû³Æ£¬majorÊÇÖ÷°æ±¾ºÅ£¬ minorÊǸ±°æ±¾ºÅ
6.ÈçºÎÖªµÀÒ»¸ö¿ÉÖ´ÐгÌÐòÒÀÀµÄÄЩ¿â
lddÃüÁî¿ÉÒԲ鿴һ¸ö¿ÉÖ´ÐгÌÐòÒÀÀµµÄ¹²Ïí¿â£¬
ÀýÈç# ldd /bin/lnlibc.so.6
=> /lib/libc.so.6 (0×40021000)/lib/ld-linux.so.2
=> /lib/ld- linux.so.2 (0×40000000)
¿ÉÒÔ¿´µ½lnÃüÁîÒÀÀµÓÚlibc¿âºÍld-linux¿â
7.¿ÉÖ´ÐгÌÐòÔÚÖ´ÐеÄʱºòÈçºÎ¶¨Î»¹²Ïí¿âÎļþ
µ±ÏµÍ³¼ÓÔØ¿ÉÖ´ÐдúÂëʱºò£¬Äܹ»ÖªµÀÆäËùÒÀÀµµÄ¿âµÄÃû×Ö£¬µ«ÊÇ»¹ÐèÒªÖªµÀ¾ø¶Ô·¾¶
´Ëʱ¾ÍÐèҪϵͳ¶¯Ì¬ÔØÈëÆ÷(dynamic linker/loader)
¶ÔÓÚelf¸ñʽµÄ¿ÉÖ´ÐгÌÐò£¬ÊÇÓÉld-linux.so*À´Íê³ÉµÄ£¬ËüÏȺóËÑË÷elfÎļþµÄ DT_RPATH¶Î—»·¾³±äÁ¿LD_LIBRARY_PATH—/etc/ld.so.cacheÎļþÁбí—/lib/,/usr/libĿ¼ÕÒµ½¿âÎļþºó½«ÆäÔØÈëÄÚ´æ
8.
Ïà¹ØÎĵµ£º
Óð²×°¹âÅÌÒýµ¼ÏµÍ³
--> ¼üÈëlinux rescue½øÈë¾ÈԮģʽ
--> skipýÌå¼ì²é,Ñ¡ÔñÓïÑÔ,¼üÅÌ,Ñ¡continue½øÈëconsole(ÃüÁîÐÐ)ģʽ
--> chroot /mnt/sysimage --> grub-install /dev/hda(Èç¹ûÓÃlilo,ÓÃÃüÁîlilo)
--> restart
ɾ³ýlinux·ÖÇøÈçºÎ»Ö¸´windows·ÖÇø
ÓÃwindowsÆô¶¯ÅÌÆô ......
µ÷ÊÔÓû§³ÌÐò£º
Ö÷»ú£ºlinux os
eclipse + cdt + gdb +gcc½»²æ±àÒëÁ´
Ä¿±ê»ú£ºarmlinux os
gdbServer
ͨѶ·½Ê½£ºtcp
Îļþ´«Ê䷽ʽ£ºftp, minicom, ͨ¹ýnfs.
ÅäÖòο¼ ......
1¡¢ÒýÑÔ
ÔÚlinuxϵͳÏ£¬Èç¹ûÄãÏÂÔز¢°²×°ÁËÓ¦ÓóÌÐò£¬ºÜÓпÉÄÜÔÚ¼üÈëËüµÄÃû³Æʱ³öÏÖ“command not
found”µÄÌáʾÄÚÈÝ¡£Èç¹ûÿ´Î¶¼µ½°²×°Ä¿±êÎļþ¼ÐÄÚ£¬ÕÒµ½¿ÉÖ´ÐÐÎļþÀ´½øÐвÙ×÷¾ÍÌ«·±ËöÁË¡£ÕâÉæ¼°µ½»·¾³±äÁ¿PATHµÄÉèÖÃÎÊÌ⣬¶øPATHµÄÉèÖÃÒ²
ÊÇÔÚlinux϶¨ÖÆ»·¾³±äÁ¿µÄÒ»¸ö×é³É²¿·Ö¡£±¾Î ......
¹¦ÄÜ˵Ã÷£º±È½ÏÎļþµÄ²îÒì¡£
Óï¡¡¡¡·¨£ºdiff [-abBcdefHilnNpPqrstTuvwy][-<ÐÐÊý>][-C <ÐÐÊý>][-D <¾Þ¼¯Ãû³Æ>][-I <×Ö·û»ò×Ö·û´®>][-S <Îļþ>][-W <¿í¶È>][-x <Îļþ»òĿ¼>][-X <Îļþ>][--help][--left-column][--suppress-common-line][Îļþ»òĿ¼1][Îļþ»òĿ¼2]
²¹³ä ......
netcat
¾ÍÏñ cat
Ö¸ÁîÒ»樣£¬Ö»ÊÇ將簡單µÄ
cat
¹¦ÄÜÍêÈ«¡¸網·»¯¡¹£¬ºÃÓÃ與靈»îµÄ³Ì¶È¿É說ÊǺÜ驚ÈË£¬¶øÔÚ
Top 100 Network Security Tools
ÅÅÐаñÖÐ還ÅÅÐеÚËÄÃûÄØ£¡
netcat ³ýÁË ......