ʹÓÃQemuÀ´µ÷ÊÔlinuxÄÚºË
QemuÊÇÒ»¸öÓÅÐãµÄ¿ªÔ´ISAÄ£ÄâÆ÷£¬Ö§³ÖºÜ¶àÌåϵ½á¹¹£¬µ±È»°üÀ¨x86¡£QemuÌṩµ÷ÊÔ¹¦ÄÜ£¬¿ÉÒÔ¶Ô±»Ä£Äâ½øÐе÷ÊÔ¡£
QemuÖ÷Ò³http://fabrice.bellard.free.fr/qemu/
QemuÏÂÔØÒ³Ãæhttp://fabrice.bellard.free.fr/qemu/download.html °üÀ¨Ô´Â룬¿ÉÖ´ÐÐÎļþ£¬ÒÑÖÆ×÷ºÃµÄdisk fileµÈ
QemuÓÐʹÓÃ˵Ã÷Îĵµhttp://fabrice.bellard.free.fr/qemu/qemu-doc.html£¬ÍøÉÏÒ²¿ÉÒÔËÑË÷µ½Ò»Ð©ËµÃ÷£¬µ«ÊÇÕâЩ˵Ã÷²»¹»Çå³þÉõÖÁÓдíÎóµÄµØ·½£¬²»×ãÒÔ°ïÖú±ðÈ˳ɹ¦Ê¹ÓÃQemuÀ´µ÷ÊÔkernel£¬ËùÒÔÎÒ°Ñ×ÔÉí¿ÉÐеķ½·¨¼Ç¼ÏÂÀ´¡£
1¡£ÏÂÔØQemu, qemuÓÐÖ±½ÓµÄ¿ÉÖ´ÐÐÎļþ°ü£¬½âѹµ½ / ¼´¿ÉʹÓÃ
2¡£ÏÂÔØQemu ÌṩµÄ²âÊÔdisk image file;
3¡£²âÊÔQemuÊÇ·ñ¿ÉÒÔÔËÐУ¬ qemu -hda linux-0.2.img -append "root=/dev/hda"
-no-kqemu(linux-0.2.imgΪ֮ǰÏÂÔغõÄdisk image file)£¬Õý³£Çé¿öÏ»áÌø³ö´°¿Ú¿ªÊ¼ÔËÐÐlinuxϵͳ
»ù±¾°²×°ÕýÈ·Ö®ºó£¬¿ªÊ¼½øÈëµ÷ÊԽ׶Î
1¡£±àÒë×Ô¼ºÐèÒªµÄkernelÄںˣ¬²úÉúimageÎļþbzImage£¬kernel elfÎļþvmlinuz
2¡£ÔËÐÐQemu£¬Æô¶¯µ÷ÊÔģʽ¡£ÕâÀïÊÇÐèҪעÒâµÄµØ·½£¬Qemu¸ø³öµÄ˵Ã÷ÊÇÕâÑùµÄ£º
In order to use gdb, launch qemu with the '-s' option. It will wait for a gdb connection:
> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
-append "root=/dev/hda"
Connected to host network interface: tun0
Waiting gdb connection on port 1234
ºÜ¶àÍøÉÏ×ÊÁÏÒ²ÊÇÕâô˵µÄ£¬µ«ÊÇÎÒÊÔÁ˶à´Î£¬Ê¹ÓÃÕâÑùµÄÃüÁ²»»á³öÏÖ“Connected to host network interface: tun0 Waiting gdb connection on port 1234”×ÖÑù£¬linuxϵͳҲÊÇÖ±½ÓÔËÐÐÆðÀ´£¬Ã»Óе÷ÊԵĻú»á¡£Ò»¸ö¸öÃǸæËßÎÒÓÃ-S£¨´óS£©¾ÍÄܴﵽЧ¹û¡£ -S µÄÒâ˼ÊÇfreeze CPU ata startup¡£
²½ÖèÈçÏÂ
1¡£Æô¶¯Qemu,ʹÓôóS²ÎÊý qemu -kernel bzImage -hda linux-0.2.img -append "root=/dev/hda" -S£¬ÏµÍ³»áÌø³öÒ»¸öºÚÏÔʾ½çÃ棬ÎÞÈκÎÄÚÈÝ¡£´Ëʱͨ¹ý ctrl+alt+1 Óë ctrl+alt+2¿ÉÒÔÇл»£¬Ò»¸öÊÇÆÁÄ»Êä³ö£¬Ò»¸öÊÇqemu¿ØÖÆ̨¡£
2¡£Çл»µ½qemu¿ØÖÆ̨£¬ÊäÈëÃüÁîgdbserver 1234
3¡£Í¬Ê±´ò¿ªgdb³ÌÐò£¬Í¨¹ýqemu˵Ã÷ÖÐÌṩµÄ·½·¨¼È¿É½øÐе÷ÊÔ£º
Then launch gdb on the 'vmlinux' executable:
> gdb vmlinux
In gdb, connect to QEMU:
(gdb) target remote localhost:1234
Äã¿ÉÒÔÉèÖöϵãÈçbreak start_
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»¸öÎļþ£¬³ýÁ˱¾Éí°üº¬µÄÄÚÈÝÒÔÍ⣬»¹»áÓÐÒ»¸öÃû×ÖºÍÆäËûһЩÓÃÓÚ¹ÜÀí·½ÃæµÄ“ÊôÐÔ”ÐÅÏ¢£¬±ÈÈçÎļþµÄ½¨Á¢/ÐÞ¸ÄÈÕÖ¾£¬ËüµÄ·ÃÎÊȨÏ޵ȡ£ÕâЩÊôÐÔ¶¼±»±£´æµ½Ò»ÖÐÎÒÃdzÆ֮Ϊinode£¨½Úµã£©µÄÊý¾Ý½á¹¹ÖУ¬ÎļþµÄ³¤¶ÈºÍËüÔÚ´ÅÅÌÉϵĴæ·ÅµØµãÒ²±£´æÔÚÕâÀϵͳʹÓõÄÊÇÎļþµÄ½Úµã±àºÅ£¬¶ø×ÓĿ¼½á¹¹Ö»²»¹ýÊÇΪ·½±ãÈËÃÇ ......
1. grep¼ò½é
grep £¨global search regular expression(RE) and print out the line,È«ÃæËÑË÷ÕýÔò±í´ïʽ²¢°ÑÐдòÓ¡³öÀ´£©ÊÇÒ»ÖÖÇ¿´óµÄÎı¾ËÑË÷¹¤¾ß£¬ËüÄÜʹÓÃÕýÔò±í´ïʽËÑË÷Îı¾£¬²¢°ÑÆ¥ÅäµÄÐдòÓ¡³öÀ´¡£UnixµÄgrep¼Ò×å°ü À¨grep¡¢egrepºÍfgrep¡£egrepºÍfgrepµÄÃüÁîÖ»¸úgrepÓкÜС²»Í¬¡£egrepÊÇgrepµÄÀ©Õ¹£¬Ö§³Ö¸ü¶ ......
Ò³ÉêÇëµÄºËÐĵ÷ÓÃÊÇ: __alloc_pages(). Ò³ÉêÇë˳ÐòÈçÏ£º
Ê×ÏÈÕÒ×î´óÄÜ·ûºÏµÄ¿é, Èç¹ûÒ»¸ö¿ÕÏп鲻ÄÜÂú×ã, ¸ü¸ßÒ»¼¶µÄ¿é½«·Ö¸î³É2¸öbuddy, Ò»¸ö±»Õ¼ÓÃ, Ò»¸ö·ÅÈëµÍÒ»¼¶µÄfreelist.
µ±¿é±»ÊÍ·Åʱ, ¼ì²éÿ¶Ôbuddy, Èç¹ûÁ½Õ߶¼¿ÕÏÐ, °ÑËûÃǺϲ¢µ½¸ü¸ßÒ»¼¶µÄ¿éÊý×é ......