{"id":42757,"date":"2025-06-10T08:55:58","date_gmt":"2025-06-10T00:55:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/42757.html"},"modified":"2025-06-10T08:55:58","modified_gmt":"2025-06-10T00:55:58","slug":"%e7%a8%8b%e5%ba%8f%e4%ba%ba%e7%94%9f-hellos-p2p-2","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/42757.html","title":{"rendered":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P"},"content":{"rendered":"<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b0b615.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u8ba1\u7b97\u673a\u7cfb\u7edf<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u5927\u4f5c\u4e1a<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9898 \u00a0\u00a0\u00a0\u00a0\u76ee\u00a0\u00a0\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e13 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e1a \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7535\u5b50\u4e0e\u4fe1\u606f\u5de5\u7a0b\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b66\u3000\u3000 \u00a0\u00a0\u53f7 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02023111556\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u73ed \u00a0\u00a0\u7ea7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a023L0502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b66 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u751f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u59da\u96ef\u5f64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6307 \u5bfc \u6559 \u5e08\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5218\u5b8f\u4f1f\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u8ba1\u7b97\u673a\u79d1\u5b66\u4e0e\u6280\u672f\u5b66\u9662<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">2024\u5e745\u6708<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6458 \u00a0\u8981<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7bc7\u8bba\u6587\u65e8\u5728\u7cfb\u7edf\u9610\u8ff0C\u8bed\u8a00\u7a0b\u5e8f\u4ece\u6e90\u4ee3\u7801\u5230\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u8f6c\u6362\u673a\u5236\u3002\u4ee5\u7ecf\u5178\u793a\u4f8bhello.c\u4e3a\u7814\u7a76\u5bf9\u8c61&#xff0c;\u8bba\u6587\u9010\u6b65\u5256\u6790\u4e86\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5\u53ca\u8fdb\u7a0b\u8fd0\u884c\u7b49\u5173\u952e\u9636\u6bb5\u7684\u5904\u7406\u6d41\u7a0b\u3002\u901a\u8fc7\u7406\u8bba\u89e3\u6790\u4e0e\u5b9e\u8df5\u6f14\u793a\u76f8\u7ed3\u5408\u7684\u65b9\u6cd5&#xff0c;\u4e0d\u4ec5\u6df1\u5165\u63a2\u8ba8\u4e86\u5404\u73af\u8282\u7684\u6838\u5fc3\u539f\u7406\u4e0e\u5b9e\u73b0\u6280\u672f&#xff0c;\u8fd8\u901a\u8fc7\u5b9e\u9a8c\u9a8c\u8bc1\u76f4\u89c2\u5c55\u793a\u4e86\u8f6c\u6362\u8fc7\u7a0b\u7684\u5177\u4f53\u5b9e\u73b0\u3002\u8fd9\u79cd\u7406\u8bba\u4e0e\u5b9e\u8df5\u5e76\u91cd\u7684\u7814\u7a76\u65b9\u6cd5&#xff0c;\u6709\u6548\u63ed\u793a\u4e86\u8ba1\u7b97\u673a\u7cfb\u7edf\u5728\u7a0b\u5e8f\u7f16\u8bd1\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u5e95\u5c42\u5de5\u4f5c\u673a\u5236&#xff0c;\u4e3a\u8bfb\u8005\u6df1\u5165\u7406\u89e3C\u8bed\u8a00\u7a0b\u5e8f\u7684\u7f16\u8bd1\u94fe\u548c\u8ba1\u7b97\u673a\u4f53\u7cfb\u7ed3\u6784\u4e0e\u63d0\u4f9b\u4e86\u7cfb\u7edf\u7684\u77e5\u8bc6\u6846\u67b6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5173\u952e\u8bcd&#xff1a;C\u8bed\u8a00\u7a0b\u5e8f&#xff1b;\u7f16\u8bd1\u94fe&#xff1b;\u8ba1\u7b97\u673a\u7cfb\u7edf\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u76ee \u00a0\u5f55<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"text-align:left\">\u7b2c1\u7ae0 \u6982\u8ff0 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">1.1 Hello\u7b80\u4ecb <\/p>\n<p style=\"margin-left:12pt;text-align:left\">1.2 \u73af\u5883\u4e0e\u5de5\u5177 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">1.3 \u4e2d\u95f4\u7ed3\u679c <\/p>\n<p style=\"margin-left:12pt;text-align:left\">1.4 \u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"text-align:left\">\u7b2c2\u7ae0 \u9884\u5904\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">2.1 \u9884\u5904\u7406\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">2.2\u5728Ubuntu\u4e0b\u9884\u5904\u7406\u7684\u547d\u4ee4 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">2.3 Hello\u7684\u9884\u5904\u7406\u7ed3\u679c\u89e3\u6790 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">2.4 \u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"text-align:left\">\u7b2c3\u7ae0 \u7f16\u8bd1 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">3.1 \u7f16\u8bd1\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">3.2 \u5728Ubuntu\u4e0b\u7f16\u8bd1\u7684\u547d\u4ee4 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">3.3 Hello\u7684\u7f16\u8bd1\u7ed3\u679c\u89e3\u6790 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">3.4 \u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"text-align:left\">\u7b2c4\u7ae0 \u6c47\u7f16 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">4.1 \u6c47\u7f16\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">4.2 \u5728Ubuntu\u4e0b\u6c47\u7f16\u7684\u547d\u4ee4 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">4.3 \u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807elf\u683c\u5f0f <\/p>\n<p style=\"margin-left:12pt;text-align:left\">4.4 Hello.o\u7684\u7ed3\u679c\u89e3\u6790 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">4.5 \u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"text-align:left\">\u7b2c5\u7ae0 \u94fe\u63a5 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.1 \u94fe\u63a5\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.2 \u5728Ubuntu\u4e0b\u94fe\u63a5\u7684\u547d\u4ee4 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.3 \u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6hello\u7684\u683c\u5f0f <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.4 hello\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.5 \u94fe\u63a5\u7684\u91cd\u5b9a\u4f4d\u8fc7\u7a0b\u5206\u6790 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.6 hello\u7684\u6267\u884c\u6d41\u7a0b <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.7 Hello\u7684\u52a8\u6001\u94fe\u63a5\u5206\u6790 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">5.8 \u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"text-align:left\">\u7b2c6\u7ae0 hello\u8fdb\u7a0b\u7ba1\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.1 \u8fdb\u7a0b\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.2 \u7b80\u8ff0\u58f3Shell-bash\u7684\u4f5c\u7528\u4e0e\u5904\u7406\u6d41\u7a0b <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.3 Hello\u7684fork\u8fdb\u7a0b\u521b\u5efa\u8fc7\u7a0b <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.4 Hello\u7684execve\u8fc7\u7a0b <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.5 Hello\u7684\u8fdb\u7a0b\u6267\u884c <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.6 hello\u7684\u5f02\u5e38\u4e0e\u4fe1\u53f7\u5904\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">6.7\u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"text-align:left\">\u7b2c7\u7ae0 hello\u7684\u5b58\u50a8\u7ba1\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.1 hello\u7684\u5b58\u50a8\u5668\u5730\u5740\u7a7a\u95f4 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.2 Intel\u903b\u8f91\u5730\u5740\u5230\u7ebf\u6027\u5730\u5740\u7684\u53d8\u6362-\u6bb5\u5f0f\u7ba1\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.3 Hello\u7684\u7ebf\u6027\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u53d8\u6362-\u9875\u5f0f\u7ba1\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.4 TLB\u4e0e\u56db\u7ea7\u9875\u8868\u652f\u6301\u4e0b\u7684VA\u5230PA\u7684\u53d8\u6362 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.5 \u4e09\u7ea7Cache\u652f\u6301\u4e0b\u7684\u7269\u7406\u5185\u5b58\u8bbf\u95ee <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.6 hello\u8fdb\u7a0bfork\u65f6\u7684\u5185\u5b58\u6620\u5c04 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.7 hello\u8fdb\u7a0bexecve\u65f6\u7684\u5185\u5b58\u6620\u5c04 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.8 \u7f3a\u9875\u6545\u969c\u4e0e\u7f3a\u9875\u4e2d\u65ad\u5904\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.9\u52a8\u6001\u5b58\u50a8\u5206\u914d\u7ba1\u7406 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">7.10\u672c\u7ae0\u5c0f\u7ed3 <\/p>\n<p style=\"margin-left:12pt;text-align:left\">\n<p style=\"text-align:left\">\u7ed3\u8bba <\/p>\n<p style=\"text-align:left\">\u9644\u4ef6 <\/p>\n<p style=\"text-align:left\">\u53c2\u8003\u6587\u732e <\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<h2 style=\"text-align:center\"> \u7b2c1\u7ae0 \u6982\u8ff0<\/h2>\n<h3 style=\"text-align:justify\">1.1 Hello\u7b80\u4ecb<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.1.1P2P(Program to Process)&#xff1a;P2P\u8fc7\u7a0b\u5c55\u73b0\u4e86\u6e90\u4ee3\u7801\u5982\u4f55\u7ecf\u7f16\u8bd1\u3001\u94fe\u63a5\u6210\u4e3a\u8fdb\u7a0b\u3002\u7f16\u5199\u6e90\u4ee3\u7801&#xff08;\u7a0b\u5e8f\u5458\u7f16\u5199hello.c&#xff0c;\u8fd9\u662f\u4e00\u4e2aC\u8bed\u8a00\u6e90\u4ee3\u7801\u6587\u4ef6&#xff0c;\u5305\u542bmain()\u51fd\u6570\u548cprintf(\u201cHello\u201d)\u7b49\u8bed\u53e5&#xff09;\u2192\u9884\u5904\u7406&#xff08;\u9884\u5904\u7406\u5668(cpp)\u5904\u7406#include\u3001\u5b8f\u5b9a\u4e49&#xff08;#define&#xff09;\u7b49\u6307\u4ee4&#xff0c;\u751f\u6210.i\u6587\u4ef6&#xff08;\u7eafC\u4ee3\u7801&#xff09;&#xff09;\u2192\u7f16\u8bd1&#xff08;\u7f16\u8bd1\u5668&#xff08;cc1&#xff09;\u5c06\u9884\u5904\u7406\u540e\u7684\u4ee3\u7801\u7ffb\u8bd1\u6210\u6c47\u7f16\u8bed\u8a00&#xff08;.s\u6587\u4ef6&#xff09;&#xff09;\u2192\u6c47\u7f16&#xff08;\u6c47\u7f16\u5668&#xff08;as&#xff09;\u5c06\u6c47\u7f16\u4ee3\u7801\u8f6c\u6362\u4e3a\u673a\u5668\u6307\u4ee4&#xff0c;\u751f\u6210\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff08;.o\u6587\u4ef6&#xff09;&#xff09;\u2192\u94fe\u63a5&#xff08;\u8fde\u63a5\u5668&#xff08;ld&#xff09;\u5c06\u591a\u4e2a.o\u6587\u4ef6\u4e0e\u6807\u51c6\u5e93&#xff08;\u5982libc.so&#xff09;\u5408\u5e76&#xff0c;\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6&#xff08;hello&#xff09;&#xff09;\u2192\u8fdb\u7a0b\u521b\u5efa&#xff08;Shell\u8c03\u7528fork()\u521b\u5efa\u5b50\u7a0b\u5e8f&#xff0c;\u518d\u901a\u8fc7execve()\u52a0\u8f7dhello\u7a0b\u5e8f&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.1.2O2O(From Zero to Zero):<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">From Zero(\u521d\u59cb\u72b6\u6001)&#xff1a;\u7a0b\u5e8f\u672a\u8fd0\u884c\u65f6&#xff0c;\u4ec5\u4ee5\u9759\u6001\u4ee3\u7801&#xff08;hello.c&#xff09;\u5f62\u5f0f\u5b58\u5728\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">To Zero(\u7ec8\u6b62\u7a0b\u5e8f)&#xff1a;\u8fdb\u7a0b\u6267\u884c\u5b8c\u6bd5\u540e&#xff0c;\u6240\u6709\u8fd0\u884c\u65f6\u72b6\u6001&#xff08;\u5bc4\u5b58\u5668\u3001\u5185\u5b58\u7b49&#xff09;\u88abOS\u56de\u6536&#xff0c;\u4eff\u4f5b\u4ece\u672a\u8fd0\u884c\u8fc7\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8ba1\u7b97\u673a\u7cfb\u7edf&#xff08;CS&#xff09;\u7684\u89c1\u8bc1&#xff1a;\u53ea\u6709\u7f16\u8bd1\u5668\u3001\u94fe\u63a5\u5668\u3001OS\u3001\u786c\u4ef6\u7b49\u5e95\u5c42\u7cfb\u7edf\u77e5\u9053hello\u66fe\u7ecf\u5b58\u5728\u5e76\u8fd0\u884c\u8fc7\u3002\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u5b8c\u5168\u4f9d\u8d56\u4e8e\u8ba1\u7b97\u673a\u7cfb\u7edf\u7684\u652f\u6301&#xff0c;\u4f46\u6700\u7ec8\u4e0d\u7559\u4e0b\u4efb\u4f55\u75d5\u8ff9\u3002\u7a0b\u5e8f\u672c\u8eab\u6700\u7ec8\u201c\u6325\u4e00\u6325\u8863\u8896&#xff0c;\u4e0d\u5e26\u8d70\u4e00\u7247\u4e91\u5f69\u201d\u3002<\/p>\n<h3 style=\"text-align:justify\">1.2 \u73af\u5883\u4e0e\u5de5\u5177<\/h3>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">1.2.1\u786c\u4ef6\u73af\u5883&#xff1a;<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b170ef.png\" \/><\/p>\n<p style=\"text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"background-color:#ffffff\">\u7cfb\u7edf\u7c7b\u578b&#xff1a;64\u4f4d\u64cd\u4f5c\u7cfb\u7edf&#xff0c;\u57fa\u4e8ex64\u7684\u5904\u7406\u5668<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.2.2\u8f6f\u4ef6\u73af\u5883&#xff1a;Windows11 64\u4f4d&#xff0c;VMware&#xff0c;Ubuntu 20.04 LTS<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"background-color:#ffffff\">1.2.3\u5f00\u53d1\u4e0e\u8c03\u8bd5\u5de5\u5177&#xff1a;Visual Studio 2022\u00a064\u4f4d&#xff1b;vim objump edb gcc readelf\u7b49\u5de5\u5177<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">1.3 \u4e2d\u95f4\u7ed3\u679c<\/h3>\n<table align=\"center\" border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6587\u4ef6\u540d<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u529f\u80fd<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.c<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6e90\u7a0b\u5e8f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.i<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u9884\u5904\u7406\u540e\u5f97\u5230\u7684\u6587\u672c\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.s<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7f16\u8bd1\u540e\u5f97\u5230\u7684\u6c47\u7f16\u8bed\u8a00\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.o<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6c47\u7f16\u540e\u5f97\u5230\u7684\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.elf<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7528readelf\u8bfb\u53d6hello.o\u5f97\u5230\u7684ELF\u683c\u5f0f\u4fe1\u606f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.asm<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53cd\u6c47\u7f16hello.o\u5f97\u5230\u7684\u53cd\u6c47\u7f16\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello1.asm<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53cd\u6c47\u7f16hello\u53ef\u6267\u884c\u6587\u4ef6\u5f97\u5230\u7684\u53cd\u6c47\u7f16\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">1.4 \u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u9996\u5148\u4ecb\u7ecd\u4e86hello\u7684P2P&#xff0c;020\u6d41\u7a0b&#xff0c;\u5305\u62ec\u6d41\u7a0b\u7684\u8bbe\u8ba1\u601d\u8def\u548c\u5b9e\u73b0\u65b9\u6cd5&#xff1b;\u7136\u540e&#xff0c;\u8be6\u7ec6\u8bf4\u660e\u4e86\u672c\u5b9e\u9a8c\u6240\u9700\u7684\u786c\u4ef6\u914d\u7f6e\u3001\u8f6f\u4ef6\u5e73\u53f0\u3001\u5f00\u53d1\u5de5\u5177\u4ee5\u53ca\u672c\u5b9e\u9a8c\u751f\u6210\u7684\u5404\u4e2a\u4e2d\u95f4\u7ed3\u679c\u6587\u4ef6\u7684\u540d\u79f0\u548c\u529f\u80fd\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<h2 style=\"text-align:center\"> \u7b2c2\u7ae0 \u9884\u5904\u7406<\/h2>\n<h3 style=\"text-align:justify\">2.1\u00a0\u9884\u5904\u7406\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2.1.1\u9884\u5904\u7406\u7684\u6982\u5ff5&#xff1a;\u9884\u5904\u7406\u662fC\/C&#043;&#043;\u7a0b\u5e8f\u7f16\u8bd1\u8fc7\u7a0b\u7684\u7b2c\u4e00\u9636\u6bb5&#xff0c;\u7531\u9884\u5904\u7406\u5668&#xff08;Preprocessor&#xff09;\u6267\u884c\u3002\u9884\u5904\u7406\u5668\u7684\u4e3b\u8981\u4efb\u52a1\u662f\u5728\u6b63\u5f0f\u7f16\u8bd1\u4e4b\u524d&#xff0c;\u5bf9\u6e90\u4ee3\u7801\u8fdb\u884c\u6587\u672c\u7ea7\u522b\u7684\u5904\u7406&#xff0c;\u5305\u62ec&#xff1a;\u5b8f\u5c55\u5f00\u3001\u5934\u6587\u4ef6\u5305\u542b\u3001\u6761\u4ef6\u7f16\u8bd1\u3001\u5220\u9664\u6ce8\u91ca\u3001\u7279\u6b8a\u6307\u4ee4\u5904\u7406\u3002\u9884\u5904\u7406\u540e\u7684\u4ee3\u7801\u4ecd\u7136\u662f\u7eaf\u6587\u672c\u5f62\u5f0f\u7684C\/C&#043;&#043;\u4ee3\u7801&#xff0c;\u4f46\u5df2\u7ecf\u53bb\u9664\u4e86\u9884\u5904\u7406\u6307\u4ee4&#xff0c;\u5e76\u8fdb\u884c\u4e86\u76f8\u5e94\u7684\u66ff\u6362\u548c\u8c03\u6574&#xff0c;\u751f\u6210.i&#xff08;C&#xff09;\u6216.ii&#xff08;C&#043;&#043;&#xff09;\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2.1.2\u9884\u5904\u7406\u7684\u4f5c\u7528&#xff1a;\u9884\u5904\u7406\u7684\u4e3b\u8981\u76ee\u7684\u662f\u7b80\u5316\u4ee3\u7801\u7f16\u5199\u3001\u63d0\u9ad8\u53ef\u7ef4\u62a4\u6027\u3001\u589e\u5f3a\u7075\u6d3b\u6027&#xff0c;\u5177\u4f53\u4f5c\u7528\u5305\u62ec&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">&#xff08;1&#xff09;\u5b8f\u5b9a\u4e49\u4e0e\u66ff\u6362&#xff1a;\u5b9a\u4e49\u5e38\u91cf\u3001\u51fd\u6570\u5f0f\u5b8f&#xff0c;\u51cf\u5c11\u91cd\u590d\u4ee3\u7801<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u9884\u5904\u7406\u9636\u6bb5\u4f1a\u76f4\u63a5\u66ff\u6362&#xff0c;\u4f8b\u5982MAX&#xff08;1&#xff0c;2&#xff09;\u4f1a\u88ab\u66ff\u6362\u6210((1)&gt;(2)?(1):(2))<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">&#xff08;2&#xff09;\u5934\u6587\u4ef6\u5305\u542b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5c06\u5916\u90e8\u5e93\u6216\u81ea\u5b9a\u4e49\u5934\u6587\u4ef6\u63d2\u5165\u5f53\u524d\u6587\u4ef6&#xff0c;\u907f\u514d\u91cd\u590d\u58f0\u660e<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u9884\u5904\u7406\u9636\u6bb5\u4f1a\u9012\u5f52\u5c55\u5f00\u6240\u6709#include&#xff0c;\u751f\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u4ee3\u7801\u6587\u4ef6\u3002<\/p>\n<li style=\"text-align:left\">\u6761\u4ef6\u7f16\u8bd1<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6839\u636e\u4e0d\u540c\u7684\u7f16\u8bd1\u73af\u5883\u9009\u62e9\u6027\u5730\u5305\u542b\u6216\u6392\u9664\u4ee3\u7801<\/p>\n<li style=\"text-align:left\">\u6ce8\u91ca\u5220\u9664<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u9884\u5904\u7406\u9636\u6bb5\u4f1a\u79fb\u9664\u6240\u6709\u6ce8\u91ca&#xff0c;\u51cf\u5c11\u7f16\u8bd1\u5668\u7684\u5904\u7406\u8d1f\u62c5<\/p>\n<li style=\"text-align:left\">\u7279\u6b8a\u6307\u4ee4\u5904\u7406<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">#program\u7528\u4e8e\u5411\u7f16\u8bd1\u5668\u4f20\u9012\u7279\u6b8a\u6307\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">#error\u7528\u4e8e\u5728\u9884\u5904\u7406\u9636\u6bb5\u5f3a\u5236\u62a5\u9519<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\n<h3 style=\"text-align:justify\">2.2\u5728Ubuntu\u4e0b\u9884\u5904\u7406\u7684\u547d\u4ee4<\/h3>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u9884\u5904\u7406\u7684\u547d\u4ee4&#xff1a;gcc -E hello.c -o hello.i<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b29451.png\" \/><\/p>\n<h3 style=\"text-align:justify\">2.3 Hello\u7684\u9884\u5904\u7406\u7ed3\u679c\u89e3\u6790<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b5acb2.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c06\u6e90\u7a0b\u5e8f\u4e0e\u9884\u5904\u7406\u540e\u7684\u7a0b\u5e8fhello.i\u8fdb\u884c\u5bf9\u6bd4&#xff0c;\u53d1\u73b0\u9884\u5904\u7406\u6307\u4ee4\u88ab\u6269\u5c55\u4e86\u5f88\u591a&#xff0c;\u4f46\u9664\u6b64\u4e4b\u5916&#xff0c;\u6e90\u7a0b\u5e8f\u7684\u5176\u4ed6\u90e8\u5206\u4e0e\u539f\u6765\u76f8\u540c&#xff0c;.c\u6587\u4ef6\u88ab\u4fee\u6539\u4e86\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">main\u51fd\u6570\u4ee3\u7801\u51fa\u73b0\u4e4b\u524d\u7684\u4ee3\u7801\u6765\u81ea\u4e8e\u5934\u6587\u4ef6\u7684\u5c55\u5f00\u3002\u539f\u59cb\u4ee3\u7801\u4e2d\u7684&#xff1a;#include&lt;stdio.h&gt;\u3001#include&lt;unistd.h&gt;\u3001#include&lt;stdlib.h&gt;\u4f1a\u88ab\u66ff\u6362\u4e3a\u8fd9\u4e9b\u5934\u6587\u4ef6\u7684\u5b9e\u9645\u5185\u5bb9&#xff0c;\u4f8b\u5982&#xff1a;stdio.h \u2192 \u63d2\u5165 printf\u3001FILE \u7b49\u76f8\u5173\u7684\u51fd\u6570\u548c\u7c7b\u578b\u58f0\u660e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">unistd.h \u2192 \u63d2\u5165 sleep\u3001getchar \u7b49\u7cfb\u7edf\u8c03\u7528\u58f0\u660e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">stdlib.h \u2192 \u63d2\u5165 exit\u3001atoi \u7b49\u51fd\u6570\u58f0\u660e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u9884\u5904\u7406\u5668\u9047\u5230#include&lt;stdio.h&gt;\u65f6&#xff0c;\u5b83\u4f1a\u5728\u7cfb\u7edf\u7684\u5934\u6587\u4ef6\u8def\u5f84\u4e0b\u67e5\u627estdio.h\u6587\u4ef6&#xff0c;\u4e00\u822c\u5728\/usr\/include\u76ee\u5f55\u4e0b&#xff0c;\u7136\u540e\u628astdio.h\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230\u6e90\u6587\u4ef6\u4e2d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"background-color:#ffffff\">\u9884\u5904\u7406\u5668\u4e0d\u4f1a\u5bf9\u5934\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u505a\u4efb\u4f55\u8ba1\u7b97\u6216\u8f6c\u6362&#xff0c;\u53ea\u662f\u7b80\u5355\u5730\u590d\u5236\u548c\u66ff\u6362\u3002<\/span><\/p>\n<h3 style=\"text-align:justify\">2.4 \u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u8bb2\u8ff0\u4e86\u5728linux\u73af\u5883\u4e2d&#xff0c;\u5982\u4f55\u7528\u547d\u4ee4\u5bf9C\u8bed\u8a00\u7a0b\u5e8f\u8fdb\u884c\u9884\u5904\u7406&#xff0c;\u4ee5\u53ca\u9884\u5904\u7406\u7684\u542b\u4e49\u548c\u4f5c\u7528\u3002\u7136\u540e\u7528\u4e00\u4e2a\u7b80\u5355\u7684hello\u7a0b\u5e8f\u6f14\u793a\u4e86\u4ecehello.c\u5230hello.i\u7684\u8fc7\u7a0b&#xff0c;\u5e76\u7528\u5177\u4f53\u7684\u4ee3\u7801\u5206\u6790\u4e86\u9884\u5904\u7406\u540e\u7684\u7ed3\u679c\u3002\u901a\u8fc7\u5206\u6790&#xff0c;\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u9884\u5904\u7406\u540e\u7684\u6587\u4ef6hello.i\u5305\u542b\u4e86\u6807\u51c6\u8f93\u5165\u8f93\u51fa\u5e93stdio.h\u7684\u5185\u5bb9&#xff0c;\u4ee5\u53ca\u4e00\u4e9b\u5b8f\u548c\u5e38\u91cf\u7684\u5b9a\u4e49&#xff0c;\u8fd8\u6709\u4e00\u4e9b\u884c\u53f7\u4fe1\u606f\u548c\u6761\u4ef6\u7f16\u8bd1\u6307\u4ee4<\/p>\n<h2 style=\"text-align:center\"> \u7b2c3\u7ae0 \u7f16\u8bd1<\/h2>\n<h3 style=\"text-align:justify\">3.1 \u7f16\u8bd1\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.1.1\u7f16\u8bd1\u7684\u6982\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7f16\u8bd1\u662f\u5c06\u9884\u5904\u7406\u540e\u7684\u9ad8\u7ea7\u8bed\u8a00\u4ee3\u7801&#xff08;\u5982C\/C&#043;&#043;&#xff09;\u8f6c\u6362\u4e3a\u4f4e\u7ea7\u8bed\u8a00&#xff08;\u6c47\u7f16\u4ee3\u7801\u6216\u673a\u5668\u7801&#xff09;\u7684\u8fc7\u7a0b&#xff0c;\u7531\u7f16\u8bd1\u5668&#xff08;Compiler&#xff09;\u5b8c\u6210\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.1.2\u7f16\u8bd1\u7684\u4f5c\u7528<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7f16\u8bd1\u7684\u6838\u5fc3\u76ee\u6807\u662f\u5c06\u4eba\u7c7b\u53ef\u8bfb\u7684\u4ee3\u7801\u8f6c\u6362\u4e3a\u673a\u5668\u53ef\u6267\u884c\u7684\u6307\u4ee4&#xff0c;\u5177\u4f53\u4f5c\u7528\u5305\u62ec&#xff1a;<\/p>\n<li style=\"text-align:justify\">\u8bed\u6cd5\u68c0\u67e5<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u68c0\u67e5\u4ee3\u7801\u662f\u5426\u7b26\u5408C\u8bed\u8a00\u8bed\u6cd5\u89c4\u5219&#xff08;\u5982\u62ec\u53f7\u5339\u914d\u3001\u5206\u53f7\u7ed3\u5c3e\u7b49&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u5b58\u5728\u8bed\u6cd5\u9519\u8bef&#xff0c;\u7f16\u8bd1\u4f1a\u5931\u8d25\u5e76\u62a5\u9519&#xff08;\u5982 error: expected \u2018;\u2019 before \u2018}\u2019 token&#xff09;\u3002<\/p>\n<li style=\"text-align:justify\">\u8bed\u4e49\u5206\u6790<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u68c0\u67e5\u53d8\u91cf\u662f\u5426\u58f0\u660e\u3001\u7c7b\u578b\u662f\u5426\u5339\u914d&#xff08;\u5982 int x &#061; &#034;string&#034;; \u4f1a\u62a5\u9519&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u68c0\u67e5\u51fd\u6570\u8c03\u7528\u662f\u5426\u5408\u6cd5&#xff08;\u5982\u672a\u5b9a\u4e49\u7684\u51fd\u6570 undefined reference to &#039;foo&#039;&#xff09;\u3002<\/p>\n<li style=\"text-align:justify\">\u4ee3\u7801\u4f18\u5316<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6839\u636e\u7f16\u8bd1\u9009\u9879&#xff08;\u5982 -O1, -O2&#xff09;\u5bf9\u4ee3\u7801\u8fdb\u884c\u4f18\u5316&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5220\u9664\u65e0\u7528\u4ee3\u7801&#xff08;\u6b7b\u4ee3\u7801\u6d88\u9664&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5faa\u73af\u5c55\u5f00&#xff08;Loop Unrolling&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5185\u8054\u51fd\u6570&#xff08;Inline Expansion&#xff09;\u3002<\/p>\n<h3 style=\"text-align:justify\">3.2 \u5728Ubuntu\u4e0b\u7f16\u8bd1\u7684\u547d\u4ee4<\/h3>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u7f16\u8bd1\u547d\u4ee4&#xff1a;gcc -S hello.i -o hello.s<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b7f819.png\" \/><\/p>\n<p style=\"margin-left:24.0000pt;text-align:justify\">\n<h3 style=\"text-align:justify\">3.3 Hello\u7684\u7f16\u8bd1\u7ed3\u679c\u89e3\u6790<\/h3>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">3.3.1\u6587\u4ef6\u4e0e\u6bb5\u58f0\u660e<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b9fcd9.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.file&#xff1a;\u6807\u8bc6\u539f\u59cbC\u6e90\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.text&#xff1a;\u5b58\u653e\u7a0b\u5e8f\u6307\u4ee4\u7684\u4ee3\u7801\u6bb5&#xff08;\u53ef\u6267\u884c\u673a\u5668\u7801&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.rodata&#xff1a;\u5b58\u653e\u53ea\u8bfb\u6570\u636e&#xff08;\u5982\u5b57\u7b26\u4e32\u5e38\u91cf&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\">3.3.2\u5b57\u7b26\u4e32\u5e38\u91cf&#xff08;\u53ea\u8bfb\u6570\u636e\u6bb5&#xff09;<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829baffb9.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829bbbc14.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.LC0&#xff1a;\u9519\u8bef\u63d0\u793a\u5b57\u7b26\u4e32&#xff08;\u7f16\u7801\u4e3a\u516b\u8fdb\u5236\u8f6c\u4e49\u5e8f\u5217&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.LC1&#xff1a;printf\u7684\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.align 8&#xff1a;\u5185\u5b58\u5730\u5740\u63098\u5b57\u8282\u5bf9\u9f50&#xff0c;\u63d0\u5347\u8bbf\u95ee\u6548\u7387\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">3.3.3\u4e3b\u51fd\u6570\u5b9a\u4e49<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829bce0e4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.globl main&#xff1a;\u4f7fmain\u51fd\u6570\u53ef\u88ab\u94fe\u63a5\u5668\u8bbf\u95ee\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">endbr64&#xff1a;Intel\u63a7\u5236\u6d41\u5f3a\u5236\u6280\u672f&#xff08;\u5b89\u5168\u7279\u6027&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">3.3.4\u51fd\u6570\u5e8f\u8a00<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829be5660.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c026a7.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">%rbp&#xff08;\u57fa\u5740\u6307\u9488&#xff09;\u548c%rsp&#xff08;\u6808\u6307\u9488&#xff09;\u6784\u6210\u5f53\u524d\u51fd\u6570\u7684\u6808\u5e27\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">subq $32, %rsp&#xff1a;\u4e3a\u5c40\u90e8\u53d8\u91cf\u548c\u4e34\u65f6\u6570\u636e\u9884\u7559\u7a7a\u95f4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.3.5\u53c2\u6570\u68c0\u67e5<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c13fdf.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c2140f.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u53c2\u6570\u4f20\u9012\u89c4\u5219&#xff08;x86-64 System V ABI&#xff09;&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">%edi&#xff1a;argc&#xff08;int&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">%rsi&#xff1a;argv&#xff08;char**&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5206\u652f\u903b\u8f91&#xff1a;\u82e5argc !&#061; 5&#xff0c;\u6267\u884c\u9519\u8bef\u63d0\u793a\u5e76\u9000\u51fa\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.3.6\u9519\u8bef\u5904\u7406<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c325ca.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c3f257.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">puts&#064;PLT&#xff1a;\u901a\u8fc7\u8fc7\u7a0b\u94fe\u63a5\u8868&#xff08;PLT&#xff09;\u8c03\u7528\u5e93\u51fd\u6570puts\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">exit(1)&#xff1a;\u76f4\u63a5\u7ec8\u6b62\u7a0b\u5e8f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.3.7\u4e3b\u5faa\u73af<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c539dd.jpg\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829c6bc40.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u53c2\u6570\u8bbf\u95ee&#xff1a;\u901a\u8fc7argv\u57fa\u5740&#043;\u504f\u79fb\u91cf\u83b7\u53d6\u53c2\u6570&#xff08;argv[1]~argv[4]&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u51fd\u6570\u8c03\u7528&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">printf&#064;PLT&#xff1a;\u683c\u5f0f\u5316\u8f93\u51fa\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">atoi&#064;PLT &#043; sleep&#064;PLT&#xff1a;\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a\u6574\u6570\u5e76\u4f11\u7720\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.3.8\u51fd\u6570\u6536\u5c3e<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829cd01df.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829cdcbfe.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">getchar&#xff1a;\u963b\u585e\u7b49\u5f85\u7528\u6237\u8f93\u5165&#xff08;\u9632\u6b62\u7a0b\u5e8f\u76f4\u63a5\u9000\u51fa&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fd4\u56de\u503c&#xff1a;main\u8fd4\u56de0&#xff08;movl $0, %eax&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.3.9\u5143\u4fe1\u606f\u4e0e\u6ce8\u91ca<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"> <img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005556-6847829ceff97.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10zwpfhtbb0vi.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b89\u5168\u7279\u6027<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.note.GNU-stack&#xff1a;\u6807\u8bb0\u6808\u4e3a\u4e0d\u53ef\u6267\u884c&#xff08;NX\u4fdd\u62a4&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.note.gnu.property&#xff1a;\u5305\u542b\u63a7\u5236\u6d41\u4fdd\u62a4\u4fe1\u606f\u3002<\/p>\n<h3 style=\"text-align:justify\">3.4 \u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fd9\u4e00\u7ae0\u8282\u4e3b\u8981\u8bb2\u89e3\u4e86C\u7f16\u8bd1\u5668\u5c06\u9884\u5904\u7406\u540e\u7684hello.i\u6587\u4ef6\u8f6c\u6362\u4e3a\u6c47\u7f16\u4ee3\u7801hello.s\u7684\u5b8c\u6574\u6d41\u7a0b\u3002\u9996\u5148\u9610\u8ff0\u4e86\u7f16\u8bd1\u9636\u6bb5\u7684\u57fa\u672c\u6982\u5ff5\u548c\u4f5c\u7528\u539f\u7406&#xff0c;\u968f\u540e\u901a\u8fc7\u5b9e\u9645\u7f16\u8bd1\u547d\u4ee4\u5c55\u793a\u4e86\u5177\u4f53\u64cd\u4f5c\u8fc7\u7a0b\u3002\u4f5c\u8005\u6df1\u5165\u89e3\u6790\u4e86\u751f\u6210\u7684hello.s\u6587\u4ef6&#xff0c;\u4ece\u591a\u4e2a\u7ef4\u5ea6\u5bf9\u6bd4\u4e86C\u6e90\u4ee3\u7801\u4e0e\u5bf9\u5e94\u6c47\u7f16\u6307\u4ee4\u7684\u5b9e\u73b0\u5dee\u5f02&#xff1a;\u5305\u62ec\u6570\u636e\u64cd\u4f5c\u5904\u7406\u3001\u51fd\u6570\u8c03\u7528\u673a\u5236\u3001\u5404\u7c7b\u8fd0\u7b97&#xff08;\u8d4b\u503c\u3001\u7b97\u672f\u3001\u5173\u7cfb\u8fd0\u7b97&#xff09;\u7684\u5b9e\u73b0\u65b9\u5f0f&#xff0c;\u4ee5\u53ca\u7a0b\u5e8f\u6d41\u7a0b\u63a7\u5236&#xff08;\u8df3\u8f6c\u6307\u4ee4&#xff09;\u548c\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u7b49\u5173\u952e\u73af\u8282&#xff0c;\u7cfb\u7edf\u6027\u5730\u5448\u73b0\u4e86\u9ad8\u7ea7\u8bed\u8a00\u5230\u6c47\u7f16\u8bed\u8a00\u7684\u8f6c\u6362\u8fc7\u7a0b\u3002<\/p>\n<h2 style=\"text-align:center\"> \u7b2c4\u7ae0 \u6c47\u7f16<\/h2>\n<h3 style=\"text-align:justify\">4.1 \u6c47\u7f16\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.1.1\u6c47\u7f16\u7684\u6982\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6c47\u7f16\u662f\u6307\u6c47\u7f16\u5668(as)\u5c06\u5305\u542b\u6c47\u7f16\u8bed\u8a00\u7684.s\u6587\u4ef6\u7ffb\u8bd1\u4e3a\u673a\u5668\u8bed\u8a00\u6307\u4ee4&#xff0c;\u5e76\u628a\u8fd9\u4e9b\u6307\u4ee4\u6253\u5305\u6210\u4e3a\u4e00\u4e2a\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6\u7684\u683c\u5f0f&#xff0c;\u751f\u6210\u76ee\u6807\u6587\u4ef6.o\u6587\u4ef6\u3002.o\u6587\u4ef6\u662f\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6&#xff0c;\u5305\u542bmain\u51fd\u6570\u7684\u6307\u4ee4\u7f16\u7801\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.1.2\u6c47\u7f16\u7684\u4f5c\u7528<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6c47\u7f16\u7684\u4f5c\u7528\u662f\u5c06\u9ad8\u7ea7\u8bed\u8a00\u8f6c\u5316\u4e3a\u673a\u5668\u53ef\u76f4\u63a5\u8bc6\u522b\u6267\u884c\u7684\u4ee3\u7801\u6587\u4ef6\u7684\u8fc7\u7a0b&#xff0c;\u6c47\u7f16\u5668\u5c06.s \u6c47\u7f16\u7a0b\u5e8f\u7ffb\u8bd1\u6210\u673a\u5668\u8bed\u8a00\u6307\u4ee4&#xff0c;\u628a\u8fd9\u4e9b\u6307\u4ee4\u6253\u5305\u6210\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u7a0b\u5e8f\u7684\u683c\u5f0f\u3002\u00a0.o \u6587\u4ef6\u662f\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6&#xff0c;\u5b83\u5305\u542b\u7a0b\u5e8f\u7684\u6307\u4ee4\u7f16\u7801\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:24.0000pt;text-align:justify\">\u6ce8\u610f&#xff1a;\u8fd9\u513f\u7684\u6c47\u7f16\u662f\u6307\u4ece .s \u5230 .o \u5373\u7f16\u8bd1\u540e\u7684\u6587\u4ef6\u5230\u751f\u6210\u673a\u5668\u8bed\u8a00\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u7684\u8fc7\u7a0b\u3002<\/p>\n<h3 style=\"text-align:justify\">4.2 \u5728Ubuntu\u4e0b\u6c47\u7f16\u7684\u547d\u4ee4<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u547d\u4ee4\u4e3a&#xff1a;gcc -m64 -no-pie-fno-PIC -c hello.s -o hello.o<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-104y3u0nfxfvq.jpg\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">4.3 \u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807elf\u683c\u5f0f<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728shell\u4e2d\u8f93\u5165readelf -a hello.o &gt; hello.elf \u6307\u4ee4\u83b7\u5f97 hello.o \u6587\u4ef6\u7684 ELF \u683c\u5f0f&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-105f0oms4dajc.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.3.1ELF\u5934<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6587\u4ef6\u7c7b\u578b: \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6&#xff08;REL&#xff09;&#xff0c;\u9700\u94fe\u63a5\u540e\u624d\u80fd\u6267\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u67b6\u6784: x86-64 (AMD64)&#xff0c;\u5c0f\u7aef\u5e8f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8282\u5934\u8868\u8d77\u59cb\u4f4d\u7f6e: 1088 \u5b57\u8282&#xff0c;\u5171 14 \u4e2a\u8282\u5934\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u65e0\u7a0b\u5e8f\u5934\u8868&#xff08;\u56e0\u975e\u53ef\u6267\u884c\u6587\u4ef6&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10zc1xgr4r1fi.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.3.2\u8282\u5934<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ee3\u7801\u4e0e\u6570\u636e\u8282<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10xqwr002q44r.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10dp5yx5oxlfu.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.3.3\u91cd\u5b9a\u4f4d\u8282<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u91cd\u5b9a\u4f4d\u8868&#xff08;.rela.text \u548c .rela.eh_frame&#xff09;\u8bb0\u5f55\u94fe\u63a5\u65f6\u9700\u8981\u4fee\u6b63\u7684\u5730\u5740\u3002\u5f53\u94fe\u63a5\u5668\u628a\u8fd9\u4e2a\u76ee\u6807\u6587\u4ef6\u548c\u5176\u4ed6\u6587\u4ef6\u7ec4\u5408\u65f6&#xff0c;\u9700\u8981\u4fee\u6539\u8fd9\u4e9b\u4f4d\u7f6e\u3002\u4e00\u822c\u800c\u8a00&#xff0c;\u4efb\u4f55\u8c03\u7528\u5916\u90e8\u51fd\u6570\u6216\u8005\u5f15\u7528\u5168\u5c40\u53d8\u91cf\u7684\u6307\u4ee4\u90fd\u9700\u8981\u4fee\u6539&#xff0c;\u800c\u8c03\u7528\u672c\u5730\u51fd\u6570\u7684\u6307\u4ee4\u4e0d\u9700\u4fee\u6539\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10r1fpytmrppu.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.3.4\u7b26\u53f7\u8868<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fd9\u5f20\u7b26\u53f7\u8868\u5305\u542b\u4e00\u4e2a\u6761\u76ee\u7684\u6570\u7ec4&#xff0c;\u5b58\u653e\u4e00\u4e2a\u7a0b\u5e8f\u5b9a\u4e49\u548c\u5f15\u7528\u7684\u5168\u5c40\u53d8\u91cf\u548c\u51fd\u6570\u7684\u4fe1\u606f\u3002\u8be5\u7b26\u53f7\u8868\u4e0d\u5305\u542b\u5c40\u90e8\u53d8\u91cf\u7684\u4fe1\u606f\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10304bbd5r1ai.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">4.4 Hello.o\u7684\u7ed3\u679c\u89e3\u6790<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;\u4ee5\u4e0b\u683c\u5f0f\u81ea\u884c\u7f16\u6392&#xff0c;\u7f16\u8f91\u65f6\u5220\u9664&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">objdump -d -r hello.o \u00a0\u5206\u6790hello.o\u7684\u53cd\u6c47\u7f16&#xff0c;\u5e76\u8bf7\u4e0e\u7b2c3\u7ae0\u7684 hello.s\u8fdb\u884c\u5bf9\u7167\u5206\u6790\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bf4\u660e\u673a\u5668\u8bed\u8a00\u7684\u6784\u6210&#xff0c;\u4e0e\u6c47\u7f16\u8bed\u8a00\u7684\u6620\u5c04\u5173\u7cfb\u3002\u7279\u522b\u662f\u673a\u5668\u8bed\u8a00\u4e2d\u7684\u64cd\u4f5c\u6570\u4e0e\u6c47\u7f16\u8bed\u8a00\u4e0d\u4e00\u81f4&#xff0c;\u7279\u522b\u662f\u5206\u652f\u8f6c\u79fb\u51fd\u6570\u8c03\u7528\u7b49\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.4.1\u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">objdump -d -r hello.o &gt; hello.asm<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10ogj3d0mcimg.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.4.2\u4e0ehello.s\u7684\u5bf9\u7167<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">&#xff08;1&#xff09;<img decoding=\"async\" alt=\"\" src=\"2025-06-100jpv1yyxwuk.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u64cd\u4f5c\u6570\u8868\u793a&#xff1a;\u673a\u5668\u7801\u4f7f\u7528\u4e8c\u8fdb\u5236\u7f16\u7801&#xff0c;\u6c47\u7f16\u4ee3\u7801\u4f7f\u7528\u7b26\u53f7\u5316\u64cd\u4f5c\u6570\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f8b&#xff1a;48 89 e5 \u2192 mov %rsp,%rbp&#xff08;48\u662fREX\u524d\u7f00&#xff0c;89\u662fMOV\u64cd\u4f5c\u7801&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5206\u652f\/\u8c03\u7528\u76ee\u6807&#xff1a;\u673a\u5668\u7801\u4e2d\u4e3a\u76f8\u5bf9\u504f\u79fb\u91cf&#xff0c;\u6c47\u7f16\u4ee3\u7801\u4e2d\u4e3a\u7b26\u53f7\u6807\u7b7e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f8b&#xff1a;e8 00 00 00 00 \u2192 call printf&#xff08;\u94fe\u63a5\u540e\u586b\u5145\u771f\u5b9e\u5730\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u6761\u4ef6\u5206\u652f&#xff08;je&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.s:<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10to1q03u53w4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.o\u53cd\u6c47\u7f16<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10v3eg3xcsrcq.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">74 19&#xff1a;je\u7684\u673a\u5668\u7801&#xff0c;19\u662f\u8df3\u8f6c\u504f\u79fb\u91cf&#xff08;0x32 &#8211; 0x19 &#061; 0x19&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;3&#xff09;\u51fd\u6570\u8c03\u7528&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">hello.s&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10vhtmy3y0dq1.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.o\u53cd\u6c47\u7f16&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10cfcn1yznfze.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">e8\u662fcall\u6307\u4ee4&#xff0c;00 00 00 00\u4e3a\u4e34\u65f6\u5360\u4f4d\u7b26&#xff08;\u94fe\u63a5\u65f6\u586b\u5145\u771f\u5b9e\u504f\u79fb&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">R_X86_64_PLT32&#xff1a;\u91cd\u5b9a\u4f4d\u6761\u76ee&#xff0c;\u6307\u793a\u94fe\u63a5\u5668\u4fee\u6b63\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;4&#xff09;\u5185\u5b58\u64cd\u4f5c\u6570&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6c47\u7f16\u4ee3\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10h2xfe1sf3h1.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u673a\u5668\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10a3jvqgqy0yv.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;5&#xff09;\u7acb\u5373\u6570<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6c47\u7f16\u4ee3\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10qtifkp01xo4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u673a\u5668\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-103der5ee31vi.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10m15mulfo0xf.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">4.5 \u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u8bb2\u89e3\u4e86\u6c47\u7f16\u7684\u57fa\u672c\u6982\u5ff5\u548c\u4f5c\u7528&#xff0c;\u4ee5Ubuntu\u7cfb\u7edf\u4e2d\u7684hello.s\u6587\u4ef6\u4e3a\u4f8b&#xff0c;\u6f14\u793a\u4e86\u5982\u4f55\u5c06\u5176\u6c47\u7f16\u4e3ahello.o\u6587\u4ef6&#xff0c;\u5e76\u6700\u7ec8\u751f\u6210ELF\u683c\u5f0f\u7684\u53ef\u6267\u884c\u6587\u4ef6hello.elf\u3002\u901a\u8fc7\u5bf9\u6bd4\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6\u548cELF\u683c\u5f0f\u6587\u4ef6&#xff0c;\u89e3\u6790\u4e86\u6587\u4ef6\u4e2d\u7684\u5404\u4e2a\u8282\u533a\u5185\u5bb9\u3002\u6b64\u5916&#xff0c;\u901a\u8fc7\u6bd4\u8f83hello.o\u7684\u53cd\u6c47\u7f16\u4ee3\u7801&#xff08;\u4fdd\u5b58\u4e3ahello.asm&#xff09;\u4e0e\u539f\u59cbhello.s\u6587\u4ef6\u7684\u5f02\u540c&#xff0c;\u6e05\u6670\u5730\u5c55\u73b0\u4e86\u6c47\u7f16\u8bed\u8a00\u5230\u673a\u5668\u8bed\u8a00\u7684\u8f6c\u6362\u8fc7\u7a0b&#xff0c;\u4ee5\u53ca\u673a\u5668\u4e3a\u94fe\u63a5\u6240\u505a\u7684\u51c6\u5907\u5de5\u4f5c\u3002<\/p>\n<h2 style=\"text-align:center\"> \u7b2c5\u7ae0 \u94fe\u63a5<\/h2>\n<h3 style=\"text-align:justify\">5.1 \u94fe\u63a5\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.1.1\u94fe\u63a5\u7684\u6982\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u7a0b\u5e8f\u7f16\u8bd1\u8fc7\u7a0b\u4e2d&#xff0c;\u94fe\u63a5&#xff08;Linking&#xff09;\u662f\u6307\u5c06\u76ee\u6807\u6587\u4ef6&#xff08;\u5982 &#096;hello.o&#096;&#xff09;\u4e0e\u6240\u9700\u7684\u5e93\u6587\u4ef6\u5408\u5e76&#xff0c;\u89e3\u6790\u7b26\u53f7\u5f15\u7528\u5e76\u751f\u6210\u6700\u7ec8\u53ef\u6267\u884c\u6587\u4ef6&#xff08;\u5982 &#096;hello&#096;&#xff09;\u7684\u8fc7\u7a0b\u3002\u5b83\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u6574\u5408\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5&#xff0c;\u89e3\u51b3\u5916\u90e8\u4f9d\u8d56&#xff0c;\u4f7f\u7a0b\u5e8f\u80fd\u6b63\u786e\u8fd0\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.1.2\u94fe\u63a5\u7684\u4f5c\u7528<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u94fe\u63a5\u7684\u4f5c\u7528\u662f\u5c06\u7f16\u8bd1\u751f\u6210\u7684\u76ee\u6807\u6587\u4ef6&#xff08;\u5982 &#096;hello.o&#096;&#xff09;\u4e0e\u5e93\u6587\u4ef6\u8fdb\u884c\u5408\u5e76&#xff0c;\u89e3\u6790\u672a\u5b9a\u4e49\u7684\u7b26\u53f7\u5f15\u7528&#xff0c;\u8c03\u6574\u5730\u5740\u5173\u7cfb&#xff0c;\u5e76\u6700\u7ec8\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6&#xff08;\u5982 &#096;hello&#096;&#xff09;&#xff0c;\u4f7f\u5176\u80fd\u591f\u88ab\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u548c\u8fd0\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:24.0000pt;text-align:justify\">\n<h3 style=\"text-align:justify\">5.2 \u5728Ubuntu\u4e0b\u94fe\u63a5\u7684\u547d\u4ee4<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">ld -o hello -dynamic-linker \/lib64\/ld-linux-x86-64.so.2 \/usr\/lib\/x86_64-linux-gnu\/crt1.o \/usr\/lib\/x86_64-linux-gnu\/crti.o hello.o \/usr\/lib\/x86_64-linux-gnu\/libc.so \/usr\/lib\/x86_64-linux-gnu\/crtn.o<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10uvjbdjbu4y3.png\" \/><\/p>\n<h3 style=\"text-align:justify\">5.3 \u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6hello\u7684\u683c\u5f0f<\/h3>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"> <img decoding=\"async\" alt=\"\" src=\"2025-06-104euxjpx0srn.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;ELF\u5934<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Magic: 7f 45 4c 46&#xff08;ELF \u6587\u4ef6\u6807\u8bc6&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7c7b\u522b: ELF64&#xff08;64\u4f4d\u683c\u5f0f&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6570\u636e: \u5c0f\u7aef\u5e8f&#xff08;Little Endian&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7c7b\u578b: EXEC&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u67b6\u6784: x86-64<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5165\u53e3\u70b9\u5730\u5740: 0x4010f0&#xff08;\u7a0b\u5e8f\u8d77\u59cb\u6267\u884c\u5730\u5740&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u5934\u8d77\u70b9\/\u5927\u5c0f: 64 \u5b57\u8282&#xff0c;\u5171 12 \u4e2a\u7a0b\u5e8f\u5934<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8282\u5934\u8d77\u70b9\/\u5927\u5c0f: 13560 \u5b57\u8282&#xff0c;\u5171 27 \u4e2a\u8282\u5934<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10aqihxscwpge.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u8282\u5934<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-1032vmq35ka2y.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10umyuwmvieby.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;3&#xff09;\u7a0b\u5e8f\u5934<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10l0h4q1qfpa1.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10sppqvwvumbx.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;4&#xff09;Dynamic section<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10l1onwdiuxha.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;5&#xff09;Symbol table<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7b26\u53f7\u8868\u4e2d\u4fdd\u5b58\u7740\u5b9a\u4f4d\u3001\u91cd\u5b9a\u4f4d\u7a0b\u5e8f\u4e2d\u7b26\u53f7\u5b9a\u4e49\u548c\u5f15\u7528\u7684\u4fe1\u606f&#xff0c;\u6240\u6709\u91cd\u5b9a\u4f4d\u9700\u8981\u5f15\u7528\u7684\u7b26\u53f7\u90fd\u5728\u5176\u4e2d\u58f0\u660e\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10sx4d10kfsr2.png\" \/><\/p>\n<h3 style=\"text-align:justify\">5.4 hello\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528edb\u52a0\u8f7dhello&#xff0c;\u67e5\u770b\u672c\u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u5404\u6bb5\u4fe1\u606f&#xff0c;\u5e76\u4e0e5.3\u5bf9\u7167\u5206\u6790\u8bf4\u660e\u3002 \u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89c2\u5bdf\u7a0b\u5e8f\u5934\u7684LOAD\u53ef\u52a0\u8f7d\u7684\u7a0b\u5e8f\u6bb5\u7684\u5730\u5740\u4e3a0x400000<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10cxapeorohaa.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528edb\u6253\u5f00hello&#xff0c;\u67e5\u770bhello\u52a0\u8f7d\u5230\u865a\u62df\u5730\u5740\u7684\u60c5\u51b5<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10lqcheko5gea.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u4ece\u5730\u57400x400000\u5f00\u59cb\u52300x401000\u88ab\u8f7d\u5165&#xff0c;\u865a\u62df\u5730\u5740\u4ece0x4000000x400f0\u7ed3\u675f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">5.5 \u94fe\u63a5\u7684\u91cd\u5b9a\u4f4d\u8fc7\u7a0b\u5206\u6790<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;\u4ee5\u4e0b\u683c\u5f0f\u81ea\u884c\u7f16\u6392&#xff0c;\u7f16\u8f91\u65f6\u5220\u9664&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">objdump -d -r hello \u5206\u6790hello\u4e0ehello.o\u7684\u4e0d\u540c&#xff0c;\u8bf4\u660e\u94fe\u63a5\u7684\u8fc7\u7a0b\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7ed3\u5408hello.o\u7684\u91cd\u5b9a\u4f4d\u9879\u76ee&#xff0c;\u5206\u6790hello\u4e2d\u5bf9\u5176\u600e\u4e48\u91cd\u5b9a\u4f4d\u7684\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.5.1\u5206\u6790hello\u4e0ehello.o\u7684\u533a\u522b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u547d\u4ee4&#xff1a;objdump -d -r hello &gt; hello1.asm\u751f\u6210\u53cd\u6c47\u7f16\u6587\u4ef6hello1.asm<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10ys5p5fvzt1d.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5bf9\u6bd4hello1.asm\u4e0ehello.asm&#xff0c;\u4e3b\u8981\u7684\u533a\u522b\u4e3a&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u51fd\u6570\u589e\u52a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ec5\u5305\u542b main \u51fd\u6570\u7684\u4ee3\u7801\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6240\u6709\u5916\u90e8\u51fd\u6570\u8c03\u7528&#xff08;\u5982 puts\u3001printf&#xff09;\u90fd\u662f\u672a\u89e3\u6790\u7684\u7b26\u53f7&#xff0c;\u901a\u8fc7 R_X86_64_PLT32 \u91cd\u5b9a\u4f4d\u6807\u8bb0\u5360\u4f4d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello1.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u589e\u52a0\u4e86\u591a\u4e2a\u8282&#xff08;section&#xff09;\u548c\u51fd\u6570&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.init&#xff1a;\u7a0b\u5e8f\u521d\u59cb\u5316\u4ee3\u7801&#xff08;_init&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.plt \u548c .plt.sec&#xff1a;\u8fc7\u7a0b\u94fe\u63a5\u8868&#xff08;PLT&#xff09;&#xff0c;\u5305\u542b\u52a8\u6001\u94fe\u63a5\u7684\u8df3\u8f6c\u903b\u8f91&#xff08;\u5982 puts&#064;plt\u3001printf&#064;plt&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.text&#xff1a;\u65b0\u589e _start&#xff08;\u7a0b\u5e8f\u5165\u53e3\u70b9&#xff09;\u548c _dl_relocate_static_pie&#xff08;PIE\u91cd\u5b9a\u4f4d\u652f\u6301&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.fini&#xff1a;\u7a0b\u5e8f\u7ec8\u6b62\u4ee3\u7801&#xff08;_fini&#xff09;<\/p>\n<li style=\"text-align:justify\">\u51fd\u6570\u8c03\u7528\u6307\u4ee4 call \u7684\u53c2\u6570\u53d8\u5316<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">call \u7684\u76ee\u6807\u5730\u5740\u662f\u4e34\u65f6\u7684 00 00 00 00&#xff0c;\u7b49\u5f85\u94fe\u63a5\u5668\u586b\u5145\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10okr0kioyypd.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528\u76f8\u5bf9\u504f\u79fb\u91cf&#xff08;\u5982 e8 00 00 00 00&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f9d\u8d56\u91cd\u5b9a\u4f4d\u6761\u76ee&#xff08;R_X86_64_PLT32&#xff09;\u5728\u94fe\u63a5\u65f6\u4fee\u6b63\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello1.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">call \u7684\u76ee\u6807\u5730\u5740\u88ab\u66ff\u6362\u4e3a PLT \u6761\u76ee\u5730\u5740&#xff08;\u901a\u8fc7 bnd jmp \u8df3\u8f6c\u5230 GOT&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10izkvccitfk2.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5730\u5740\u56fa\u5b9a\u4e3a 0x401090&#xff08;PLT \u8868\u9879&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b9e\u9645\u8c03\u7528\u903b\u8f91&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8df3\u8f6c\u5230 PLT \u8868&#xff08;\u5982 puts&#064;plt&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PLT \u901a\u8fc7 GOT&#xff08;\u5168\u5c40\u504f\u79fb\u8868&#xff09;\u52a8\u6001\u89e3\u6790\u5e93\u51fd\u6570\u5730\u5740\u3002<\/p>\n<li style=\"text-align:justify\">\u8df3\u8f6c\u6307\u4ee4\u53c2\u6570\u7684\u53d8\u5316<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8df3\u8f6c\u76ee\u6807\u4e3a\u76f8\u5bf9\u504f\u79fb\u91cf&#xff08;\u57fa\u4e8e\u5f53\u524d\u6307\u4ee4\u5730\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10cdghmpsimtb.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello1.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8df3\u8f6c\u76ee\u6807\u5730\u5740\u88ab\u4fee\u6b63\u4e3a\u7edd\u5bf9\u5730\u5740&#xff08;\u4f46\u4ecd\u7528\u76f8\u5bf9\u504f\u79fb\u7f16\u7801&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10leaygxn52w2.png\" \/><\/p>\n<li style=\"text-align:justify\">\u6570\u636e\u5f15\u7528<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6570\u636e\u5730\u5740\u7528 00 00 00 00 \u5360\u4f4d&#xff0c;\u4f9d\u8d56 R_X86_64_PC32 \u91cd\u5b9a\u4f4d\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10adre3iilw5a.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello1.asm:<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6570\u636e\u5730\u5740\u88ab\u4fee\u6b63\u4e3a\u5b9e\u9645\u5730\u5740&#xff08;PC \u76f8\u5bf9\u5bfb\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10ajdook5g4l5.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.5.2\u91cd\u5b9a\u4f4d\u8fc7\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u94fe\u63a5\u5668&#xff08;\u5982 ld&#xff09;\u7684\u5de5\u4f5c\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7b26\u53f7\u89e3\u6790&#xff08;Symbol Resolution&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u904d\u5386\u6240\u6709\u76ee\u6807\u6587\u4ef6&#xff0c;\u5efa\u7acb\u5168\u5c40\u7b26\u53f7\u8868&#xff08;\u5982 puts\u3001printf \u7684\u5730\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u679c\u627e\u4e0d\u5230\u67d0\u4e2a\u7b26\u53f7\u7684\u5b9a\u4e49&#xff0c;\u62a5\u9519&#xff08;\u5982 undefined reference to &#039;foo&#039;&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5408\u5e76\u8282\u533a&#xff08;Section Merging&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c06\u6240\u6709 .o \u6587\u4ef6\u7684 .text\u3001.data \u7b49\u8282\u533a\u5408\u5e76&#xff0c;\u5e76\u5206\u914d\u6700\u7ec8\u7684\u5185\u5b58\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u91cd\u5b9a\u4f4d\u4fee\u6b63&#xff08;Relocation Fixup&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6839\u636e\u91cd\u5b9a\u4f4d\u6761\u76ee&#xff0c;\u4fee\u6539\u4ee3\u7801\u548c\u6570\u636e\u4e2d\u7684\u5730\u5740\u5f15\u7528\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e3b\u8981\u4fee\u6b63\u4e24\u7c7b\u5185\u5bb9&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6307\u4ee4\u4e2d\u7684\u5730\u5740&#xff08;\u5982 call\u3001jmp \u7684\u76ee\u6807\u5730\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6570\u636e\u4e2d\u7684\u5730\u5740&#xff08;\u5982\u5168\u5c40\u53d8\u91cf\u7684\u6307\u9488&#xff09;\u3002<\/p>\n<h3 style=\"text-align:justify\">5.6 hello\u7684\u6267\u884c\u6d41\u7a0b<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;\u4ee5\u4e0b\u683c\u5f0f\u81ea\u884c\u7f16\u6392&#xff0c;\u7f16\u8f91\u65f6\u5220\u9664&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528gdb\/edb\u6267\u884chello&#xff0c;\u8bf4\u660e\u4ece\u52a0\u8f7dhello\u5230_start&#xff0c;\u5230call main,\u4ee5\u53ca\u7a0b\u5e8f\u7ec8\u6b62\u7684\u6240\u6709\u8fc7\u7a0b&#xff08;\u4e3b\u8981\u51fd\u6570&#xff09;\u3002\u8bf7\u5217\u51fa\u5176\u8c03\u7528\u4e0e\u8df3\u8f6c\u7684\u5404\u4e2a\u5b50\u7a0b\u5e8f\u540d\u6216\u7a0b\u5e8f\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.6.1\u6d41\u7a0b<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10gpw1y53hvms.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f00\u59cb\u6267\u884c&#xff1a;_start\u3001_libe_start_main<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6267\u884cmain:_main\u3001printf\u3001_exit\u3001_sleep\u3001getchar<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9000\u51fa&#xff1a;exit<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.6.2\u7a0b\u5e8f\u540d\u4e0e\u5730\u5740<\/p>\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u540d<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5730\u5740<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_start<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x4010f0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_libc_start_main<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x2f12271d<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">main<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x401125<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_printf<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x4010a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_sleep<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x4010e0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_getchar<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x4010b0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:218.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_exit<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:218.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">0x4010d0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">5.7 Hello\u7684\u52a8\u6001\u94fe\u63a5\u5206\u6790<\/h3>\n<h3 style=\"text-align:justify\">\u52a8\u6001\u94fe\u63a5\u662f\u4e00\u79cd\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6&#xff08;\u800c\u975e\u7f16\u8bd1\u65f6&#xff09;\u89e3\u6790\u5916\u90e8\u51fd\u6570\u548c\u53d8\u91cf\u5730\u5740\u7684\u673a\u5236\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\u901a\u8fc7 &#034;\u5ef6\u8fdf\u7ed1\u5b9a&#034;&#xff08;Lazy Binding&#xff09; \u6280\u672f&#xff0c;\u5c06\u7b26\u53f7&#xff08;\u51fd\u6570\/\u53d8\u91cf&#xff09;\u7684\u5730\u5740\u89e3\u6790\u63a8\u8fdf\u5230\u7a0b\u5e8f\u5b9e\u9645\u8c03\u7528\u65f6\u5b8c\u6210&#xff0c;\u4ece\u800c\u63d0\u9ad8\u7a0b\u5e8f\u52a0\u8f7d\u6548\u7387\u5e76\u8282\u7701\u5185\u5b58\u3002<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6839\u636ehello.elf\u6587\u4ef6\u53ef\u77e5&#xff0c;GOT\u8d77\u59cb\u8868\u4f4d\u7f6e\u4e3a&#xff1a;0x404000:<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-102bl510x3mt3.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"> <img decoding=\"async\" alt=\"\" src=\"2025-06-10qgkyoczc2b5.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7531\u56fe\u53ef\u53d1\u73b0GOT\u8868\u4f4d\u7f6e\u5728\u8c03\u7528dl_init\u4e4b\u524d0x404008\u540e\u768416\u4e2a\u5b57\u8282\u5747\u4e3a0<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10ts1qjpt45gc.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8c03\u7528\u4e86dl_init\u4e4b\u540e\u5b57\u8282\u6539\u53d8\u4e86&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u52a8\u6001\u94fe\u63a5\u7684\u5173\u952e\u673a\u5236<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1) PLT&#xff08;Procedure Linkage Table&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f5c\u7528&#xff1a;\u5145\u5f53\u8df3\u677f&#xff0c;\u6240\u6709\u5916\u90e8\u51fd\u6570\u8c03\u7528\u5148\u7ecf\u8fc7 PLT\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9996\u6b21\u8c03\u7528\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">call printf&#064;plt \u8df3\u8f6c\u5230 PLT \u6761\u76ee\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PLT \u68c0\u67e5 GOT \u8868&#xff0c;\u53d1\u73b0\u672a\u89e3\u6790&#xff0c;\u5219\u8c03\u7528\u52a8\u6001\u94fe\u63a5\u5668\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u52a8\u6001\u94fe\u63a5\u5668\u89e3\u6790 printf \u7684\u771f\u5b9e\u5730\u5740&#xff0c;\u66f4\u65b0 GOT\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8df3\u8f6c\u5230\u771f\u5b9e\u5730\u5740\u6267\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u540e\u7eed\u8c03\u7528&#xff1a;\u76f4\u63a5\u901a\u8fc7 GOT \u8df3\u8f6c&#xff0c;\u65e0\u9700\u89e3\u6790\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2) GOT&#xff08;Global Offset Table&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f5c\u7528&#xff1a;\u5b58\u50a8\u5916\u90e8\u7b26\u53f7&#xff08;\u51fd\u6570\/\u53d8\u91cf&#xff09;\u7684\u771f\u5b9e\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521d\u59cb\u5316&#xff1a;GOT \u8868\u9879\u521d\u59cb\u6307\u5411 PLT \u7684\u89e3\u6790\u903b\u8f91\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u88ab\u52a8\u6001\u94fe\u63a5\u5668\u66ff\u6362\u4e3a\u5b9e\u9645\u5730\u5740&#xff08;\u5982 0x7ffff7e3b1d0&#xff09;\u3002<\/p>\n<h3 style=\"text-align:justify\">5.8 \u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u4e86\u7a0b\u5e8f\u94fe\u63a5\u7684\u6838\u5fc3\u673a\u5236\u4e0e\u5b9e\u73b0\u8fc7\u7a0b\u3002\u9996\u5148\u4ece\u94fe\u63a5\u7684\u57fa\u672c\u539f\u7406\u5165\u624b&#xff0c;\u8be6\u7ec6\u8bb2\u89e3\u4e86\u7b26\u53f7\u89e3\u6790\u548c\u5730\u5740\u91cd\u5b9a\u4f4d\u7684\u6838\u5fc3\u529f\u80fd\u3002\u901a\u8fc7\u5b9e\u9645\u64cd\u4f5c\u6f14\u793a\u4e86\u5982\u4f55\u4f7f\u7528ld\u94fe\u63a5\u5668\u5c06\u76ee\u6807\u6587\u4ef6\u5408\u5e76\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6hello&#xff0c;\u5e76\u6df1\u5165\u5256\u6790\u4e86\u751f\u6210\u6587\u4ef6\u5728ELF\u683c\u5f0f\u4e0b\u7684\u7ec4\u7ec7\u7ed3\u6784\u3002\u501f\u52a9edb\u8c03\u8bd5\u5de5\u5177&#xff0c;\u6211\u4eec\u76f4\u89c2\u5730\u89c2\u5bdf\u4e86hello\u7a0b\u5e8f\u52a0\u8f7d\u540e\u7684\u865a\u62df\u5185\u5b58\u7a7a\u95f4\u5e03\u5c40&#xff0c;\u5305\u62ec\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u7b49\u5173\u952e\u533a\u57df\u7684\u5730\u5740\u6620\u5c04\u3002\u6700\u540e&#xff0c;\u4ee5hello\u7a0b\u5e8f\u4e3a\u7814\u7a76\u5bf9\u8c61&#xff0c;\u91cd\u70b9\u5206\u6790\u4e86\u4e09\u4e2a\u5173\u952e\u8fc7\u7a0b&#xff1a;\u91cd\u5b9a\u4f4d\u8fc7\u7a0b\u4e2d\u7b26\u53f7\u5730\u5740\u7684\u7ed1\u5b9a\u673a\u5236\u3001\u7a0b\u5e8f\u6267\u884c\u65f6\u7684\u6307\u4ee4\u6d41\u6c34\u7ebf\u5904\u7406&#xff0c;\u4ee5\u53ca\u52a8\u6001\u94fe\u63a5\u73af\u5883\u4e0bPLT\/GOT\u8868\u7684\u534f\u540c\u5de5\u4f5c\u539f\u7406\u3002\u8fd9\u4e00\u7cfb\u5217\u5206\u6790\u4ece\u7406\u8bba\u5230\u5b9e\u8df5&#xff0c;\u5b8c\u6574\u5c55\u73b0\u4e86\u7a0b\u5e8f\u4ece\u9759\u6001\u4ee3\u7801\u5230\u52a8\u6001\u8fd0\u884c\u7684\u8f6c\u6362\u94fe\u6761\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h2 style=\"text-align:center\"> \u7b2c6\u7ae0 hello\u8fdb\u7a0b\u7ba1\u7406<\/h2>\n<h3 style=\"text-align:justify\">6.1 \u8fdb\u7a0b\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.1.1\u8fdb\u7a0b\u7684\u6982\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fdb\u7a0b\u662f\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u884c\u8d44\u6e90\u5206\u914d\u548c\u8c03\u5ea6\u7684\u57fa\u672c\u5355\u4f4d&#xff0c;\u662f\u7a0b\u5e8f\u7684\u4e00\u6b21\u52a8\u6001\u6267\u884c\u8fc7\u7a0b\u3002\u5b83\u62e5\u6709\u72ec\u7acb\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u3001\u5bc4\u5b58\u5668\u72b6\u6001\u7b49\u6267\u884c\u73af\u5883&#xff0c;\u7531\u7a0b\u5e8f\u4ee3\u7801\u3001\u6570\u636e\u548c\u8fd0\u884c\u72b6\u6001&#xff08;\u5982\u7a0b\u5e8f\u8ba1\u6570\u5668\u3001\u5806\u6808\u7b49&#xff09;\u7ec4\u6210\u3002\u64cd\u4f5c\u7cfb\u7edf\u901a\u8fc7\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;PCB&#xff09;\u7ba1\u7406\u8fdb\u7a0b\u4fe1\u606f&#xff0c;\u5b9e\u73b0\u591a\u4efb\u52a1\u7684\u9694\u79bb\u4e0e\u5e76\u53d1\u6267\u884c\u3002\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u8fd0\u884c\u5728\u53d7\u4fdd\u62a4\u7684\u5185\u5b58\u7a7a\u95f4\u4e2d&#xff0c;\u901a\u8fc7\u7cfb\u7edf\u8c03\u7528\u4e0e\u5185\u6838\u4ea4\u4e92&#xff0c;\u662f\u7a0b\u5e8f\u4ece\u9759\u6001\u4ee3\u7801\u5230\u52a8\u6001\u8fd0\u884c\u7684\u5b9e\u4f53\u5316\u8868\u73b0\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.1.2\u8fdb\u7a0b\u7684\u4f5c\u7528<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fdb\u7a0b\u7684\u6838\u5fc3\u4f5c\u7528\u662f\u5b9e\u73b0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u7684\u5e76\u53d1\u6267\u884c\u4e0e\u8d44\u6e90\u9694\u79bb\u3002\u4f5c\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u8d44\u6e90\u5206\u914d\u7684\u57fa\u672c\u5355\u4f4d&#xff0c;\u8fdb\u7a0b\u4e3a\u6bcf\u4e2a\u8fd0\u884c\u4e2d\u7684\u7a0b\u5e8f\u63d0\u4f9b\u72ec\u7acb\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u3001CPU\u65f6\u95f4\u7247\u548c\u7cfb\u7edf\u8d44\u6e90&#xff08;\u5982\u6587\u4ef6\u3001\u7f51\u7edc\u7b49&#xff09;&#xff0c;\u786e\u4fdd\u591a\u4efb\u52a1\u95f4\u4e92\u4e0d\u5e72\u6270\u3002\u901a\u8fc7\u8fdb\u7a0b\u8c03\u5ea6&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u9ad8\u6548\u5207\u6362CPU\u6267\u884c\u6743&#xff0c;\u5b9e\u73b0\u5b8f\u89c2\u4e0a\u7684\u5e76\u884c&#xff1b;\u540c\u65f6\u5229\u7528\u5185\u5b58\u4fdd\u62a4\u673a\u5236&#xff0c;\u9632\u6b62\u8fdb\u7a0b\u8d8a\u754c\u8bbf\u95ee&#xff0c;\u4fdd\u969c\u7cfb\u7edf\u5b89\u5168\u7a33\u5b9a\u3002\u8fdb\u7a0b\u6a21\u578b\u5c06\u9759\u6001\u7a0b\u5e8f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8f6c\u5316\u4e3a\u52a8\u6001\u6267\u884c\u7684\u5b9e\u4f53&#xff0c;\u662f\u64cd\u4f5c\u7cfb\u7edf\u5b9e\u73b0\u591a\u4efb\u52a1\u3001\u63d0\u5347\u8d44\u6e90\u5229\u7528\u7387\u7684\u5173\u952e\u673a\u5236\u3002<\/p>\n<h3 style=\"text-align:justify\">6.2 \u7b80\u8ff0\u58f3Shell-bash\u7684\u4f5c\u7528\u4e0e\u5904\u7406\u6d41\u7a0b<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.2.1\u58f3shell-bash\u7684\u4f5c\u7528<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Shell&#xff08;\u5982Bash&#xff09;\u662f\u7528\u6237\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u4ea4\u4e92\u7684\u201c\u547d\u4ee4\u89e3\u91ca\u5668\u201d&#xff0c;\u5145\u5f53\u6838\u5fc3\u6307\u4ee4\u7684\u7ffb\u8bd1\u4e2d\u67a2\u3002\u5b83\u63d0\u4f9b\u547d\u4ee4\u884c\u754c\u9762&#xff08;CLI&#xff09;\u548c\u811a\u672c\u6267\u884c\u73af\u5883&#xff0c;\u5c06\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4&#xff08;\u5982&#096;ls&#096;\u3001&#096;gcc&#096;&#xff09;\u8f6c\u5316\u4e3a\u7cfb\u7edf\u8c03\u7528&#xff08;\u5982&#096;readdir&#096;\u3001&#096;fork\/exec&#096;&#xff09;&#xff0c;\u63a7\u5236\u8fdb\u7a0b\u7684\u521b\u5efa\u3001\u7ba1\u9053\u901a\u4fe1\u548c\u4efb\u52a1\u7ba1\u7406&#xff08;\u5982&#096;jobs&#096;\/&#096;fg&#096;&#xff09;\u3002\u540c\u65f6\u652f\u6301\u53d8\u91cf\u3001\u5faa\u73af\u7b49\u7f16\u7a0b\u529f\u80fd&#xff0c;\u5b9e\u73b0\u81ea\u52a8\u5316\u64cd\u4f5c&#xff0c;\u662f\u7cfb\u7edf\u7ba1\u7406\u3001\u7a0b\u5e8f\u5f00\u53d1\u548c\u65e5\u5e38\u64cd\u4f5c\u7684\u6838\u5fc3\u5165\u53e3\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.2.2\u58f3shell-bash\u7684\u5904\u7406\u6d41\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Shell&#xff08;\u5982Bash&#xff09;\u7684\u5904\u7406\u6d41\u7a0b\u5206\u4e3a\u56db\u4e2a\u6838\u5fc3\u9636\u6bb5&#xff1a;\u2460 \u8bcd\u6cd5\u89e3\u6790&#xff1a;\u5c06\u8f93\u5165\u7684\u547d\u4ee4\u884c\u62c6\u89e3\u4e3a\u4ee4\u724c&#xff08;\u5982\u547d\u4ee4\u3001\u53c2\u6570\u3001\u64cd\u4f5c\u7b26&#xff09;&#xff1b;\u2461 \u8bed\u6cd5\u89e3\u6790&#xff1a;\u6784\u5efa\u62bd\u8c61\u8bed\u6cd5\u6811&#xff08;AST&#xff09;&#xff0c;\u5904\u7406\u7ba1\u9053\u3001\u91cd\u5b9a\u5411\u7b49\u903b\u8f91\u7ed3\u6784&#xff1b;\u2462\u6269\u5c55\u66ff\u6362&#xff1a;\u6267\u884c\u53d8\u91cf\u66ff\u6362&#xff08;&#096;$var&#096;&#xff09;\u3001\u901a\u914d\u7b26\u6269\u5c55&#xff08;&#096;*.txt&#096;&#xff09;\u7b49\u9884\u5904\u7406&#xff1b;\u2463 \u6267\u884c\u63a7\u5236&#xff1a;\u6839\u636e\u547d\u4ee4\u7c7b\u578b&#xff08;\u5185\u7f6e\/\u5916\u90e8&#xff09;\u8c03\u7528&#096;fork-exec&#096;\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff0c;\u6216\u76f4\u63a5\u6267\u884c\u5185\u7f6e\u547d\u4ee4&#xff08;\u5982&#096;cd&#096;&#xff09;&#xff0c;\u5e76\u7ba1\u7406\u8fdb\u7a0b\u7ec4\u3001\u4fe1\u53f7\u548cIO\u91cd\u5b9a\u5411\u3002\u6574\u4e2a\u8fc7\u7a0b\u901a\u8fc7&#096;readline&#096;\u4ea4\u4e92\u5faa\u73af\u6301\u7eed\u63a5\u6536\u7528\u6237\u8f93\u5165&#xff0c;\u76f4\u81f3\u9000\u51fa\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">6.3 Hello\u7684fork\u8fdb\u7a0b\u521b\u5efa\u8fc7\u7a0b<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u901a\u8fc7Shell\u6267\u884c&#096;.\/hello&#096;\u65f6&#xff0c;Bash\u9996\u5148\u8c03\u7528&#096;fork()&#096;\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff0c;\u8be5\u5b50\u8fdb\u7a0b\u5b8c\u6574\u590d\u5236\u7236\u8fdb\u7a0b&#xff08;Shell&#xff09;\u7684\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u548c\u6253\u5f00\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u7b49\u8d44\u6e90&#xff1b;\u968f\u540e\u5b50\u8fdb\u7a0b\u901a\u8fc7&#096;execve()&#096;\u52a0\u8f7d&#096;hello&#096;\u7a0b\u5e8f\u7684\u4ee3\u7801\u548c\u6570\u636e&#xff0c;\u66ff\u6362\u539f\u6709\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5e76\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570&#xff08;\u5b66\u53f7\u3001\u59d3\u540d\u7b49&#xff09;\u3002\u6b64\u65f6\u65b0\u521b\u5efa\u7684\u8fdb\u7a0b\u5f00\u59cb\u72ec\u7acb\u6267\u884c&#096;main()&#096;\u51fd\u6570&#xff0c;\u7531\u64cd\u4f5c\u7cfb\u7edf\u5206\u914dPID\u5e76\u52a0\u5165\u8c03\u5ea6\u961f\u5217&#xff0c;\u800c\u7236\u8fdb\u7a0b&#xff08;Shell&#xff09;\u53ef\u901a\u8fc7&#096;wait()&#096;\u7b49\u5f85\u5b50\u8fdb\u7a0b\u7ed3\u675f\u6216\u901a\u8fc7&#096;jobs&#096;\/&#096;fg&#096;\u7ba1\u7406\u5176\u8fd0\u884c\u72b6\u6001\u3002&#096;fork()&#096;\u7684\u5199\u65f6\u590d\u5236&#xff08;COW&#xff09;\u673a\u5236\u4f18\u5316\u4e86\u8fdb\u7a0b\u521b\u5efa\u7684\u6027\u80fd\u3002<\/p>\n<h3 style=\"text-align:justify\">6.4 Hello\u7684execve\u8fc7\u7a0b<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53Shell\u901a\u8fc7&#096;fork()&#096;\u521b\u5efa\u5b50\u8fdb\u7a0b\u540e&#xff0c;\u5b50\u8fdb\u7a0b\u8c03\u7528&#096;execve(&#034;.\/hello&#034;, argv, envp)&#096;\u6267\u884c\u7a0b\u5e8f\u52a0\u8f7d&#xff1a;\u8be5\u7cfb\u7edf\u8c03\u7528\u4f1a**\u6e05\u7a7a\u539f\u8fdb\u7a0b\u7684\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u548c\u5806\u6808**&#xff0c;\u5c06\u78c1\u76d8\u4e0a\u7684&#096;hello&#096;\u53ef\u6267\u884c\u6587\u4ef6\u6620\u5c04\u5230\u8fdb\u7a0b\u5185\u5b58\u7a7a\u95f4&#xff0c;\u89e3\u6790ELF\u683c\u5f0f\u5e76\u521d\u59cb\u5316&#096;.text&#096;(\u4ee3\u7801)\u3001&#096;.data&#096;(\u6570\u636e)\u7b49\u6bb5&#xff0c;\u540c\u65f6\u8bbe\u7f6e&#096;argc\/argv&#096;\u53c2\u6570\u548c\u73af\u5883\u53d8\u91cf&#096;envp&#096;&#xff0c;\u6700\u7ec8\u8df3\u8f6c\u5230&#096;_start&#096;\u5165\u53e3\u5f00\u59cb\u6267\u884c\u7a0b\u5e8f\u903b\u8f91&#xff08;\u5982\u53c2\u6570\u6821\u9a8c\u3001\u5faa\u73af\u6253\u5370\u7b49&#xff09;\u3002\u6574\u4e2a\u8fc7\u7a0b\u5b8c\u6210\u4e86\u8fdb\u7a0b\u6267\u884c\u6620\u50cf\u7684\u5f7b\u5e95\u66ff\u6362&#xff0c;\u4f46\u4fdd\u7559\u539fPID\u548c\u6587\u4ef6\u63cf\u8ff0\u7b26\u7b49\u8d44\u6e90\u3002<\/p>\n<h3 style=\"text-align:justify\">6.5 Hello\u7684\u8fdb\u7a0b\u6267\u884c<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;\u4ee5\u4e0b\u683c\u5f0f\u81ea\u884c\u7f16\u6392&#xff0c;\u7f16\u8f91\u65f6\u5220\u9664&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello\u7a0b\u5e8f\u7684\u8fdb\u7a0b\u6267\u884c\u4e0e\u8c03\u5ea6\u8fc7\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1. \u8fdb\u7a0b\u4e0a\u4e0b\u6587\u4e0e\u521d\u59cb\u5316 \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u5f53&#096;execve()&#096;\u52a0\u8f7dHello\u7a0b\u5e8f\u540e&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u5176\u6784\u5efa\u5b8c\u6574\u7684\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u5bc4\u5b58\u5668\u72b6\u6001&#xff08;RIP\u6307\u5411&#096;_start&#096;&#xff0c;RSP\u521d\u59cb\u5316\u6808\u9876&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u865a\u62df\u5185\u5b58\u6620\u5c04&#xff08;\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u6808\u6bb5&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u6587\u4ef6\u63cf\u8ff0\u7b26\u8868&#xff08;\u7ee7\u627f\u81eaShell&#xff0c;\u5982stdin\/stdout&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2. \u65f6\u95f4\u7247\u5206\u914d\u4e0e\u8c03\u5ea6<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u8fdb\u7a0b\u88ab\u52a0\u5165\u5c31\u7eea\u961f\u5217\u540e&#xff0c;\u5185\u6838\u8c03\u5ea6\u5668\u57fa\u4e8e\u65f6\u95f4\u7247\u8f6e\u8f6c\u7b56\u7565\u5206\u914dCPU\u8d44\u6e90&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u9ed8\u8ba4\u65f6\u95f4\u7247\u4e3a5-100ms&#xff08;\u53d6\u51b3\u4e8e\u5185\u6838\u914d\u7f6e&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u6bcf\u6b21\u65f6\u949f\u4e2d\u65ad&#xff08;\u598210ms&#xff09;\u89e6\u53d1\u8c03\u5ea6\u5668\u68c0\u67e5&#xff0c;\u82e5Hello\u8fdb\u7a0b\u65f6\u95f4\u7247\u8017\u5c3d\u5219\u4fdd\u5b58\u5176\u5bc4\u5b58\u5668\u72b6\u6001&#xff08;PC\/SP\u7b49&#xff09;&#xff0c;\u5207\u6362\u81f3\u5176\u4ed6\u8fdb\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3. \u7528\u6237\u6001\u4e0e\u5185\u6838\u6001\u8f6c\u6362 \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0Hello\u8fdb\u7a0b\u7684\u6267\u884c\u6d89\u53ca\u591a\u6b21\u6001\u5207\u6362&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u7cfb\u7edf\u8c03\u7528&#xff08;\u5982&#096;printf&#096;\u89e6\u53d1&#096;write()&#096;\u3001&#096;sleep()&#096;\u89e6\u53d1&#096;nanosleep()&#096;&#xff09;&#xff1a;\u901a\u8fc7&#096;syscall&#096;\u6307\u4ee4\u9677\u5165\u5185\u6838&#xff0c;\u4fdd\u5b58\u7528\u6237\u6001\u5bc4\u5b58\u5668&#xff0c;\u5207\u6362\u81f3\u5185\u6838\u6001\u6267\u884c<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u4e2d\u65ad\u5904\u7406&#xff08;\u65f6\u95f4\u7247\u5230\u671f\u3001\u952e\u76d8\u8f93\u5165&#xff09;&#xff1a;\u5f3a\u5236\u4fdd\u5b58\u4e0a\u4e0b\u6587&#xff0c;\u5185\u6838\u5904\u7406\u540e\u518d\u6062\u590d<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u8fd4\u56de\u7528\u6237\u6001&#xff1a;\u901a\u8fc7&#096;iret&#096;\u6307\u4ee4\u6062\u590d\u5bc4\u5b58\u5668&#xff0c;\u7ee7\u7eed\u6267\u884c\u7528\u6237\u4ee3\u7801<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4.\u963b\u585e\u4e0e\u5524\u9192 \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; \u5f53\u8c03\u7528&#096;sleep()&#096;\u65f6&#xff0c;\u8fdb\u7a0b\u4e3b\u52a8\u8ba9\u51faCPU&#xff0c;\u5185\u6838\u5c06\u5176\u79fb\u51fa\u5c31\u7eea\u961f\u5217&#xff0c;\u8bbe\u7f6e\u5b9a\u65f6\u5668\u5524\u9192<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#8211; &#096;getchar()&#096;\u4f7f\u8fdb\u7a0b\u963b\u585e\u4e8e\u7b49\u5f85I\/O&#xff0c;\u5f53\u7528\u6237\u8f93\u5165\u56de\u8f66\u65f6\u89e6\u53d1\u4e2d\u65ad&#xff0c;\u5185\u6838\u5524\u9192\u8fdb\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5. \u8fdb\u7a0b\u7ec8\u6b62 \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0&#096;main()&#096;\u8fd4\u56de\u540e&#xff0c;&#096;exit()&#096;\u7cfb\u7edf\u8c03\u7528\u91ca\u653e\u8fdb\u7a0b\u8d44\u6e90&#xff08;\u5185\u5b58\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff09;&#xff0c;\u7236\u8fdb\u7a0bShell\u901a\u8fc7&#096;wait()&#096;\u56de\u6536\u9000\u51fa\u72b6\u6001\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5173\u952e\u70b9&#xff1a;\u8fdb\u7a0b\u901a\u8fc7\u65f6\u95f4\u7247\u5206\u65f6\u590d\u7528CPU&#xff0c;\u5185\u6838\u901a\u8fc7\u4e0a\u4e0b\u6587\u4fdd\u5b58\/\u6062\u590d\u5b9e\u73b0\u900f\u660e\u5207\u6362&#xff0c;\u7cfb\u7edf\u8c03\u7528\/\u4e2d\u65ad\u662f\u7528\u6237\u6001\u4e0e\u5185\u6838\u6001\u4ea4\u4e92\u7684\u552f\u4e00\u5b89\u5168\u901a\u9053\u3002<\/p>\n<h3 style=\"text-align:justify\">6.6 hello\u7684\u5f02\u5e38\u4e0e\u4fe1\u53f7\u5904\u7406<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;\u4ee5\u4e0b\u683c\u5f0f\u81ea\u884c\u7f16\u6392&#xff0c;\u7f16\u8f91\u65f6\u5220\u9664&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0hello\u6267\u884c\u8fc7\u7a0b\u4e2d\u4f1a\u51fa\u73b0\u54ea\u51e0\u7c7b\u5f02\u5e38&#xff0c;\u4f1a\u4ea7\u751f\u54ea\u4e9b\u4fe1\u53f7&#xff0c;\u53c8\u600e\u4e48\u5904\u7406\u7684\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u6309\u952e\u76d8&#xff0c;\u5982\u4e0d\u505c\u4e71\u6309&#xff0c;\u5305\u62ec\u56de\u8f66&#xff0c;Ctrl-Z&#xff0c;Ctrl-C\u7b49&#xff0c;Ctrl-z\u540e\u53ef\u4ee5\u8fd0\u884cps \u00a0jobs \u00a0pstree \u00a0fg \u00a0kill \u7b49\u547d\u4ee4&#xff0c;\u8bf7\u5206\u522b\u7ed9\u51fa\u5404\u547d\u4ee4\u53ca\u8fd0\u884c\u7ed3\u622a\u5c4f&#xff0c;\u8bf4\u660e\u5f02\u5e38\u4e0e\u4fe1\u53f7\u7684\u5904\u7406\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.6.1\u5f02\u5e38\u7684\u5206\u7c7b<\/p>\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7c7b\u522b<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u539f\u56e0<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f02\u6b65\/\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fd4\u56de\u884c\u4e3a<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e2d\u65ad<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6765\u81eaI\/O\u8bbe\u5907\u7684\u4fe1\u53f7<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f02\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u603b\u662f\u8fd4\u56de\u5230\u4e0b\u4e00\u6761\u6307\u4ee4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9677\u9631<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6709\u610f\u7684\u5f02\u5e38<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u603b\u662f\u8fd4\u56de\u5230\u4e0b\u4e00\u6761\u6307\u4ee4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6545\u969c<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6f5c\u5728\u53ef\u6062\u590d\u7684\u9519\u8bef<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u53ef\u80fd\u8fd4\u56de\u5230\u5f53\u524d\u6307\u4ee4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7ec8\u6b62<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e0d\u53ef\u6062\u590d\u7684\u9519\u8bef<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:109.0500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e0d\u4f1a\u8fd4\u56de<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.6.2\u5f02\u5e38\u7684\u5904\u7406\u65b9\u5f0f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1. \u4e2d\u65ad&#xff08;Interrupt&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e6\u53d1\u65b9\u5f0f&#xff1a;\u7531\u5916\u90e8\u786c\u4ef6\u8bbe\u5907&#xff08;\u5982\u952e\u76d8\u3001\u5b9a\u65f6\u5668\u3001\u7f51\u5361&#xff09;\u5f02\u6b65\u89e6\u53d1\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5904\u7406\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a01. CPU \u5b8c\u6210\u5f53\u524d\u6307\u4ee4\u540e&#xff0c;\u68c0\u6d4b\u5230\u4e2d\u65ad\u8bf7\u6c42&#xff08;IRQ&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a02. \u4fdd\u5b58\u5f53\u524d\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff08;PC\u3001\u5bc4\u5b58\u5668\u7b49&#xff09;&#xff0c;\u5207\u6362\u5230\u5185\u6838\u6001\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a03. \u6839\u636e\u4e2d\u65ad\u5411\u91cf\u53f7\u8df3\u8f6c\u5230\u5bf9\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f&#xff08;\u5982 &#096;0x80&#096; \u4e3a\u7cfb\u7edf\u8c03\u7528&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a04. \u6267\u884c\u4e2d\u65ad\u670d\u52a1\u4f8b\u7a0b&#xff08;\u5982\u8bfb\u53d6\u952e\u76d8\u8f93\u5165\u3001\u66f4\u65b0\u7cfb\u7edf\u65f6\u949f&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a05. \u6062\u590d\u88ab\u4e2d\u65ad\u7684\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff0c;\u8fd4\u56de\u7528\u6237\u6001\u7ee7\u7eed\u6267\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7279\u70b9&#xff1a;\u5f02\u6b65\u53d1\u751f&#xff0c;\u4e0e\u5f53\u524d\u6307\u4ee4\u65e0\u5173&#xff0c;\u901a\u5e38\u7528\u4e8e\u5904\u7406I\/O\u4e8b\u4ef6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2. \u9677\u9631&#xff08;Trap&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e6\u53d1\u65b9\u5f0f&#xff1a;\u7a0b\u5e8f\u4e3b\u52a8\u901a\u8fc7\u6307\u4ee4&#xff08;\u5982 &#096;syscall&#096;\u3001&#096;int 0x80&#096;&#xff09;\u89e6\u53d1\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5904\u7406\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a01. \u6267\u884c\u9677\u9631\u6307\u4ee4\u540e&#xff0c;CPU \u4fdd\u5b58\u4e0a\u4e0b\u6587\u5e76\u5207\u6362\u5230\u5185\u6838\u6001\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a02. \u6839\u636e\u9677\u9631\u53f7\u8c03\u7528\u5bf9\u5e94\u7684\u5185\u6838\u670d\u52a1&#xff08;\u5982\u7cfb\u7edf\u8c03\u7528 &#096;write()&#096;&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a03. \u5185\u6838\u5b8c\u6210\u670d\u52a1\u540e&#xff0c;\u6062\u590d\u4e0a\u4e0b\u6587\u5e76\u8fd4\u56de\u5230\u9677\u9631\u540e\u7684\u4e0b\u4e00\u6761\u6307\u4ee4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7279\u70b9&#xff1a;\u540c\u6b65\u4e14\u53ef\u9884\u6d4b&#xff0c;\u7528\u4e8e\u5b9e\u73b0\u7cfb\u7edf\u8c03\u7528\u6216\u8c03\u8bd5\u65ad\u70b9&#xff08;\u5982 &#096;gdb&#096; \u7684 &#096;int3&#096;&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3. \u6545\u969c&#xff08;Fault&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e6\u53d1\u65b9\u5f0f&#xff1a;\u7531\u6307\u4ee4\u6267\u884c\u9519\u8bef\u89e6\u53d1&#xff08;\u5982\u7f3a\u9875\u5f02\u5e38\u3001\u9664\u96f6\u9519\u8bef&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5904\u7406\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a01. CPU \u68c0\u6d4b\u5230\u9519\u8bef&#xff08;\u5982\u8bbf\u95ee\u65e0\u6548\u5730\u5740&#xff09;&#xff0c;\u4fdd\u5b58\u4e0a\u4e0b\u6587\u5e76\u8fdb\u5165\u5185\u6838\u6001\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a02. \u5185\u6838\u5c1d\u8bd5\u4fee\u590d\u95ee\u9898&#xff08;\u5982\u52a0\u8f7d\u7f3a\u5931\u7684\u9875\u9762&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a03. \u82e5\u53ef\u4fee\u590d&#xff08;\u5982\u7f3a\u9875&#xff09;&#xff0c;\u91cd\u65b0\u6267\u884c\u89e6\u53d1\u6545\u969c\u7684\u6307\u4ee4&#xff1b;\u5426\u5219\u7ec8\u6b62\u8fdb\u7a0b&#xff08;\u5982\u6bb5\u9519\u8bef&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7279\u70b9&#xff1a;\u53ef\u80fd\u88ab\u4fee\u590d\u540e\u7ee7\u7eed\u6267\u884c&#xff0c;\u5178\u578b\u4f8b\u5b50\u662f\u7f3a\u9875\u5f02\u5e38&#xff08;Page Fault&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4. \u7ec8\u6b62&#xff08;Abort&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e6\u53d1\u65b9\u5f0f&#xff1a;\u786c\u4ef6\u6216\u64cd\u4f5c\u7cfb\u7edf\u68c0\u6d4b\u5230\u4e0d\u53ef\u6062\u590d\u9519\u8bef&#xff08;\u5982\u5185\u5b58\u6821\u9a8c\u5931\u8d25\u3001\u975e\u6cd5\u6307\u4ee4&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5904\u7406\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a01. CPU \u6216\u5185\u6838\u5f3a\u5236\u7ec8\u6b62\u8fdb\u7a0b&#xff0c;\u4fdd\u5b58\u9519\u8bef\u4fe1\u606f&#xff08;\u5982\u6838\u5fc3\u8f6c\u50a8 &#096;core dump&#096;&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a02. \u91ca\u653e\u8fdb\u7a0b\u8d44\u6e90&#xff08;\u5185\u5b58\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff09;&#xff0c;\u901a\u77e5\u7236\u8fdb\u7a0b&#xff08;\u901a\u8fc7 &#096;SIGSEGV&#096; \u7b49\u4fe1\u53f7&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a03. \u82e5\u4e3a\u5185\u6838\u7ea7\u9519\u8bef&#xff08;\u5982\u786c\u4ef6\u6545\u969c&#xff09;&#xff0c;\u53ef\u80fd\u89e6\u53d1\u7cfb\u7edf\u5d29\u6e83&#xff08;Kernel Panic&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7279\u70b9&#xff1a;\u4e0d\u53ef\u6062\u590d&#xff0c;\u76f4\u63a5\u7ec8\u6b62\u7a0b\u5e8f\u6216\u7cfb\u7edf\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5173\u952e\u70b9<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.\u4e2d\u65ad\u548c\u9677\u9631\u662f\u53ef\u63a7\u7684&#xff0c;\u7528\u4e8e\u6b63\u5e38\u4ea4\u4e92&#xff08;I\/O\u3001\u7cfb\u7edf\u8c03\u7528&#xff09;&#xff1b;**\u6545\u969c\u548c\u7ec8\u6b62\u662f\u9519\u8bef\u5904\u7406\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2.\u4e0a\u4e0b\u6587\u4fdd\u5b58&#xff1a;\u6240\u6709\u5f02\u5e38\u90fd\u4f1a\u4fdd\u5b58\u5bc4\u5b58\u5668\u72b6\u6001&#xff08;PC\u3001SP\u7b49&#xff09;&#xff0c;\u4ee5\u4fbf\u6062\u590d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.\u7279\u6743\u7ea7\u5207\u6362&#xff1a;\u9664\u7ec8\u6b62\u5916&#xff0c;\u5176\u4ed6\u5f02\u5e38\u53ef\u80fd\u8fd4\u56de\u5230\u7528\u6237\u6001\u7ee7\u7eed\u6267\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4. \u6027\u80fd\u5f71\u54cd&#xff1a;\u7f3a\u9875\u6545\u969c&#xff08;\u9891\u7e41\u8c03\u9875&#xff09;\u548c\u4e2d\u65ad&#xff08;\u9ad8\u8d1f\u8f7dI\/O&#xff09;\u5bf9\u6027\u80fd\u6700\u654f\u611f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">6.6.3\u8fd0\u884c\u7ed3\u679c\u53ca\u76f8\u5173\u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u6b63\u5e38\u8fd0\u884c\u72b6\u6001<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10jxmbzhvgty3.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u8fd0\u884c\u65f6\u6309\u4e0bCtrl&#043;C<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"background-color:#ffffff\">\u6309\u4e0bCtrl &#043; C&#xff0c;Shell\u8fdb\u7a0b\u6536\u5230SIGINT\u4fe1\u53f7&#xff0c;Shell\u7ed3\u675f\u5e76\u56de\u6536hello\u8fdb\u7a0b\u3002<\/span><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10ufn3abyv3zq.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"background-color:#ffffff\">&#xff08;3&#xff09;\u8fd0\u884c\u65f6\u6309\u4e0bCtrl &#043; Z<\/span><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><span style=\"background-color:#ffffff\">\u6309\u4e0bCtrl &#043; Z&#xff0c;Shell\u8fdb\u7a0b\u6536\u5230SIGSTP\u4fe1\u53f7&#xff0c;Shell\u663e\u793a\u5c4f\u5e55\u63d0\u793a\u4fe1\u606f\u5e76\u6302\u8d77hello\u8fdb\u7a0b\u3002<\/span><img decoding=\"async\" alt=\"\" src=\"2025-06-105iutbn2oeap.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">&#xff08;4&#xff09;<span style=\"background-color:#ffffff\">\u5bf9hello\u8fdb\u7a0b\u7684\u6302\u8d77\u53ef\u7531ps\u548cjobs\u547d\u4ee4\u67e5\u770b&#xff0c;\u53ef\u4ee5\u53d1\u73b0hello\u8fdb\u7a0b\u786e\u5b9e\u88ab\u6302\u8d77\u800c\u975e\u88ab\u56de\u6536&#xff0c;\u4e14\u5176job\u4ee3\u53f7\u4e3a1\u3002<\/span><img decoding=\"async\" alt=\"\" src=\"2025-06-105u4n5fhz4bk.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><span style=\"background-color:#ffffff\">&#xff08;5&#xff09;\u5728Shell\u4e2d\u8f93\u5165pstree\u547d\u4ee4&#xff0c;\u53ef\u4ee5\u5c06\u6240\u6709\u8fdb\u7a0b\u4ee5\u6811\u72b6\u56fe\u663e\u793a&#xff1a;<\/span><img decoding=\"async\" alt=\"\" src=\"2025-06-10rmqfvpzvwx1.jpg\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">&#xff08;6&#xff09;<span style=\"background-color:#ffffff\">\u8f93\u5165kill\u547d\u4ee4&#xff0c;\u5219\u53ef\u4ee5\u6740\u6b7b\u6307\u5b9a&#xff08;\u8fdb\u7a0b\u7ec4\u7684&#xff09;\u8fdb\u7a0b&#xff1a;<\/span><img decoding=\"async\" alt=\"\" src=\"2025-06-10fdjh42zep1f.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><span style=\"background-color:#ffffff\">&#xff08;<\/span><span style=\"background-color:#ffffff\">7<\/span><span style=\"background-color:#ffffff\">&#xff09;<\/span><span style=\"background-color:#ffffff\">\u8f93\u5165fg 1\u5219\u547d\u4ee4\u5c06hello\u8fdb\u7a0b\u518d\u6b21\u8c03\u5230\u524d\u53f0\u6267\u884c&#xff0c;\u53ef\u4ee5\u53d1\u73b0Shell\u9996\u5148\u6253\u5370hello\u7684\u547d\u4ee4\u884c\u547d\u4ee4&#xff0c;hello\u518d\u4ece\u6302\u8d77\u5904\u7ee7\u7eed\u8fd0\u884c&#xff0c;\u6253\u5370\u5269\u4e0b\u7684\u8bed\u53e5\u3002\u7a0b\u5e8f\u4ecd\u7136\u53ef\u4ee5\u6b63\u5e38\u7ed3\u675f&#xff0c;\u5e76\u5b8c\u6210\u8fdb\u7a0b\u56de\u6536\u3002<\/span><img decoding=\"async\" alt=\"\" src=\"2025-06-10mrtu0y5si5h.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"background-color:#ffffff\">&#xff08;8&#xff09;\u4e0d\u505c\u4e71\u6309<\/span><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><span style=\"background-color:#ffffff\">\u5728\u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u4e71\u6309\u6240\u9020\u6210\u7684\u8f93\u5165\u5747\u7f13\u5b58\u5230stdin&#xff0c;\u5f53getchar\u7684\u65f6\u5019\u8bfb\u51fa\u4e00\u4e2a\u2019\\\\n\u2019\u7ed3\u5c3e\u7684\u5b57\u4e32&#xff08;\u4f5c\u4e3a\u4e00\u6b21\u8f93\u5165&#xff09;&#xff0c;hello\u7ed3\u675f\u540e&#xff0c;stdin\u4e2d\u7684\u5176\u4ed6\u5b57\u4e32\u4f1a\u5f53\u505aShell\u7684\u547d\u4ee4\u884c\u8f93\u5165\u3002<\/span><img decoding=\"async\" alt=\"\" src=\"2025-06-10jse4ehzosow.png\" \/><\/p>\n<h3 style=\"text-align:justify\">6.7\u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u56f4\u7ed5\u8ba1\u7b97\u673a\u7cfb\u7edf\u4e2d\u7684\u8fdb\u7a0b\u7ba1\u7406\u548cShell\u4ea4\u4e92\u673a\u5236\u5c55\u5f00\u5206\u6790\u3002\u9996\u5148\u4ee5Hello\u7a0b\u5e8f\u4e3a\u7814\u7a76\u5bf9\u8c61&#xff0c;\u7cfb\u7edf\u9610\u8ff0\u4e86\u8fdb\u7a0b\u4f5c\u4e3a\u6267\u884c\u5b9e\u4f53\u7684\u6838\u5fc3\u7279\u6027\u53ca\u5176\u5728\u8d44\u6e90\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u4e2d\u7684\u5173\u952e\u4f5c\u7528&#xff0c;\u540c\u65f6\u89e3\u6790\u4e86Shell\u4f5c\u4e3a\u7528\u6237\u4e0e\u5185\u6838\u4e2d\u4ecb\u7684\u6307\u4ee4\u89e3\u6790\u4e0e\u4efb\u52a1\u8c03\u5ea6\u529f\u80fd\u3002\u901a\u8fc7\u6280\u672f\u62c6\u89e3&#xff0c;\u8be6\u7ec6\u5c55\u793a\u4e86\u8be5\u7a0b\u5e8f\u4ecefork\u521b\u5efa\u8fdb\u7a0b\u3001execve\u52a0\u8f7d\u955c\u50cf\u5230CPU\u65f6\u95f4\u7247\u8f6e\u8f6c\u8c03\u5ea6\u7684\u5b8c\u6574\u751f\u547d\u5468\u671f&#xff0c;\u5305\u62ec\u4e0a\u4e0b\u6587\u5207\u6362\u548c\u7528\u6237\u6001\/\u5185\u6838\u6001\u8f6c\u6362\u7b49\u5e95\u5c42\u7ec6\u8282\u3002\u6700\u540e&#xff0c;\u9488\u5bf9\u7a0b\u5e8f\u8fd0\u884c\u4e2d\u53ef\u80fd\u89e6\u53d1\u7684\u5916\u90e8\u4e2d\u65ad&#xff08;\u5982Ctrl-C&#xff09;\u3001\u540c\u6b65\u9677\u9631&#xff08;\u7cfb\u7edf\u8c03\u7528&#xff09;\u53ca\u81f4\u547d\u6545\u969c&#xff08;\u6bb5\u9519\u8bef&#xff09;\u7b49\u5f02\u5e38\u573a\u666f&#xff0c;\u7ed3\u5408\u5177\u4f53\u8f93\u5165\u54cd\u5e94&#xff08;\u5982\u540e\u53f0\u6302\u8d77\u3001\u4fe1\u53f7\u5904\u7406&#xff09;\u8fdb\u884c\u4e86\u5206\u7c7b\u8bf4\u660e\u4e0e\u539f\u7406\u9610\u91ca\u3002<\/p>\n<h2 style=\"text-align:center\"> \u7b2c7\u7ae0 hello\u7684\u5b58\u50a8\u7ba1\u7406<\/h2>\n<h3 style=\"text-align:justify\">7.1 hello\u7684\u5b58\u50a8\u5668\u5730\u5740\u7a7a\u95f4<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.1.1\u903b\u8f91\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u4ee3\u7801\u4e2d\u76f4\u63a5\u4f7f\u7528\u7684\u5730\u5740&#xff08;\u5982main\u51fd\u6570\u6307\u9488\u3001\u53d8\u91cf\u5730\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u5206\u6bb5\u673a\u5236\u4e0b\u9700\u8f6c\u6362\u4e3a\u7ebf\u6027\u5730\u5740&#xff08;\u73b0\u4ee3\u7cfb\u7edf\u901a\u5e38\u7981\u7528\u5206\u6bb5&#xff0c;\u903b\u8f91\u5730\u5740\u76f4\u63a5\u7b49\u4e8e\u7ebf\u6027\u5730\u5740&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.1.2\u7ebf\u6027\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7ecf\u8fc7\u5206\u6bb5\u8f6c\u6362\u540e\u7684\u5730\u5740&#xff08;\u82e5\u65e0\u5206\u6bb5\u5219\u7b49\u4e8e\u903b\u8f91\u5730\u5740&#xff09;\u3002\u5728\u5206\u9875\u673a\u5236\u524d\u7edf\u4e00\u5730\u5740\u7a7a\u95f4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.1.3\u865a\u62df\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fdb\u7a0b\u89c6\u89d2\u7684\u5730\u5740\u7a7a\u95f4&#xff08;\u4e0e\u7269\u7406\u5730\u5740\u9694\u79bb&#xff09;&#xff0c;\u901a\u5e38\u7b49\u540c\u4e8e\u7ebf\u6027\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.1.4\u7269\u7406\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b9e\u9645DRAM\u5185\u5b58\u4e2d\u7684\u786c\u4ef6\u5730\u5740\u3002<\/p>\n<h3 style=\"text-align:justify\">7.2 Intel\u903b\u8f91\u5730\u5740\u5230\u7ebf\u6027\u5730\u5740\u7684\u53d8\u6362-\u6bb5\u5f0f\u7ba1\u7406<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.2.1\u57fa\u672c\u6982\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728Intel x86\u67b6\u6784\u4e2d&#xff0c;\u6bb5\u5f0f\u7ba1\u7406\u662f\u5730\u5740\u8f6c\u6362\u7684\u7b2c\u4e00\u9636\u6bb5&#xff0c;\u8d1f\u8d23\u5c06\u7a0b\u5e8f\u4f7f\u7528\u7684\u903b\u8f91\u5730\u5740&#xff08;Logical Address&#xff09;\u8f6c\u6362\u4e3a\u7ebf\u6027\u5730\u5740&#xff08;Linear Address&#xff09;\u3002\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u901a\u5e38\u7981\u7528\u6bb5\u5f0f\u7ba1\u7406&#xff08;\u5e73\u5766\u6a21\u5f0f&#xff09;&#xff0c;\u4f46\u4e86\u89e3\u5176\u673a\u5236\u5bf9\u7406\u89e3CPU\u8bbe\u8ba1\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.2.2\u903b\u8f91\u5730\u5740\u7684\u6784\u6210<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u6bb5\u9009\u62e9\u7b26&#xff08;Segment Selector&#xff09;&#xff1a;16\u4f4d&#xff0c;\u6307\u5411\u6bb5\u63cf\u8ff0\u7b26\u8868\u4e2d\u7684\u6761\u76ee\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9ad813\u4f4d&#xff1a;\u6bb5\u63cf\u8ff0\u7b26\u7d22\u5f15&#xff08;Index&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7b2c2\u4f4d&#xff1a;\u8868\u6307\u793a\u4f4d&#xff08;TI&#xff0c;0&#061;GDT&#xff0c;1&#061;LDT&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f4e2\u4f4d&#xff1a;\u8bf7\u6c42\u7279\u6743\u7ea7&#xff08;RPL&#xff09;\u3002<\/p>\n<li style=\"text-align:justify\">\u504f\u79fb\u91cf&#xff08;Offset&#xff09;&#xff1a;32\/64\u4f4d&#xff0c;\u8868\u793a\u6bb5\u5185\u5177\u4f53\u5730\u5740\u3002<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.2.3\u6bb5\u63cf\u8ff0\u7b26\u8868<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CPU\u901a\u8fc7\u4ee5\u4e0b\u4e24\u79cd\u8868\u7ba1\u7406\u6bb5&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5168\u5c40\u63cf\u8ff0\u7b26\u8868&#xff08;GDT&#xff09;&#xff1a;\u7cfb\u7edf\u7ea7\u6bb5\u5b9a\u4e49&#xff0c;\u6240\u6709\u8fdb\u7a0b\u5171\u4eab\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c40\u90e8\u63cf\u8ff0\u7b26\u8868&#xff08;LDT&#xff09;&#xff1a;\u8fdb\u7a0b\u79c1\u6709\u6bb5\u5b9a\u4e49&#xff08;\u73b0\u4ee3\u7cfb\u7edf\u5f88\u5c11\u4f7f\u7528&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6bcf\u4e2a\u6bb5\u63cf\u8ff0\u7b26&#xff08;8\u5b57\u8282&#xff09;\u5305\u542b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6bb5\u57fa\u5740&#xff08;Base Address&#xff09;&#xff1a;32\/64\u4f4d&#xff0c;\u6bb5\u7684\u8d77\u59cb\u7ebf\u6027\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6bb5\u754c\u9650&#xff08;Limit&#xff09;&#xff1a;20\u4f4d&#xff0c;\u6bb5\u7684\u6700\u5927\u504f\u79fb\u91cf\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6743\u9650\u6807\u5fd7&#xff1a;\u5982\u4ee3\u7801\/\u6570\u636e\u6bb5\u3001\u7279\u6743\u7ea7&#xff08;DPL&#xff09;\u3001\u662f\u5426\u53ef\u8bfb\u5199\u7b49\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.2.4\u8f6c\u6362\u6d41\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u903b\u8f91\u5730\u5740 \u2192 \u7ebf\u6027\u5730\u5740\u7684\u8f6c\u6362\u6b65\u9aa4&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e3\u6790\u6bb5\u9009\u62e9\u7b26&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CPU\u6839\u636eTI\u4f4d\u9009\u62e9GDT\u6216LDT\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u901a\u8fc7\u7d22\u5f15&#xff08;\u9ad813\u4f4d&#xff09;\u5b9a\u4f4d\u6bb5\u63cf\u8ff0\u7b26\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u68c0\u67e5\u6743\u9650&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6bd4\u8f83\u5f53\u524d\u7279\u6743\u7ea7&#xff08;CPL&#xff09;\u548c\u6bb5\u63cf\u8ff0\u7b26\u7684DPL\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u6743\u9650\u4e0d\u8db3&#xff08;\u5982\u7528\u6237\u6001\u8bbf\u95ee\u5185\u6838\u6bb5&#xff09;&#xff0c;\u89e6\u53d1\u901a\u7528\u4fdd\u62a4\u5f02\u5e38&#xff08;GPF&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8ba1\u7b97\u7ebf\u6027\u5730\u5740&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7ebf\u6027\u5730\u5740 &#061; \u6bb5\u57fa\u5740 &#043; \u504f\u79fb\u91cf\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u68c0\u67e5\u504f\u79fb\u91cf\u662f\u5426\u8d85\u8fc7\u6bb5\u754c\u9650&#xff0c;\u8d8a\u754c\u5219\u89e6\u53d1\u6bb5\u9519\u8bef&#xff08;#GP&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.2.5\u73b0\u4ee3\u7cfb\u7edf\u7684\u5e73\u5766\u6a21\u5f0f&#xff08;Flat Model&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e3a\u7b80\u5316\u5185\u5b58\u7ba1\u7406&#xff0c;\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf&#xff08;\u5982Linux&#xff09;\u901a\u5e38&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7981\u7528\u6bb5\u5f0f\u529f\u80fd&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6240\u6709\u6bb5\u57fa\u5740\u8bbe\u4e3a0&#xff0c;\u754c\u9650\u8bbe\u4e3a\u6700\u5927&#xff08;0xFFFFF&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u903b\u8f91\u5730\u5740\u76f4\u63a5\u7b49\u4e8e\u7ebf\u6027\u5730\u5740&#xff08;\u504f\u79fb\u91cf\u90e8\u5206&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4fdd\u7559\u5fc5\u8981\u6bb5&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CS&#xff08;\u4ee3\u7801\u6bb5&#xff09;\u3001DS&#xff08;\u6570\u636e\u6bb5&#xff09;\u7b49\u5bc4\u5b58\u5668\u4ecd\u5b58\u5728&#xff0c;\u4f46\u57fa\u5740\u4e3a0\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ec5\u7528\u4e8e\u7ef4\u62a4\u7279\u6743\u7ea7&#xff08;\u5982\u533a\u5206\u5185\u6838\/\u7528\u6237\u6001&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.2.6\u6bb5\u5f0f\u7ba1\u7406\u7684\u5b9e\u9645\u610f\u4e49<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c3d\u7ba1\u88ab\u5f31\u5316&#xff0c;\u6bb5\u5f0f\u673a\u5236\u4ecd\u7528\u4e8e&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u7279\u6743\u7ea7\u9694\u79bb&#xff1a;\u901a\u8fc7CS\/SS\u7684DPL\u9650\u5236\u4ee3\u7801\/\u6808\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u786c\u4ef6\u4efb\u52a1\u5207\u6362&#xff1a;\u65e7\u7248CPU\u901a\u8fc7TSS&#xff08;\u4efb\u52a1\u72b6\u6001\u6bb5&#xff09;\u5207\u6362\u4e0a\u4e0b\u6587\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;3&#xff09;\u517c\u5bb9\u6027&#xff1a;\u652f\u6301\u4f20\u7edf\u5b9e\u6a21\u5f0f\u4ee3\u7801\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">7.3 Hello\u7684\u7ebf\u6027\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u53d8\u6362-\u9875\u5f0f\u7ba1\u7406<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.3.1\u9875\u5f0f\u7ba1\u7406\u6838\u5fc3\u6982\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u7ebf\u6027\u5730\u5740&#xff08;\u865a\u62df\u5730\u5740&#xff09;&#xff1a;\u8fdb\u7a0b\u89c6\u89d2\u7684\u8fde\u7eed\u5730\u5740\u7a7a\u95f4&#xff08;\u5982Hello\u7684.text\u6bb5\u4f4d\u4e8e0x401000&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u7269\u7406\u5730\u5740&#xff1a;\u5b9e\u9645DRAM\u5185\u5b58\u4e2d\u7684\u786c\u4ef6\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;3&#xff09;\u9875\u8868&#xff08;Page Table&#xff09;&#xff1a;\u5b58\u50a8\u865a\u62df\u9875\u5230\u7269\u7406\u9875\u5e27\u7684\u6620\u5c04\u5173\u7cfb&#xff0c;\u7531\u64cd\u4f5c\u7cfb\u7edf\u7ef4\u62a4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.3.2\u5730\u5740\u8f6c\u6362\u6d41\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u7ebf\u6027\u5730\u5740\u62c6\u5206<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">64\u4f4d\u7ebf\u6027\u5730\u5740&#xff08;\u5b9e\u9645\u4f7f\u752848\u4f4d&#xff09;\u88ab\u5212\u5206\u4e3a\u591a\u4e2a\u5b57\u6bb5&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"vertical-align:top;width:72.6500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">63-48<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.6500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">47-39<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.6500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">38-30<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.7000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">29-21<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.7000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">20-12<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.7000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">11-0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:72.6500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4fdd\u7559<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.6500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PML4<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.6500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PDP<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.7000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PD<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.7000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PT<\/p>\n<\/td>\n<td style=\"vertical-align:top;width:72.7000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9875\u5185\u504f\u79fb<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PML4\/PDP\/PD\/PT&#xff1a;\u56db\u7ea7\u9875\u8868\u7684\u7d22\u5f15\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9875\u5185\u504f\u79fb&#xff1a;12\u4f4d&#xff0c;\u5bf9\u5e944KB\u9875\u5185\u5b57\u8282\u4f4d\u7f6e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u591a\u7ea7\u9875\u8868\u67e5\u8be2<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CPU\u4f9d\u6b21\u67e5\u8be2\u56db\u7ea7\u9875\u8868&#xff08;CR3\u5bc4\u5b58\u5668\u4fdd\u5b58\u9876\u7ea7\u9875\u8868\u7269\u7406\u5730\u5740&#xff09;&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PML4\u8868&#xff1a;\u6839\u636eCR3 &#043; PML4\u7d22\u5f15*8\u627e\u5230PDP\u8868\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PDP\u8868&#xff1a;\u6839\u636ePDP\u7d22\u5f15\u627e\u5230PD\u8868\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PD\u8868&#xff1a;\u6839\u636ePD\u7d22\u5f15\u627e\u5230PT\u8868\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PT\u8868&#xff1a;\u6839\u636ePT\u7d22\u5f15\u627e\u5230\u7269\u7406\u9875\u5e27\u53f7&#xff08;PFN&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7269\u7406\u5730\u5740&#xff1a;PFN &lt;&lt; 12 &#043; \u9875\u5185\u504f\u79fb\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;3&#xff09;TLB\u52a0\u901f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">TLB&#xff08;\u5feb\u8868&#xff09;&#xff1a;\u7f13\u5b58\u8fd1\u671f\u9875\u8868\u67e5\u8be2\u7ed3\u679c&#xff0c;\u547d\u4e2d\u65f6\u76f4\u63a5\u8fd4\u56de\u7269\u7406\u5730\u5740&#xff0c;\u65e0\u9700\u904d\u5386\u9875\u8868\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.3.3Hello\u7a0b\u5e8f\u7684\u5b9e\u9645\u9875\u8868\u573a\u666f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1) \u4ee3\u7801\u6bb5\u8bbf\u95ee&#xff08;.text&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bbf\u95ee0x401125&#xff08;main\u51fd\u6570&#xff09;&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9996\u6b21\u8bbf\u95ee\u65f6\u89e6\u53d1\u7f3a\u9875\u5f02\u5e38&#xff0c;\u5185\u6838\u4ece\u78c1\u76d8\u52a0\u8f7d\u4ee3\u7801\u9875\u5230\u7269\u7406\u5185\u5b58&#xff0c;\u66f4\u65b0\u9875\u8868\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u540e\u7eed\u8bbf\u95ee\u901a\u8fc7TLB\u76f4\u63a5\u8f6c\u6362\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2) \u6808\u7a7a\u95f4\u8bbf\u95ee<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">push %rbp\u64cd\u4f5c\u6808\u5730\u57400x7ffffffdd000&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9875\u8868\u6620\u5c04\u5230\u7269\u7406\u9875\u5e27&#xff0c;\u82e5\u672a\u5206\u914d\u5219\u89e6\u53d1\u7f3a\u9875&#xff0c;\u5185\u6838\u5206\u914d\u96f6\u9875\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(3) \u52a8\u6001\u5185\u5b58&#xff08;\u5982printf\u7f13\u51b2\u533a&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8c03\u7528printf\u65f6&#xff0c;\u5e93\u51fd\u6570\u53ef\u80fd\u4f7f\u7528\u5806\u5185\u5b58&#xff08;malloc&#xff09;&#xff0c;\u89e6\u53d1\u9875\u8868\u6269\u5c55\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.3.4 \u7f3a\u9875\u5f02\u5e38&#xff08;Page Fault&#xff09;\u5904\u7406<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u9875\u8868\u9879\u6807\u8bb0\u4e3a\u201c\u4e0d\u5b58\u5728\u201d\u6216\u6743\u9650\u4e0d\u8db3\u65f6&#xff0c;CPU\u89e6\u53d1\u7f3a\u9875\u5f02\u5e38&#xff08;#PF&#xff09;&#xff0c;\u5185\u6838\u5904\u7406\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;1&#xff09;\u68c0\u67e5\u9519\u8bef\u539f\u56e0&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u662f\u5426\u5408\u6cd5\u8bbf\u95ee&#xff08;\u975e\u6cd5\u5730\u5740\u89e6\u53d1SIGSEGV&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u662f\u5426\u56e0\u60f0\u6027\u5206\u914d&#xff08;\u5982Linux\u7684COW\u673a\u5236&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;2&#xff09;\u52a0\u8f7d\u9875\u9762&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ece\u78c1\u76d8&#xff08;\u5982Hello\u7684\u53ef\u6267\u884c\u6587\u4ef6&#xff09;\u8bfb\u53d6\u4ee3\u7801\u9875\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6216\u5206\u914d\u96f6\u9875&#xff08;\u5982\u6808\u6269\u5c55&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u66f4\u65b0\u9875\u8868\u5e76\u91cd\u8bd5\u6307\u4ee4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;3&#xff09;Hello\u4e2d\u7684\u7f3a\u9875\u573a\u666f&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9996\u6b21\u6267\u884cmain\u51fd\u6570\u65f6&#xff0c;\u4ee3\u7801\u9875\u672a\u52a0\u8f7d\u5230\u5185\u5b58\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6808\u589e\u957f\u65f6&#xff08;\u5982\u51fd\u6570\u8c03\u7528\u6df1\u5ea6\u589e\u52a0&#xff09;&#xff0c;\u9700\u5206\u914d\u65b0\u7269\u7406\u9875\u3002<\/p>\n<h3 style=\"text-align:justify\">7.4 TLB\u4e0e\u56db\u7ea7\u9875\u8868\u652f\u6301\u4e0b\u7684VA\u5230PA\u7684\u53d8\u6362<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.4.1 TLB\u67e5\u8be2&#xff08;\u786c\u4ef6\u81ea\u52a8\u5b8c\u6210&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CPU\u9996\u5148\u7528\u865a\u62df\u5730\u57400x401125\u67e5\u8be2TLB&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u547d\u4e2d&#xff1a;\u76f4\u63a5\u83b7\u53d6\u7269\u7406\u5730\u5740&#xff08;\u59820x1000125&#xff09;&#xff0c;\u65e0\u9700\u8bbf\u95ee\u9875\u8868\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u672a\u547d\u4e2d&#xff1a;\u89e6\u53d1\u9875\u8868\u904d\u5386&#xff08;Page Walk&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.4.2 \u56db\u7ea7\u9875\u8868\u904d\u5386&#xff08;Page Walk&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PML4\u8868\u67e5\u8be2&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4eceCR3\u83b7\u53d6PML4\u8868\u57fa\u5740&#xff08;\u59820x5000&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7d22\u5f15&#xff1a;(0x401125 &gt;&gt; 39) &amp; 0x1FF &#061; 0\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bbf\u95ee\u7269\u7406\u5730\u57400x5000 &#043; 0*8 &#061; 0x5000&#xff0c;\u83b7\u53d6PDP\u8868\u57fa\u5740&#xff08;\u59820x6000&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PDP\u8868\u67e5\u8be2&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7d22\u5f15&#xff1a;(0x401125 &gt;&gt; 30) &amp; 0x1FF &#061; 0\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bbf\u95ee0x6000 &#043; 0*8 &#061; 0x6000&#xff0c;\u83b7\u53d6PD\u8868\u57fa\u5740&#xff08;\u59820x7000&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PD\u8868\u67e5\u8be2&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7d22\u5f15&#xff1a;(0x401125 &gt;&gt; 21) &amp; 0x1FF &#061; 1\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bbf\u95ee0x7000 &#043; 1*8 &#061; 0x7008&#xff0c;\u83b7\u53d6PT\u8868\u57fa\u5740&#xff08;\u59820x8000&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">PT\u8868\u67e5\u8be2&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7d22\u5f15&#xff1a;(0x401125 &gt;&gt; 12) &amp; 0x1FF &#061; 0\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bbf\u95ee0x8000 &#043; 0*8 &#061; 0x8000&#xff0c;\u83b7\u53d6\u7269\u7406\u9875\u5e27\u53f7&#xff08;PFN&#061;0x1000&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5408\u6210\u7269\u7406\u5730\u5740&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7269\u7406\u5730\u5740 &#061; (0x1000 &lt;&lt; 12) | (0x401125 &amp; 0xFFF) &#061; 0x1000125\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.4.3\u66f4\u65b0TLB<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c060x401125\u21920x1000125\u7684\u6620\u5c04\u5b58\u5165TLB&#xff0c;\u52a0\u901f\u540e\u7eed\u8bbf\u95ee\u3002<\/p>\n<h3 style=\"text-align:justify\">7.5 \u4e09\u7ea7Cache\u652f\u6301\u4e0b\u7684\u7269\u7406\u5185\u5b58\u8bbf\u95ee<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ee5\u8bfb\u53d6printf\u7684\u683c\u5f0f\u5316\u5b57\u7b26\u4e32&#034;Hello %s\\\\n&#034;&#xff08;\u7269\u7406\u5730\u57400x1000125&#xff09;\u4e3a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.5.1 Cache\u67e5\u8be2\u987a\u5e8f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">L1 Cache&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CPU\u9996\u5148\u67e5\u8be2L1\u6570\u636e\u7f13\u5b58&#xff08;D-Cache&#xff09;&#xff0c;\u7d22\u5f15\u7531\u7269\u7406\u5730\u5740\u4e2d\u95f4\u4f4d\u51b3\u5b9a&#xff08;\u59820x1000125\u7684\u4f4d[11:6]&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u547d\u4e2d&#xff1a;3\u5468\u671f\u5185\u8fd4\u56de\u6570\u636e&#xff0c;\u65e0\u9700\u8bbf\u95ee\u4e0b\u7ea7\u7f13\u5b58\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">L2 Cache&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">L1\u672a\u547d\u4e2d\u65f6\u67e5\u8be2L2&#xff0c;\u68c0\u67e5\u6807\u7b7e&#xff08;Tag&#xff09;\u662f\u5426\u5339\u914d\u7269\u7406\u5730\u5740\u9ad8\u4f4d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u547d\u4e2d&#xff1a;\u989d\u5916\u6d88\u801710\u5468\u671f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">L3 Cache&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">L2\u672a\u547d\u4e2d\u65f6\u67e5\u8be2\u5171\u4eab\u7684L3\u7f13\u5b58\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5\u547d\u4e2d&#xff1a;\u603b\u5ef6\u8fdf\u7ea630\u5468\u671f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5185\u5b58\u8bbf\u95ee&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u82e5L3\u672a\u547d\u4e2d&#xff0c;CPU\u5411\u5185\u5b58\u63a7\u5236\u5668\u53d1\u9001\u8bf7\u6c42&#xff0c;\u901a\u8fc7\u603b\u7ebf\u8bfb\u53d6DRAM&#xff0c;\u603b\u5ef6\u8fdf\u8fbe100&#043;\u5468\u671f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.5.2\u00a0\u7f13\u5b58\u884c\u586b\u5145<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5373\u4f7f\u53ea\u9700\u8bfb\u53d6&#034;Hello&#034;&#xff08;5\u5b57\u8282&#xff09;&#xff0c;CPU\u4f1a\u9884\u53d6\u6574\u4e2a64\u5b57\u8282\u7f13\u5b58\u884c&#xff08;\u542b\u76f8\u90bb\u6570\u636e&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u540e\u7eed\u8bbf\u95ee\u540c\u4e00\u7f13\u5b58\u884c\u5185\u7684\u6570\u636e&#xff08;\u5982&#034;%s\\\\n&#034;&#xff09;\u76f4\u63a5\u547d\u4e2dL1\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.5.3\u00a0\u5199\u64cd\u4f5c\u5904\u7406<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Write-Through&#xff1a;\u76f4\u63a5\u5199\u5165\u5185\u5b58&#xff08;\u8f83\u5c11\u7528&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Write-Back&#xff08;\u4e3b\u6d41&#xff09;&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello\u7684\u6808\u53d8\u91cf\u4fee\u6539&#xff08;\u5982i&#043;&#043;&#xff09;\u6682\u5b58\u4e8e\u7f13\u5b58&#xff0c;\u4ec5\u5f53\u7f13\u5b58\u884c\u88ab\u66ff\u6362\u65f6\u5199\u56de\u5185\u5b58\u3002<\/p>\n<h3 style=\"text-align:justify\">7.6 hello\u8fdb\u7a0bfork\u65f6\u7684\u5185\u5b58\u6620\u5c04<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53fork\u51fd\u6570\u88ab\u5f53\u524d\u8fdb\u7a0b\u8c03\u7528\u65f6&#xff0c;\u5185\u6838\u4e3a\u65b0\u8fdb\u7a0b\u521b\u5efa\u5404\u79cd\u6570\u636e\u7ed3\u6784&#xff0c;\u5e76\u5206\u914d\u7ed9\u5b83\u4e00\u4e2a\u552f\u4e00\u7684PID\u3002\u4e3a\u4e86\u7ed9\u8fd9\u4e2a\u65b0\u8fdb\u7a0b\u521b\u5efa\u865a\u62df\u5185\u5b58&#xff0c;\u5b83\u521b\u5efa\u4e86\u5f53\u524d\u8fdb\u7a0b\u7684mm_\u00a0struct\u3001.\u533a\u57df\u7ed3\u6784\u548c\u9875\u8868\u7684\u539f\u6837\u526f\u672c\u3002\u5f53fork\u5728\u65b0\u8fdb\u7a0b\u4e2d\u8fd4\u56de\u65f6&#xff0c;\u65b0\u8fdb\u7a0b\u73b0\u5728\u7684\u865a\u62df\u5185\u5b58\u521a\u597d\u548c\u8c03\u7528fork\u65f6\u5b58\u5728\u7684\u865a\u62df\u5185\u5b58\u76f8\u540c\u3002\u5f53\u8fd9\u4e24\u4e2a\u8fdb\u7a0b\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\u3002\u540e\u6765\u8fdb\u884c\u5199\u64cd\u4f5c\u65f6&#xff0c;\u5199\u65f6\u590d\u5236\u673a\u5236\u5c31\u4f1a\u521b\u5efa\u65b0\u9875\u9762&#xff0c;\u56e0\u6b64&#xff0c;\u4e5f\u5c31\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u4fdd\u6301\u4e86\u79c1\u6709\u5730\u5740\u7a7a\u95f4\u7684\u62bd\u8c61\u6982\u5ff5\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">7.7 hello\u8fdb\u7a0bexecve\u65f6\u7684\u5185\u5b58\u6620\u5c04<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">execve\u51fd\u6570\u8c03\u7528\u9a7b\u7559\u5728\u5185\u6838\u533a\u57df\u7684\u542f\u52a8\u52a0\u8f7d\u5668\u4ee3\u7801&#xff0c;\u5728\u5f53\u524d\u8fdb\u7a0b\u4e2d\u52a0\u8f7d\u5e76\u8fd0\u884c\u5305\u542b\u5728\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6hello\u4e2d\u7684\u7a0b\u5e8f&#xff0c;\u7528hello\u7a0b\u5e8f\u6709\u6548\u5730\u66ff\u4ee3\u4e86\u5f53\u524d\u7a0b\u5e8f\u3002\u52a0\u8f7d\u5e76\u8fd0\u884chello\u9700\u8981\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1)\u5220\u9664\u5df2\u5b58\u5728\u7684\u7528\u6237\u533a\u57df\u3002\u5220\u9664\u5f53\u524d\u8fdb\u7a0b\u865a\u62df\u5730\u5740\u7684\u7528\u6237\u90e8\u5206\u4e2d\u7684\u5df2\u5b58\u5728\u7684\u533a\u57df\u7ed3\u6784\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2)\u6620\u5c04\u79c1\u6709\u533a\u57df\u3002\u4e3a\u65b0\u7a0b\u5e8f\u7684\u4ee3\u7801\u3001\u6570\u636e\u3001.bss\u548c\u6808\u533a\u57df\u521b\u5efa\u65b0\u7684\u533a\u57df\u7ed3\u6784&#xff0c;\u6240\u6709\u8fd9\u4e9b\u65b0\u7684\u533a\u57df\u90fd\u662f\u79c1\u6709\u7684\u3001\u5199\u65f6\u590d\u5236\u7684\u3002\u4ee3\u7801\u548c\u6570\u636e\u533a\u57df\u88ab\u6620\u5c04\u4e3ahello\u6587\u4ef6\u4e2d\u7684.text\u548c.data\u533a&#xff0c;.bss\u533a\u57df\u662f\u8bf7\u6c42\u4e8c\u8fdb\u5236\u96f6\u7684&#xff0c;\u6620\u5c04\u5230\u533f\u540d\u6587\u4ef6&#xff0c;\u5176\u5927\u5c0f\u5305\u542b\u5728hello\u4e2d&#xff0c;\u6808\u548c\u5806\u5730\u5740\u4e5f\u662f\u8bf7\u6c42\u4e8c\u8fdb\u5236\u96f6\u7684&#xff0c;\u521d\u59cb\u957f\u5ea6\u4e3a\u96f6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(3)\u6620\u5c04\u5171\u4eab\u533a\u57df\u3002hello\u7a0b\u5e8f\u4e0e\u5171\u4eab\u5bf9\u8c611ibc.so\u94fe\u63a5&#xff0c;libc.so\u662f\u52a8\u6001\u94fe\u63a5\u5230\u8fd9\u4e2a\u7a0b\u5e8f\u4e2d\u7684&#xff0c;\u7136\u540e\u518d\u6620\u5c04\u5230\u7528\u6237\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4e2d\u7684\u5171\u4eab\u533a\u57df\u5185\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(4)\u8bbe\u7f6e\u7a0b\u5e8f\u8ba1\u6570\u5668\u3002execve\u505a\u7684\u6700\u540e\u4e00\u4ef6\u4e8b\u60c5\u5c31\u662f\u8bbe\u7f6e\u5f53\u524d\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u7684\u7a0b\u5e8f\u8ba1\u6570\u5668&#xff0c;\u4f7f\u4e4b\u6307\u5411\u4ee3\u7801\u533a\u57df\u7684\u5165\u53e3\u70b9\u3002<\/p>\n<h3 style=\"text-align:justify\">7.8 \u7f3a\u9875\u6545\u969c\u4e0e\u7f3a\u9875\u4e2d\u65ad\u5904\u7406<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u679c\u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u4e86\u7f3a\u9875\u6545\u969c&#xff0c;\u5219\u5185\u6838\u8c03\u7528\u7f3a\u9875\u5904\u7406\u7a0b\u5e8f\u3002\u5904\u7406\u7a0b\u5e8f\u6267\u884c\u5982\u4e0b\u6b65\u9aa4&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1)\u68c0\u67e5\u865a\u62df\u5730\u5740\u662f\u5426\u5408\u6cd5&#xff0c;\u5982\u679c\u4e0d\u5408\u6cd5\u5219\u89e6\u53d1\u4e00\u4e2a\u6bb5\u9519\u8bef&#xff0c;\u7ec8\u6b62\u8fd9\u4e2a\u8fdb\u7a0b\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2)\u68c0\u67e5\u8fdb\u7a0b\u662f\u5426\u6709\u8bfb\u3001\u5199\u6216\u6267\u884c\u8be5\u533a\u57df\u9875\u9762\u7684\u6743\u9650&#xff0c;\u5982\u679c\u4e0d\u5177\u6709\u5219\u89e6\u53d1\u4fdd\u62a4\u5f02\u5e38&#xff0c;\u7a0b\u5e8f\u7ec8\u6b62\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(3)\u4e24\u6b65\u68c0\u67e5\u90fd\u65e0\u8bef\u540e&#xff0c;\u5185\u6838\u9009\u62e9\u4e00\u4e2a\u727a\u7272\u9875\u9762&#xff0c;\u5982\u679c\u8be5\u9875\u9762\u88ab\u4fee\u6539\u8fc7\u5219\u5c06\u5176\u4ea4\u6362\u51fa\u53bb&#xff0c;\u6362\u5165\u65b0\u7684\u9875\u9762\u5e76\u66f4\u65b0\u9875\u8868\u3002\u7136\u540e\u5c06\u63a7\u5236\u8f6c\u79fb\u7ed9hello\u8fdb\u7a0b&#xff0c;\u518d\u6b21\u6267\u884c\u89e6\u53d1\u7f3a\u9875\u6545\u969c\u7684\u6307\u4ee4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h3 style=\"text-align:justify\">7.9\u52a8\u6001\u5b58\u50a8\u5206\u914d\u7ba1\u7406<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#xff08;\u4ee5\u4e0b\u683c\u5f0f\u81ea\u884c\u7f16\u6392&#xff0c;\u7f16\u8f91\u65f6\u5220\u9664&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Printf\u4f1a\u8c03\u7528malloc&#xff0c;\u8bf7\u7b80\u8ff0\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u7684\u57fa\u672c\u65b9\u6cd5\u4e0e\u7b56\u7565\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.9.1\u57fa\u672c\u7ba1\u7406\u65b9\u6cd5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1) \u663e\u5f0f\u5206\u914d\u5668&#xff08;\u5982&#096;malloc\/free&#096;&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">malloc&#xff1a;\u6839\u636e\u8bf7\u6c42\u5927\u5c0f\u5728\u5806\u4e2d\u5206\u914d\u5185\u5b58\u5757&#xff0c;\u8fd4\u56de\u6307\u9488\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2) \u5e95\u5c42\u673a\u5236<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7cfb\u7edf\u8c03\u7528&#xff1a;&#096;malloc&#096;\u6700\u7ec8\u901a\u8fc7&#096;brk&#096;\u6216&#096;mmap&#096;\u5411\u5185\u6838\u7533\u8bf7\u5185\u5b58&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">brk&#xff1a;\u8c03\u6574\u5806\u9876\u6307\u9488&#xff0c;\u6269\u5c55\u8fde\u7eed\u5806\u7a7a\u95f4&#xff08;\u9002\u5408\u5c0f\u5185\u5b58\u8bf7\u6c42&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">mmap&#xff1a;\u521b\u5efa\u533f\u540d\u5185\u5b58\u6620\u5c04&#xff08;\u9002\u5408\u5927\u5757\u5185\u5b58\u6216\u9891\u7e41\u91ca\u653e\u573a\u666f&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">7.9.2 \u5206\u914d\u7b56\u7565<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1) \u7a7a\u95f2\u94fe\u8868\u7ba1\u7406<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9690\u5f0f\u7a7a\u95f2\u94fe\u8868&#xff1a;\u901a\u8fc7\u5757\u5934\u90e8\u7684\u5143\u6570\u636e&#xff08;\u5982\u5927\u5c0f\u3001\u5206\u914d\u72b6\u6001&#xff09;\u4e32\u8054\u6240\u6709\u5757\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u663e\u5f0f\u7a7a\u95f2\u94fe\u8868&#xff1a;\u5355\u72ec\u7ef4\u62a4\u7a7a\u95f2\u5757\u94fe\u8868&#xff0c;\u52a0\u901f\u641c\u7d22&#xff08;\u5982GNU &#096;malloc&#096;&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2) \u5206\u5272\u4e0e\u5408\u5e76<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5206\u5272&#xff1a;\u82e5\u7a7a\u95f2\u5757\u8fdc\u5927\u4e8e\u8bf7\u6c42&#xff0c;\u5c06\u5176\u62c6\u5206\u4e3a\u5206\u914d\u5757&#043;\u65b0\u7a7a\u95f2\u5757\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5408\u5e76&#xff1a;\u91ca\u653e\u65f6\u68c0\u67e5\u76f8\u90bb\u5757\u662f\u5426\u7a7a\u95f2&#xff0c;\u5408\u5e76\u4e3a\u66f4\u5927\u5757&#xff08;\u51cf\u5c11\u788e\u7247&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(3) \u9002\u914d\u7b97\u6cd5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9996\u6b21\u9002\u5e94&#xff08;First Fit&#xff09;&#xff1a;\u4ece\u94fe\u8868\u5934\u90e8\u627e\u5230\u7b2c\u4e00\u4e2a\u8db3\u591f\u5927\u7684\u5757\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6700\u4f73\u9002\u5e94&#xff08;Best Fit&#xff09;&#xff1a;\u641c\u7d22\u6700\u5c0f\u5408\u9002\u7684\u5757&#xff08;\u51cf\u5c11\u6d6a\u8d39&#xff0c;\u589e\u52a0\u788e\u7247&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6700\u5dee\u9002\u5e94&#xff08;Worst Fit&#xff09;&#xff1a;\u9009\u62e9\u6700\u5927\u7684\u5757&#xff08;\u9002\u5408\u4e2d\u7b49\u5927\u5c0f\u8bf7\u6c42&#xff09;\u3002<\/p>\n<h3 style=\"text-align:justify\">7.10\u672c\u7ae0\u5c0f\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u7cfb\u7edf\u5256\u6790\u4e86hello\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u5b58\u50a8\u7ba1\u7406\u673a\u5236&#xff1a;\u9996\u5148\u4ece\u903b\u8f91\u5730\u5740\u7a7a\u95f4\u5207\u5165&#xff0c;\u8be6\u7ec6\u89e3\u6790\u4e86Intel\u5904\u7406\u5668\u7684\u6bb5\u5f0f\u5bfb\u5740\u539f\u7406\u53ca\u5176\u5728hello\u4e2d\u7684\u5b9e\u9645\u4f5c\u7528&#xff1b;\u7136\u540e\u6df1\u5165\u63a2\u8ba8\u4e86\u9875\u5f0f\u7ba1\u7406\u5728hello\u4e2d\u7684\u5177\u4f53\u5b9e\u73b0&#xff0c;\u5305\u62ec\u865a\u62df\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u8f6c\u6362\u5168\u8fc7\u7a0b\u3002\u4ee5Intel Core i7\u4e3a\u786c\u4ef6\u5e73\u53f0&#xff0c;\u5b8c\u6574\u5448\u73b0\u4e86\u4eceVA\u5230PA\u7684\u5730\u5740\u8f6c\u6362\u6d41\u6c34\u7ebf&#xff0c;\u4ee5\u53ca\u4e09\u7ea7\u7f13\u5b58\u67b6\u6784\u4e0b\u7684\u7269\u7406\u5185\u5b58\u8bbf\u95ee\u4f18\u5316\u7b56\u7565\u3002\u901a\u8fc7\u8fdb\u7a0b\u63a7\u5236\u89c6\u89d2&#xff0c;\u91cd\u70b9\u5206\u6790\u4e86fork\u7cfb\u7edf\u8c03\u7528\u65f6\u5199\u65f6\u590d\u5236\u7684\u5185\u5b58\u6620\u5c04\u673a\u5236\u3001execve\u52a0\u8f7d\u7a0b\u5e8f\u65f6\u7684\u5730\u5740\u7a7a\u95f4\u91cd\u5efa\u8fc7\u7a0b&#xff0c;\u5e76\u5bf9\u7f3a\u9875\u5f02\u5e38\u89e6\u53d1\u7684\u4e2d\u65ad\u5904\u7406\u6d41\u7a0b\u8fdb\u884c\u4e86\u6280\u672f\u62c6\u89e3&#xff0c;\u5305\u62ec\u9875\u9762\u66ff\u6362\u7b97\u6cd5\u548c\u5185\u6838\u6001\u5904\u7406\u903b\u8f91\u3002\u6700\u540e\u7ed3\u5408hello\u7684\u5b9e\u9645\u8fd0\u884c\u573a\u666f&#xff0c;\u9a8c\u8bc1\u4e86\u4e0a\u8ff0\u7406\u8bba\u5728\u771f\u5b9e\u8ba1\u7b97\u73af\u5883\u4e2d\u7684\u534f\u540c\u5de5\u4f5c\u673a\u5236\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<h2 style=\"text-align:center\">\u7ed3\u8bba<\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e00&#xff0e;Hello\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1. \u7a0b\u5e8f\u7f16\u5199\u4e0e\u7f16\u8bd1<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6e90\u7801\u5230\u6c47\u7f16&#xff1a;C\u4ee3\u7801&#xff08;&#096;hello.c&#096;&#xff09;\u7ecf\u7f16\u8bd1\u5668&#xff08;&#096;gcc&#096;&#xff09;\u8f6c\u6362\u4e3a\u6c47\u7f16\u6307\u4ee4&#xff08;&#096;hello.s&#096;&#xff09;&#xff0c;\u4fdd\u7559\u903b\u8f91\u5730\u5740\u4e0e\u7b26\u53f7\u5f15\u7528\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6c47\u7f16\u5230\u76ee\u6807\u6587\u4ef6&#xff1a;\u6c47\u7f16\u5668\u751f\u6210\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff08;&#096;hello.o&#096;&#xff09;&#xff0c;\u5305\u542b\u672a\u89e3\u6790\u7684\u7b26\u53f7\u8868\u548c\u91cd\u5b9a\u4f4d\u6761\u76ee\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9759\u6001\u94fe\u63a5&#xff1a;\u94fe\u63a5\u5668\u5408\u5e76&#096;libc&#096;\u7b49\u5e93&#xff0c;\u89e3\u6790\u7b26\u53f7&#xff0c;\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6&#xff08;&#096;hello&#096;&#xff09;&#xff0c;\u5b8c\u6210\u5730\u5740\u7ed1\u5b9a\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2. \u8fdb\u7a0b\u521b\u5efa\u4e0e\u52a0\u8f7d<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Shell\u89e3\u6790\u547d\u4ee4&#xff1a;Bash\u8c03\u7528&#096;fork()&#096;\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff0c;\u590d\u5236\u7236\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff08;COW\u4f18\u5316&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">execve\u52a0\u8f7d&#xff1a;\u6e05\u7a7a\u5b50\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4&#xff0c;\u52a0\u8f7d&#096;hello&#096;\u7684ELF\u6587\u4ef6&#xff0c;\u91cd\u5efa\u4ee3\u7801\/\u6570\u636e\/\u5806\u6808\u6bb5\u6620\u5c04\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u52a8\u6001\u94fe\u63a5&#xff1a;\u901a\u8fc7&#096;ld.so&#096;\u52a0\u8f7d\u5171\u4eab\u5e93&#xff08;\u5982&#096;libc.so&#096;&#xff09;&#xff0c;PLT\/GOT\u5b9e\u73b0\u5ef6\u8fdf\u7ed1\u5b9a\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3. \u5730\u5740\u8f6c\u6362\u4e0e\u5185\u5b58\u8bbf\u95ee<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u903b\u8f91\u2192\u7ebf\u6027\u5730\u5740&#xff1a;x86-64\u7981\u7528\u6bb5\u5f0f\u7ba1\u7406&#xff0c;\u903b\u8f91\u5730\u5740\u76f4\u63a5\u4f5c\u4e3a\u7ebf\u6027\u5730\u5740\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9875\u8868\u67e5\u8be2&#xff1a;MMU\u901a\u8fc7\u56db\u7ea7\u9875\u8868&#xff08;PML4\u2192PDP\u2192PD\u2192PT&#xff09;\u5c06VA&#xff08;\u5982&#096;0x401125&#096;&#xff09;\u8f6c\u4e3aPA\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">TLB\u52a0\u901f&#xff1a;\u7f13\u5b58\u8fd1\u671fVA\u2192PA\u6620\u5c04&#xff0c;\u51cf\u5c11\u9875\u8868\u904d\u5386\u5f00\u9500\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e09\u7ea7\u7f13\u5b58&#xff1a;L1\/L2\/L3 Cache\u5206\u5c42\u7f13\u5b58\u7269\u7406\u5185\u5b58\u6570\u636e&#xff0c;\u964d\u4f4eDRAM\u8bbf\u95ee\u5ef6\u8fdf\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">4. \u6307\u4ee4\u6267\u884c\u4e0e\u5f02\u5e38\u5904\u7406<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">CPU\u6d41\u6c34\u7ebf&#xff1a;\u6309\u53d6\u6307\u2192\u8bd1\u7801\u2192\u6267\u884c\u2192\u8bbf\u5b58\u2192\u5199\u56de\u6d41\u7a0b\u8fd0\u884c&#096;main&#096;\u51fd\u6570\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7cfb\u7edf\u8c03\u7528&#xff1a;&#096;printf&#096;\u89e6\u53d1&#096;write()&#096;&#xff0c;\u901a\u8fc7&#096;syscall&#096;\u9677\u5165\u5185\u6838&#xff0c;\u5207\u6362\u7279\u6743\u7ea7\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7f3a\u9875\u5904\u7406&#xff1a;\u8bbf\u95ee\u672a\u52a0\u8f7d\u9875\u9762\u65f6\u89e6\u53d1&#096;#PF&#096;&#xff0c;\u5185\u6838\u5206\u914d\u7269\u7406\u9875\u5e76\u66f4\u65b0\u9875\u8868\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5. \u8fdb\u7a0b\u7ec8\u6b62<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8d44\u6e90\u91ca\u653e&#xff1a;&#096;exit()&#096;\u7cfb\u7edf\u8c03\u7528\u56de\u6536\u5185\u5b58\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u7b49\u8d44\u6e90\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7236\u8fdb\u7a0b\u56de\u6536&#xff1a;Shell\u901a\u8fc7&#096;wait()&#096;\u83b7\u53d6\u5b50\u8fdb\u7a0b\u72b6\u6001\u7801\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e8c&#xff0e;\u5bf9\u8ba1\u7b97\u673a\u7cfb\u7edf\u8bbe\u8ba1\u7684\u6df1\u523b\u611f\u609f\u4e0e\u521b\u65b0\u7406\u5ff5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1. \u5206\u5c42\u62bd\u8c61\u4e0e\u534f\u540c\u4f18\u5316<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u73b0\u4ee3\u8ba1\u7b97\u673a\u7cfb\u7edf\u901a\u8fc7\u786c\u4ef6-OS-\u7f16\u8bd1\u5668\u7684\u534f\u540c\u62bd\u8c61&#xff08;\u5982\u865a\u62df\u5185\u5b58\u3001\u8fdb\u7a0b\u6a21\u578b&#xff09;&#xff0c;\u5728\u4fdd\u8bc1\u5b89\u5168\u9694\u79bb\u7684\u524d\u63d0\u4e0b&#xff0c;\u5b9e\u73b0\u9ad8\u6027\u80fd\u4e0e\u53ef\u7f16\u7a0b\u6027\u3002\u611f\u609f\u5728\u4e8e&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8de8\u5c42\u4f18\u5316&#xff1a;\u4f8b\u5982TLB\u4e0e\u9875\u8868\u786c\u4ef6\u7684\u534f\u540c\u8bbe\u8ba1&#xff0c;\u6216\u7f16\u8bd1\u5668\u5bf9\u5185\u5b58\u5e03\u5c40\u7684\u4f18\u5316&#xff08;\u5982\u7ed3\u6784\u4f53\u5bf9\u9f50&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c40\u90e8\u6027\u5229\u7528&#xff1a;Hello\u7684\u5faa\u73af\u7ed3\u6784\u5929\u7136\u5951\u5408CPU\u7f13\u5b58\u9884\u53d6\u7b56\u7565&#xff0c;\u4f53\u73b0\u7b97\u6cd5\u4e0e\u786c\u4ef6\u7684\u9ed8\u5951\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2. \u521b\u65b0\u8bbe\u8ba1\u601d\u8def<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(1) \u6df7\u5408\u5185\u5b58\u7ba1\u7406\u7b56\u7565<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u95ee\u9898&#xff1a;\u4f20\u7edfCOW\u5728\u9891\u7e41\u5199\u64cd\u4f5c\u65f6&#xff08;\u5982Hello\u521d\u59cb\u5316\u5927\u6570\u7ec4&#xff09;\u4ea7\u751f\u5927\u91cf\u9875\u590d\u5236\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521b\u65b0&#xff1a;\u5f15\u5165\u5199\u65f6\u9884\u590d\u5236&#xff08;Pre-COW&#xff09;&#xff0c;\u5728&#096;fork()&#096;\u65f6\u9884\u6d4b\u53ef\u80fd\u4fee\u6539\u7684\u9875\u9762&#xff08;\u5982\u5806\u6808&#xff09;&#xff0c;\u63d0\u524d\u590d\u5236\u9ad8\u9891\u5199\u5165\u533a&#xff0c;\u51cf\u5c11\u540e\u7eed\u7f3a\u9875\u4e2d\u65ad\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(2) \u667a\u80fd\u9875\u8868\u9884\u70ed<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u95ee\u9898&#xff1a;Hello\u9996\u6b21\u6267\u884c\u56e0\u7f3a\u9875\u5bfc\u81f4\u51b7\u542f\u52a8\u5ef6\u8fdf\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521b\u65b0&#xff1a;\u901a\u8fc7\u9759\u6001\u5206\u6790ELF\u6587\u4ef6&#xff0c;\u5728\u5185\u6838\u52a0\u8f7d\u9636\u6bb5\u9884\u586b\u5145\u9875\u8868&#xff08;\u5982&#096;.text&#096;\u6bb5&#xff09;&#xff0c;\u7ed3\u5408\u673a\u5668\u5b66\u4e60\u9884\u6d4b\u540e\u7eed\u53ef\u80fd\u8bbf\u95ee\u7684\u6570\u636e\u9875\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">(3) \u7f13\u5b58\u611f\u77e5\u7684\u5185\u5b58\u5206\u914d\u5668<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u95ee\u9898&#xff1a;&#096;printf&#096;\u7684&#096;malloc&#096;\u53ef\u80fd\u5f15\u53d1\u7f13\u5b58\u884c\u51b2\u7a81\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521b\u65b0&#xff1a;\u8bbe\u8ba1Cache-Local Allocator&#xff0c;\u6839\u636eCPU\u7f13\u5b58\u62d3\u6251&#xff08;\u5982L1\/L2\u5927\u5c0f\u3001\u5173\u8054\u5ea6&#xff09;\u5206\u914d\u5bf9\u9f50\u7684\u5185\u5b58\u5757&#xff0c;\u907f\u514d\u8de8\u7f13\u5b58\u884c\u8bbf\u95ee\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3. \u7cfb\u7edf\u9a8c\u8bc1\u65b9\u6cd5\u9769\u65b0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f62\u5f0f\u5316\u9a8c\u8bc1&#xff1a;\u7528Coq\u7b49\u5de5\u5177\u8bc1\u660eHello\u7684\u9875\u8868\u6620\u5c04\u4e0eTLB\u4e00\u81f4\u6027\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8f7b\u91cf\u7ea7\u4eff\u771f&#xff1a;\u57fa\u4e8eQEMU\u6784\u5efaHello\u7684\u5fae\u67b6\u6784\u4eff\u771f\u5668&#xff0c;\u53ef\u89c6\u5316VA\u2192PA\u8f6c\u6362\u3001\u7f13\u5b58\u547d\u4e2d\u7b49\u7ec6\u8282&#xff0c;\u8f85\u52a9\u6559\u5b66\u4e0e\u8c03\u8bd5\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e09&#xff0e;\u603b\u7ed3<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello\u867d\u5c0f&#xff0c;\u5374\u8d2f\u7a7f\u4e86\u8ba1\u7b97\u673a\u7cfb\u7edf\u7684\u6838\u5fc3\u673a\u5236\u3002\u672a\u6765\u7684\u8bbe\u8ba1\u9700\u66f4\u7d27\u5bc6\u5730\u7ed3\u5408\u786c\u4ef6\u7279\u6027&#xff08;\u5982\u5f02\u6784\u8ba1\u7b97\u3001NVM&#xff09;\u4e0e\u8f6f\u4ef6\u9700\u6c42&#xff08;\u5982AI\u5de5\u4f5c\u8d1f\u8f7d&#xff09;&#xff0c;\u5728\u5b89\u5168&#xff08;\u5982Spectre\u7f13\u89e3&#xff09;\u3001\u6027\u80fd&#xff08;\u4f4e\u5ef6\u8fdf\u5185\u5b58\u8bbf\u95ee&#xff09;\u3001\u80fd\u6548&#xff08;\u52a8\u6001\u7535\u538b\u9891\u7387\u8c03\u6574&#xff09;\u95f4\u5bfb\u6c42\u5e73\u8861\u3002\u800cHello\u8fd9\u6837\u7684\u5fae\u7f29\u6a21\u578b&#xff0c;\u6b63\u662f\u9a8c\u8bc1\u521b\u65b0\u601d\u60f3\u7684\u7406\u60f3\u8bd5\u9a8c\u7530\u3002<\/p>\n<h2 style=\"text-align:center\"> \u9644\u4ef6<\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5217\u51fa\u6240\u6709\u7684\u4e2d\u95f4\u4ea7\u7269\u7684\u6587\u4ef6\u540d&#xff0c;\u5e76\u4e88\u4ee5\u8bf4\u660e\u8d77\u4f5c\u7528\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<table align=\"center\" border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6587\u4ef6\u540d<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u529f\u80fd<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.c<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6e90\u7a0b\u5e8f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.i<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u9884\u5904\u7406\u540e\u5f97\u5230\u7684\u6587\u672c\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.s<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7f16\u8bd1\u540e\u5f97\u5230\u7684\u6c47\u7f16\u8bed\u8a00\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.o<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6c47\u7f16\u540e\u5f97\u5230\u7684\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.elf<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7528readelf\u8bfb\u53d6hello.o\u5f97\u5230\u7684ELF\u683c\u5f0f\u4fe1\u606f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.asm<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53cd\u6c47\u7f16hello.o\u5f97\u5230\u7684\u53cd\u6c47\u7f16\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello1.asm<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53cd\u6c47\u7f16hello\u53ef\u6267\u884c\u6587\u4ef6\u5f97\u5230\u7684\u53cd\u6c47\u7f16\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#ffffff;width:121.9500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello<\/p>\n<\/td>\n<td style=\"background-color:#ffffff;width:235.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<h2 style=\"text-align:center\"> \u53c2\u8003\u6587\u732e<\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[1]\u00a0Randal E.Bryant David R.O&#039;Hallaron.\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf&#xff08;\u7b2c\u4e09\u7248&#xff09;.\u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e&#xff0c;2016.<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[2] \u00a0\u00a0[\u8f6c]printf \u51fd\u6570\u5b9e\u73b0\u7684\u6df1\u5165\u5256\u6790 &#8211; Pianistx &#8211; \u535a\u5ba2\u56ed<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[3] \u00a0\u00a0printf\u80cc\u540e\u7684\u6545\u4e8b &#8211; Florian &#8211; \u535a\u5ba2\u56ed<span style=\"background-color:#ffffff\"><span style=\"color:#7f8c93\">.<\/span><\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0[4]\u00a0linux2.6 \u5185\u5b58\u7ba1\u7406\u2014\u2014\u903b\u8f91\u5730\u5740\u8f6c\u6362\u4e3a\u7ebf\u6027\u5730\u5740&#xff08;\u903b\u8f91\u5730\u5740\u3001\u7ebf\u6027\u5730\u5740\u3001\u7269\u7406\u5730\u5740\u3001\u865a\u62df\u5730\u5740&#xff09; &#8211; \u5201\u6d77\u5a01 &#8211; \u535a\u5ba2\u56ed<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e51\u6b21\uff0c\u6536\u85cf28\u6b21\u30021.1.1P2P(Program to Process)\uff1aP2P\u8fc7\u7a0b\u5c55\u73b0\u4e86\u6e90\u4ee3\u7801\u5982\u4f55\u7ecf\u7f16\u8bd1\u3001\u94fe\u63a5\u6210\u4e3a\u8fdb\u7a0b\u3002<\/p>\n","protected":false},"author":2,"featured_media":42736,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[125],"topic":[],"class_list":["post-42757","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-125"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/42757.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e51\u6b21\uff0c\u6536\u85cf28\u6b21\u30021.1.1P2P(Program to Process)\uff1aP2P\u8fc7\u7a0b\u5c55\u73b0\u4e86\u6e90\u4ee3\u7801\u5982\u4f55\u7ecf\u7f16\u8bd1\u3001\u94fe\u63a5\u6210\u4e3a\u8fdb\u7a0b\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/42757.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-10T00:55:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b0b615.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42757.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/42757.html\",\"name\":\"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-10T00:55:58+00:00\",\"dateModified\":\"2025-06-10T00:55:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/42757.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/42757.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42757.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/42757.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e51\u6b21\uff0c\u6536\u85cf28\u6b21\u30021.1.1P2P(Program to Process)\uff1aP2P\u8fc7\u7a0b\u5c55\u73b0\u4e86\u6e90\u4ee3\u7801\u5982\u4f55\u7ecf\u7f16\u8bd1\u3001\u94fe\u63a5\u6210\u4e3a\u8fdb\u7a0b\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/42757.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-10T00:55:58+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005555-6847829b0b615.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"15 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/42757.html","url":"https:\/\/www.wsisp.com\/helps\/42757.html","name":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-10T00:55:58+00:00","dateModified":"2025-06-10T00:55:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/42757.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/42757.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/42757.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=42757"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42757\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/42736"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=42757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=42757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=42757"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=42757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}