ʹÓÃkgdbµ÷ÊÔlinuxÄں˼°ÄÚºËÄ£¿é
http://www.xfocus.net/articles/200509/820.html
´´½¨Ê±¼ä£º2005-09-09
ÎÄÕÂÊôÐÔ£ºÔ´´
ÎÄÕÂÌá½»£ºxcspy
(xcspy.com_at_gmail.com)
×÷Õߣºxcspy³ÉÔ± ladybug
E-mail£ºxcspy.com@gmail.com
Ö÷Ò³£ºwww.xcspy.com
1. ¼¸ÖÖÄں˵÷ÊÔ¹¤¾ß±È½Ï
kdb£ºÖ»ÄÜÔÚ»ã±à´úÂ뼶½øÐе÷ÊÔ£»
ÓŵãÊDz»ÐèÒªÁ½Ì¨»úÆ÷½øÐе÷ÊÔ¡£
gdb£ºÔÚµ÷ÊÔÄ£¿éʱȱÉÙһЩÖÁ¹ØÖØÒªµÄ¹¦ÄÜ£¬Ëü¿ÉÓÃÀ´²é¿´Äں˵ÄÔËÐÐÇé¿ö£¬°üÀ¨·´»ã±àÄں˺¯Êý¡£
kgdb£ºÄܷܺ½±ãµÄÔÚÔ´Â뼶¶ÔÄں˽øÐе÷ÊÔ£¬È±µãÊÇkgdbÖ»ÄܽøÐÐÔ¶³Ìµ÷ÊÔ£¬ËüÐèÒªÒ»¸ù´®¿ÚÏß¼°Á½Ì¨»úÆ÷À´µ÷ÊÔÄÚºË(Ò²¿ÉÒÔÊÇÔÚͬһ̨Ö÷»úÉÏÓÃvmwareÈí¼þÔËÐÐÁ½¸ö²Ù×÷ϵͳÀ´µ÷ÊÔ)
ʹÓÃkdbºÍgdbµ÷ÊÔÄں˵ķ½·¨Ïà¶Ô±È½Ï¼òµ¥£¬ÕâÀïÖ»ÃèÊöÈçºÎʹÓÃkgdbÀ´µ÷ÊÔÄںˡ£
2.ÈíÓ²¼þ×¼±¸
»·¾³£º
һ̨¿ª·¢»údeveloper(192.168.16.5 com1)£¬Ò»Ì¨²âÊÔ»útarget(192.168.16.30 com2)£¬¶¼Ô¤×°redhat 9£»Ò»¸ù´®¿ÚÏß
ÏÂÔØÒÔÏÂÈí¼þ°ü£º
linuxÄÚºË2.4.23 linux-2.4.23.tar.bz2
kgdbÄں˲¹¶¡1.9°æ linux-2.4.23-kgdb-1.9.patch
¿Éµ÷ÊÔÄÚºËÄ£¿éµÄgdb gdbmod-1.9.bz2
3.ok,¿ªÊ¼
3.1 ²âÊÔ´®¿ÚÏß
ÎïÀíÁ¬½ÓºÃ´®¿ÚÏߺó£¬Ê¹ÓÃÒ»ÏÂÃüÁî½øÐвâÊÔ£¬stty¿ÉÒÔ¶Ô´®¿Ú²ÎÊý½øÐÐÉèÖÃ
ÔÚdeveloperÉÏÖ´ÐУº
stty ispeed 115200 ospeed 115200 -F /dev/ttyS0
echo hello > /dev/ttyS0
ÔÚtargetÉÏÖ´ÐУº
stty ispeed 115200 ospeed 115200 -F /dev/ttyS1
cat /dev/ttyS1
´®¿ÚÏßûÎÊÌâµÄ»°ÔÚtargetµÄÆÁÄ»ÉÏÏÔʾhello
3.2 °²×°ÓëÅäÖÃ
3.2.1 °²×°
ÏÂÔØlinux-2.4.23.tar.bz2£¬linux-2.4.23-kgdb-1.9.patch£¬gdbmod-1.9.bz2µ½developerµÄ/home/liangjianĿ¼
*ÔÚdeveloper»úÆ÷ÉÏ
#cd /home/liangjian
#bunzip2 linux-2.4.23.tar.bz2
#tar -xvf linux-2.4.23.tar
#bunzip2 gdbmod-1.9.bz2
#cp gdbmod-1.9 /usr/local/bin
#cd linux-2.4.23
#patch -p1 < ../linux-2.4.23-kgdb-1.9.patch
#make menuconfig
ÔÚKernel hackingÅäÖÃÏîÖн«ÒÔÏÂÈýÏî±àÒë½øÄÚºË
KGDB: Remote (serial) kernel debugging with gdb
KGDB: Thread analysis
KGDB: Console messages through gdb
×¢ÒâÔÚ±àÒëÄں˵ÄʱºòÐèÒª¼ÓÉÏ-gÑ¡Ïî
#make dep;make bzImage
ʹÓÃscp½øÐн«Ïà¹ØÎļþ¿½±´µ½targetÉÏ(µ±È»Ò²¿ÉÒÔʹÓÃÆäËüµÄÍøÂ繤¾ß)
#sc
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
ÊäÈëftp ----> open ip adress ----> user & password ----> ²Ù×÷ÃüÁ £¨Á¬½Óµ½ftpÉÏÖ®ºó£¬»áÔÚ±¾µØ×Ô¶¯ÏÂÔØÒ»¸öÁÙʱĿ¼Îļþ£¬ÔÚÕâÀï¿ÉÒÔ´ò¿ª¡¢²é¿´ftpÉϵÄÎļþ£©
FTP> ! ´Ó ftp ×ÓϵͳÍ˳öµ½Íâ¿Ç¡£
FTP> ? ÏÔʾ ftp ÃüÁî˵Ã÷¡£? Óë help Ïàͬ¡£
¸ñʽ£º? [command]
˵Ã÷£º[command]Ö¸¶¨ÐèÒª°ïÖ ......
Top five things Linux can learn from Microsoft
Jul. 20, 2006
Linux does a lot of things right -- open-source
,
security, reliability -- but it's far from perfect. In fact, Linux and
its vendors could stand to l ......
nc ÊÇÒ»°ÑÍøÂçµÄÈðÊ¿¾üµ¶£¬ÎÒÒÔÇ°ÔÚ½éÉÜ DuplexPipe ʱҲÌáµ½¹ý£¬Èç¹ûÄãû½Ó´¥¹ýËü£¬¿ÉÒÔÏȲο´Ò»Ï¡¶DuplexPipe¶þÈýÊ£¨¶þ£©¡·¡£ÔÙÀ´¼òµ¥µØ½éÉÜһϠDuplexPipe£¬¹ËÃû˼Ò壬ËüÊÇÒ»¸ö“Ë«Ïò¹ÜµÀ”¡£ÔÚ shell ÖУ¬ÎÒÃÇͨ¹ý“|”ʹÓÃÄäÃû¹ÜµÀ£¬ÈÃÇ°Ò»ÌõÃüÁîµÄÊä³ö×÷ΪºóÒ»ÌõÃüÁîµÄÊäÈ룻˫Ïò¹ÜµÀ¼´ÔÚ´Ë»ù ......