{"id":3466,"date":"2017-07-29T14:56:30","date_gmt":"2017-07-29T06:56:30","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=3466"},"modified":"2017-07-29T14:56:30","modified_gmt":"2017-07-29T06:56:30","slug":"linux%e5%90%af%e5%8a%a8%e8%bf%87%e7%a8%8b%e7%9a%84%e5%87%a0%e4%b8%aa%e9%98%b6%e6%ae%b5","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/3466.html","title":{"rendered":"Linux\u542f\u52a8\u8fc7\u7a0b\u7684\u51e0\u4e2a\u9636\u6bb5"},"content":{"rendered":"<p>=Start=<\/p>\n<h4 id=\"id-\u6a21\u677f-\u7f18\u7531\uff1a\">\u7f18\u7531\uff1a<\/h4>\n<p>\u4e4b\u524d\u6709\u5b66\u4e60\u3001\u6574\u7406\u8fc7\u76f8\u5173\u7684\u77e5\u8bc6\uff0c\u867d\u7136\u8bf4\u73b0\u5728\u57fa\u672c\u4e0a\u5929\u5929\u90fd\u5728\u548cLinux\u6253\u4ea4\u9053\uff0c\u4e0d\u8fc7\u540e\u6765\u6ca1\u6709\u4e13\u95e8\u7814\u7a76\u8fc7\u90a3\u4e9b\u77e5\u8bc6\uff0c\u518d\u52a0\u4e0a\u65f6\u95f4\u4e00\u957f\u4e00\u4e9b\u7ec6\u8282\u6027\u7684\u5185\u5bb9\u4e5f\u8bb0\u4e0d\u6e05\u695a\u4e86\uff0c\u6240\u4ee5\u60f3\u5728\u535a\u5ba2\u91cc\u9762\u518d\u603b\u7ed3\u3001\u8bb0\u5f55\u4e00\u4e0b\uff0c\u65b9\u4fbf\u4ee5\u540e\u53c2\u8003\u3002<\/p>\n<h4 id=\"id-\u6a21\u677f-\u6b63\u6587\uff1a\">\u6b63\u6587\uff1a<\/h4>\n<h5 id=\"id-\u6a21\u677f-\u53c2\u8003\u89e3\u7b54\uff1a\">\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<p>\u5728<a href=\"http:\/\/thegeekstuff.com\">thegeekstuff.com<\/a>\u91cc\u5bf9Linux\u7684\u542f\u52a8\u8fc7\u7a0b\u6709\u4e00\u4e2a\u63cf\u8ff0\uff0c\u662f\u57fa\u4e8eSysV init\u7684\uff0c\u867d\u7136\u73b0\u5728\u7684CentOS 7\u90fd\u5f00\u59cb\u4f7f\u7528systemd\u66ff\u4ee3init\u4e86\uff0c\u4f46\u5927\u4f53\u5185\u5bb9\u548c\u987a\u5e8f\u5927\u540c\u5c0f\u5f02\uff0c\u503c\u5f97\u5b66\u4e60\u3001\u53c2\u8003\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3467\" src=\"https:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2017\/07\/linux-boot-process.png\" alt=\"\" width=\"366\" height=\"354\" srcset=\"https:\/\/ixyzero.com\/wp-content\/uploads\/2017\/07\/linux-boot-process.png 366w, https:\/\/ixyzero.com\/wp-content\/uploads\/2017\/07\/linux-boot-process-300x290.png 300w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>BIOS #\u57fa\u672c\u8f93\u5165\u8f93\u51fa\u7cfb\u7edf<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">\u8fdb\u884c\u4e00\u4e9b\u7cfb\u7edf\u5b8c\u6574\u6027\u68c0\u67e5\uff08\u5f00\u673a\u81ea\u68c0\u2014\u2014Power-On Self-Test\uff09\uff1b<\/p>\n<p style=\"padding-left: 30px;\">\u641c\u7d22\u3001\u52a0\u8f7d\u3001\u6267\u884c boot loader \u7a0b\u5e8f\uff1b\uff08\u4e00\u822c\u7684\u67e5\u627e\u987a\u5e8f\u662ffloppy\u8f6f\u76d8\u3001cd-rom\u5149\u76d8\u3001hard-drive\u786c\u76d8\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u542f\u52a8\u7684\u65f6\u5019\u6309F12\u952e\u4fee\u6539\u67e5\u627e\u987a\u5e8f\uff09\uff08\u4e00\u65e6boot loader\u7a0b\u5e8f\u5df2\u7ecf\u88ab\u68c0\u6d4b\u5230\u5e76\u52a0\u8f7d\u8fdb\u5185\u5b58\u540eBIOS\u5c31\u4f1a\u5c06\u63a7\u5236\u6743\u79fb\u4ea4\u7ed9MBR\uff09<\/p>\n<p style=\"padding-left: 30px;\">\u603b\u7684\u6765\u8bf4\uff0cBIOS\u4e3b\u8981\u662f\u8d77\u52a0\u8f7d\u548c\u6267\u884cMBR boot loader\u7684\u4f5c\u7528\uff1b<\/p>\n<ul>\n<li>MBR #\u4e3b\u5f15\u5bfc\u8bb0\u5f55<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">MBR\u4e00\u822c\u4f4d\u4e8e\u53ef\u5f15\u5bfc\u78c1\u76d8\u7684\u7b2c\u4e00\u4e2a\u6247\u533a\u4e2d\uff0c\u6bd4\u8f83\u5178\u578b\u7684\u662f\/dev\/hda\u6216\/dev\/sda\uff1b<\/p>\n<p style=\"padding-left: 30px;\">MBR\u5927\u5c0f\u4e00\u822c\u4e3a512\u5b57\u8282\uff0c\u67093\u4e2a\u7ec4\u6210\u90e8\u5206\uff1a\u524d446\u5b57\u8282\u8868\u793a\u4e3b\u5f15\u5bfc\u7a0b\u5e8f\u4fe1\u606f\/\u7ed3\u6784\uff0c\u63a5\u4e0b\u6765\u768464\u5b57\u8282\u8868\u793a\u5206\u533a\u8868\u4fe1\u606f\uff0c\u6700\u540e2\u5b57\u8282\u8868\u793aMBR\u7684\u5408\u6cd5\u6027\u68c0\u67e5\u4fe1\u606f\uff1b<\/p>\n<p style=\"padding-left: 30px;\">\u5b83\u4f1a\u5305\u542b\u548cGRUB\u76f8\u5173\u7684\u4fe1\u606f\uff08\u5728\u6bd4\u8f83\u8001\u7684\u7cfb\u7edf\u4e0a\u662fLILO\uff09\uff1b<\/p>\n<p style=\"padding-left: 30px;\">\u603b\u7684\u6765\u8bf4\uff0cMBR\u4e3b\u8981\u662f\u8d77\u52a0\u8f7d\u548c\u6267\u884cGRUB boot loader\u7684\u4f5c\u7528\uff1b<\/p>\n<ul>\n<li>GRUB #\u5f15\u5bfc\u7a0b\u5e8f(Grand Unified Bootloader)<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">\u5982\u679c\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u6709\u591a\u4e2a\u5185\u6838\u955c\u50cf\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7GRUB\u9009\u62e9\u4e00\u4e2a\u6765\u6267\u884c\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5b83\u5c31\u4f1a\u52a0\u8f7d\u4e00\u4e2a\u9ed8\u8ba4\u7684\u5185\u6838\u955c\u50cf\uff1b<\/p>\n<p style=\"padding-left: 30px;\">\u603b\u7684\u6765\u8bf4\uff0cGRUB\u4e3b\u8981\u662f\u8d77\u52a0\u8f7d\u548c\u6267\u884cKernel\u548cinitrd\u955c\u50cf\u7684\u4f5c\u7528\uff1b<\/p>\n<ul>\n<li>Kernel #\u5185\u6838<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">\u6302\u8f7d\u5728grub.conf\u4e2d\u6839\u636e\u300croot=\u300d\u6307\u5b9a\u7684\u6839\u6587\u4ef6\u7cfb\u7edf\uff1b<\/p>\n<p style=\"padding-left: 30px;\">\u6267\u884c\/sbin\/init\u7a0b\u5e8f\uff1b<\/p>\n<p style=\"padding-left: 30px;\">initrd\u6307\u7684\u662fInitial RAM Disk\uff1b\u5728\u6839\u6587\u4ef6\u7cfb\u7edf\u88ab\u6302\u8f7d\u5230\u771f\u6b63\u7684\u78c1\u76d8\u4e0a\u4e4b\u524d\uff0cinitrd\u88ab\u5185\u6838\u7528\u4f5c\u4e34\u65f6\u7684\u6839\u6587\u4ef6\u7cfb\u7edf\uff1b<\/p>\n<ul>\n<li>Init #\u8d85\u7ea7\u8fdb\u7a0b<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">\u6839\u636e\/etc\/inittab\u6587\u4ef6\u7684\u5185\u5bb9\u51b3\u5b9aLinux\u7684\u8fd0\u884c\u7ea7\u522b\uff1b<\/p>\n<ul>\n<li>Runlevel #\u8fd0\u884c\u7ea7\u522b\/\u6a21\u5f0f<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">\u6839\u636e\u5b9e\u9645\u7684\u8fd0\u884c\u7ea7\u522b\u51b3\u5b9a\u6267\u884c\/etc\/rc.d\/rc*.d\/\u76ee\u5f55\u4e0b\u7684\u54ea\u4e9b\u6587\u4ef6\uff1b<\/p>\n<h5 id=\"id-\u6a21\u677f-\u53c2\u8003\u94fe\u63a5\uff1a\">\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<p>6 Stages of Linux Boot Process (Startup Sequence)<br \/>\n<a href=\"http:\/\/www.thegeekstuff.com\/2011\/02\/Linux-boot-process\/\">http:\/\/www.thegeekstuff.com\/2011\/02\/Linux-boot-process\/<\/a><\/p>\n<p>Linux pid 1 \u548c systemd<br \/>\n<a href=\"http:\/\/coolshell.cn\/articles\/17998.html\">http:\/\/coolshell.cn\/articles\/17998.html<\/a><\/p>\n<p>\u8ba1\u7b97\u673a\u662f\u5982\u4f55\u542f\u52a8\u7684\uff1f<br \/>\n<a href=\"http:\/\/www.ruanyifeng.com\/blog\/2013\/02\/booting.html\">http:\/\/www.ruanyifeng.com\/blog\/2013\/02\/booting.html<\/a><br \/>\nLinux \u7684\u542f\u52a8\u6d41\u7a0b<br \/>\n<a href=\"http:\/\/www.ruanyifeng.com\/blog\/2013\/08\/linux_boot_process.html\">http:\/\/www.ruanyifeng.com\/blog\/2013\/08\/linux_boot_process.html<\/a><\/p>\n<p>\u4e3a\u4ec0\u4e48\u4e3b\u5f15\u5bfc\u8bb0\u5f55\u7684\u5185\u5b58\u5730\u5740\u662f0x7C00\uff1f<br \/>\n<a href=\"http:\/\/www.ruanyifeng.com\/blog\/2015\/09\/0x7c00.html\">http:\/\/www.ruanyifeng.com\/blog\/2015\/09\/0x7c00.html<\/a><\/p>\n<p>\u5b9e\u73b0 Linux \u5185\u6838\u52a0\u8f7d\u7684 bash \u811a\u672c(Linux kernel initialization, translated to bash)<br \/>\n<a href=\"https:\/\/gist.githubusercontent.com\/marcan\/a2eafd605d3d6ac76eb10a7c64f736c3\/raw\/96af72eef2579e3992a83798437e1ef0995c688f\/linux.sh\">https:\/\/gist.githubusercontent.com\/marcan\/a2eafd605d3d6ac76eb10a7c64f736c3\/raw\/96af72eef2579e3992a83798437e1ef0995c688f\/linux.sh<\/a><\/p>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u4e4b\u524d\u6709\u5b66\u4e60\u3001\u6574\u7406\u8fc7\u76f8\u5173\u7684\u77e5\u8bc6\uff0c\u867d\u7136\u8bf4\u73b0\u5728\u57fa\u672c\u4e0a\u5929\u5929\u90fd\u5728\u548cLinux\u6253\u4ea4\u9053\uff0c\u4e0d\u8fc7\u540e\u6765\u6ca1\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11],"tags":[878,316,880,30,879,284],"class_list":["post-3466","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-linux","tag-bios","tag-grub","tag-init","tag-linux","tag-mbr","tag-runlevel"],"views":7817,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=3466"}],"version-history":[{"count":1,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3466\/revisions"}],"predecessor-version":[{"id":3468,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3466\/revisions\/3468"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=3466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=3466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=3466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}