{"id":364877,"date":"2024-05-21T02:26:31","date_gmt":"2024-05-21T02:26:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=364877"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T02:26:31","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=364877","title":{"rendered":"<span>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0432 \u044f\u0434\u0440\u0435 Linux<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043f\u043e\u0434 Linux. \u041d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0432 \u0441\u0435\u0442\u0438. \u041e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; \u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432. \u042d\u0442\u043e \u043c\u0430\u043b\u043e \u043a\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435. \u041d\u043e \u0430\u0432\u0442\u043e\u0440\u0443 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0438 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u0432\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0435\u043c\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0437\u043a\u0438\u0439 \u043a\u0443\u0441\u043e\u0447\u0435\u043a.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0410\u0432\u0442\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u201c\u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0430\u0442\u044c\u044f \u0441 \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443-\u0442\u043e, \u0447\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u043e\u0447\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0438\u043a\u043e\u0433\u0434\u0430\u201d. \u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f. \u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b.<\/p>\n<p>\u0413\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u0441\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043a\u043e\u0432\u044b\u0440\u044f\u043d\u0438\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0438 \u0442\u043e \u043d\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u044f\u0434\u0440\u043e<\/summary>\n<div class=\"spoiler__content\">\n<p>C\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0430, \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e\u0449\u0435\u0435 \u043d\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f embedded \u0432\u043e\u043e\u0431\u0449\u0435 \u0438 embedded linux \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438. \u0417\u0430 \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e \u043f\u0430\u043b\u044c\u0446\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u044f\u0434\u0440\u0443 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0447\u0435\u043c \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0443\u0442\u0435\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439, \u0435\u0449\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439, \u0432\u0430\u0436\u043d\u043e\u0439, \u043d\u043e \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0442\u0443\u043f\u0435\u043d\u044c\u043a\u043e\u0439.<\/p>\n<p>\u0423 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u0439\u043a\u043e\u0435 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u044f\u0434\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0442\u0430\u043c \u0443\u0436\u0435 \u0438 \u0442\u0430\u043a \u0437\u043d\u0430\u044e\u0442, \u0430 \u043f\u0438\u0441\u044c\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0433\u0430\u0439\u0434\u043b\u0430\u0439\u043d\u044b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435, \u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0440\u0435\u0448\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438 \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0438\u043a\u043e\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e \u044f\u0434\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435. \u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0447\u0438\u0441\u0442\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<\/div>\n<\/details>\n<h3>\u0421\u0435\u0442\u0430\u043f \u0434\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u043b\u0430\u0442\u0443 BeagleBone Black \u0438 Buildroot 2021.02. \u0412 \u044d\u0442\u043e\u043c \u0441\u0435\u0442\u0430\u043f\u0435 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0430\u043a\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0438 \u0441 \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0443.<\/p>\n<p>Buildroot \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0434\u0440\u043e \u0432\u0435\u0440\u0441\u0438\u0438 4.19.79. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u043d\u043e \u043e\u0431\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0430\u043c \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430, \u043d\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c\/\u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c Buildroot \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043d\u0430\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432 \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437:<br \/><code>make beaglebone_defconfig<br \/>make linux-rebuild # \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u043b\u0438 \u0432 \u044f\u0434\u0440\u0435<br \/>make<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e output\/images, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c SD-\u043a\u0430\u0440\u0442\u0443 \u0432 \u0440\u0438\u0434\u0435\u0440, \u043f\u0440\u043e\u0448\u0438\u0432\u0430\u0435\u043c \u0435\u0435:<br \/><code>sudo dd if=sdcard.img of=\/dev\/sda bs=4K # \u0438\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e<br \/>sync<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u043f\u043e\u0440\u0442\u0443 UART \u043f\u043b\u0430\u0442\u044b, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c SD-\u043a\u0430\u0440\u0442\u0443, \u043f\u043e\u0434\u0430\u0435\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043b\u0430\u0442\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433\u0438 \u044f\u0434\u0440\u0430, \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u043e\u0432 \u0432 \u043a\u043e\u0434 \u044f\u0434\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433 \u044f\u0434\u0440\u0430 (dmesg). \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<p><code>[    0.268291] OMAP GPIO hardware version 0.1<\/code><\/p>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0439\u0442\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438. \u0414\u0430\u043b\u0435\u0435 \u043f\u0443\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u044f\u0434\u0440\u0430.<\/p>\n<p>\u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <strong>init\/main.c<\/strong>:<\/p>\n<p><code>asmlinkage __visible void __init start_kernel(void)<\/code><\/p>\n<p>\u042d\u0442\u043e, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0441\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u041d\u043e \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c, \u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0432\u043e\u0442 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"cpp\">\/*  * Ok, the machine is now initialized. None of the devices  * have been touched yet, but the CPU subsystem is up and  * running, and memory and process management works.  *  * Now we can finally start doing some real work..  *\/ static void __init do_basic_setup(void) {  cpuset_init_smp(); shmem_init(); driver_init(); init_irq_proc(); do_ctors(); usermodehelper_enable(); do_initcalls(); }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u0434 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u043d\u044b\u043c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439), \u0442\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2013 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 do_initcalls(). \u0417\u043d\u0430\u0447\u0438\u0442, \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">static void __init do_initcalls(void) { int level;  for (level = 0; level &lt; ARRAY_SIZE(initcall_levels) - 1; level++) do_initcall_level(level); }  static void __init do_initcall_level(int level) { initcall_entry_t *fn;  strcpy(initcall_command_line, saved_command_line); parse_args(initcall_level_names[level],    initcall_command_line, __start___param,    __stop___param - __start___param,    level, level,    NULL, &amp;repair_env_string);  trace_initcall_level(initcall_level_names[level]); for (fn = initcall_levels[level]; fn &lt; initcall_levels[level+1]; fn++) do_one_initcall(initcall_from_entry(fn)); }<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 initcalls, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c. \u041e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"cpp\">extern initcall_entry_t __initcall_start[]; extern initcall_entry_t __initcall0_start[]; extern initcall_entry_t __initcall1_start[]; extern initcall_entry_t __initcall2_start[]; extern initcall_entry_t __initcall3_start[]; extern initcall_entry_t __initcall4_start[]; extern initcall_entry_t __initcall5_start[]; extern initcall_entry_t __initcall6_start[]; extern initcall_entry_t __initcall7_start[]; extern initcall_entry_t __initcall_end[];  static initcall_entry_t *initcall_levels[] __initdata = { __initcall0_start, __initcall1_start, __initcall2_start, __initcall3_start, __initcall4_start, __initcall5_start, __initcall6_start, __initcall7_start, __initcall_end, };  \/* Keep these in sync with initcalls in include\/linux\/init.h *\/ static char *initcall_level_names[] __initdata = { \"pure\", \"core\", \"postcore\", \"arch\", \"subsys\", \"fs\", \"device\", \"late\", };<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u044d\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0431\u0435\u0440\u0443\u0442\u0441\u044f? \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 __initcall0_start, \u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e:<\/p>\n<p><strong>arch\/arm\/kernel\/vmlinux.lds<\/strong>:<\/p>\n<pre><code>.init.data : AT(ADDR(.init.data) - 0) { KEEP(*(SORT(___kentry+*))) *(.init.data init.data.*) *(.meminit.data*) *(.init.rodata .init.rodata.*) . = ALIGN(8); __start_ftrace_events = .; KEEP(*(_ftrace_events)) __stop_ftrace_events = .; __start_ftrace_eval_maps = .; KEEP(*(_ftrace_eval_map)) __stop_ftrace_eval_maps = .; . = ALIGN(8); __start_kprobe_blacklist = .; KEEP(*(_kprobe_blacklist)) __stop_kprobe_blacklist = .; *(.meminit.rodata) . = ALIGN(8); __clk_of_table = .; KEEP(*(__clk_of_table)) KEEP(*(__clk_of_table_end)) . = ALIGN(8); __reservedmem_of_table = .; KEEP(*(__reservedmem_of_table)) KEEP(*(__reservedmem_of_table_end)) . = ALIGN(8); __timer_of_table = .; KEEP(*(__timer_of_table)) KEEP(*(__timer_of_table_end)) . = ALIGN(8); __cpu_method_of_table = .; KEEP(*(__cpu_method_of_table)) KEEP(*(__cpu_method_of_table_end)) . = ALIGN(8); __cpuidle_method_of_table = .; KEEP(*(__cpuidle_method_of_table)) KEEP(*(__cpuidle_method_of_table_end)) . = ALIGN(32); __dtb_start = .; KEEP(*(.dtb.init.rodata)) __dtb_end = .; . = ALIGN(8); __irqchip_of_table = .; KEEP(*(__irqchip_of_table)) KEEP(*(__irqchip_of_table_end)) . = ALIGN(8); __earlycon_table = .; KEEP(*(__earlycon_table)) __earlycon_table_end = .; . = ALIGN(16); __setup_start = .; KEEP(*(.init.setup)) __setup_end = .; __initcall_start = .; KEEP(*(.initcallearly.init)) __initcall0_start = .; KEEP(*(.initcall0.init)) KEEP(*(.initcall0s.init)) __initcall1_start = .; KEEP(*(.initcall1.init)) KEEP(*(.initcall1s.init)) __initcall2_start = .; KEEP(*(.initcall2.init)) KEEP(*(.initcall2s.init)) __initcall3_start = .; KEEP(*(.initcall3.init)) KEEP(*(.initcall3s.init)) __initcall4_start = .; KEEP(*(.initcall4.init)) KEEP(*(.initcall4s.init)) __initcall5_start = .; KEEP(*(.initcall5.init)) KEEP(*(.initcall5s.init)) __initcallrootfs_start = .; KEEP(*(.initcallrootfs.init)) KEEP(*(.initcallrootfss.init)) __initcall6_start = .; KEEP(*(.initcall6.init)) KEEP(*(.initcall6s.init)) __initcall7_start = .; KEEP(*(.initcall7.init)) KEEP(*(.initcall7s.init)) __initcall_end = .; __con_initcall_start = .; KEEP(*(.con_initcall.init)) __con_initcall_end = .; __security_initcall_start = .; KEEP(*(.security_initcall.init)) __security_initcall_end = .; . = ALIGN(4); __initramfs_start = .; KEEP(*(.init.ramfs)) . = ALIGN(8); KEEP(*(.init.ramfs.info)) }<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u043d\u043e \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u2013 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u041e\u043a, \u0442\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442 \u043d\u0430\u0441 \u0432 <strong>include\/linux\/init.h<\/strong>:<\/p>\n<pre><code class=\"cpp\">#define core_initcall(fn)__define_initcall(fn, 1) #define core_initcall_sync(fn)__define_initcall(fn, 1s) #define postcore_initcall(fn)__define_initcall(fn, 2) #define postcore_initcall_sync(fn)__define_initcall(fn, 2s) #define arch_initcall(fn)__define_initcall(fn, 3) #define arch_initcall_sync(fn)__define_initcall(fn, 3s) #define subsys_initcall(fn)__define_initcall(fn, 4) #define subsys_initcall_sync(fn)__define_initcall(fn, 4s) #define fs_initcall(fn)__define_initcall(fn, 5) #define fs_initcall_sync(fn)__define_initcall(fn, 5s) #define rootfs_initcall(fn)__define_initcall(fn, rootfs) #define device_initcall(fn)__define_initcall(fn, 6) #define device_initcall_sync(fn)__define_initcall(fn, 6s) #define late_initcall(fn)__define_initcall(fn, 7) #define late_initcall_sync(fn)__define_initcall(fn, 7s)  #define __initcall(fn) device_initcall(fn)<\/code><\/pre>\n<p>\u0410 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435 \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"cpp\">#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS #define ___define_initcall(fn, id, __sec)\\ __ADDRESSABLE(fn)\\ asm(\".section\\\"\" #__sec \".init\\\", \\\"a\\\"\\n\"\\ \"__initcall_\" #fn #id \":\\n\"\\     \".long\" #fn \" - .\\n\"\\     \".previous\\n\"); #else #define ___define_initcall(fn, id, __sec) \\ static initcall_t __initcall_##fn##id __used \\ __attribute__((__section__(#__sec \".init\"))) = fn; #endif  #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c \u0448\u0442\u0443\u043a\u0438 \u0442\u0438\u043f\u0430 device_initcall \u2013 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0442\u0430\u043a\u0438\u0445 \u0434\u0435\u0444\u0430\u0439\u043d\u043e\u0432, \u043a\u0430\u043a builtin_driver. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u0441\u0430\u043c \u044d\u0442\u043e\u0442 \u0434\u0435\u0444\u0430\u0439\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u0445. \u0410 \u043a\u043e\u0435-\u0433\u0434\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 __initcall.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0438\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a initcall-\u043e\u0432, \u0438 \u0434\u0435\u0440\u0433\u0430\u0435\u0442 \u0435\u0435 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 initcalls \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u0442\u0435\u043c\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041c\u0435\u0436 \u0442\u0435\u043c, \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d. \u041e\u043d \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/proninyaroslav.gitbooks.io\/linux-insides-ru\/content\/Concepts\/linux-cpu-3.html\" rel=\"noopener noreferrer nofollow\">https:\/\/proninyaroslav.gitbooks.io\/linux-insides-ru\/content\/Concepts\/linux-cpu-3.html<\/a> <\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0435\u0444\u0430\u0439\u043d module_init. \u0412\u043e\u0442 \u043a\u0430\u043a \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 <strong>kernel\/module.h<\/strong>:<\/p>\n<pre><code class=\"cpp\">#ifndef MODULE \/**  * module_init() - driver initialization entry point  * @x: function to be run at kernel boot time or module insertion  *  * module_init() will either be called during do_initcalls() (if  * builtin) or at module insertion time (if a module).  There can only  * be one per module.  *\/ #define module_init(x)__initcall(x);  \/**  * module_exit() - driver exit entry point  * @x: function to be run when driver is removed  *  * module_exit() will wrap the driver clean-up code  * with cleanup_module() when used with rmmod when  * the driver is a module.  If the driver is statically  * compiled into the kernel, module_exit() has no effect.  * There can only be one per module.  *\/ #define module_exit(x)__exitcall(x);  #else \/* MODULE *\/  \/*  * In most cases loadable modules do not need custom  * initcall levels. There are still some valid cases where  * a driver may be needed early if built in, and does not  * matter when built as a loadable module. Like bus  * snooping debug drivers.  *\/ #define early_initcall(fn)module_init(fn) #define core_initcall(fn)module_init(fn) #define core_initcall_sync(fn)module_init(fn) #define postcore_initcall(fn)module_init(fn) #define postcore_initcall_sync(fn)module_init(fn) #define arch_initcall(fn)module_init(fn) #define subsys_initcall(fn)module_init(fn) #define subsys_initcall_sync(fn)module_init(fn) #define fs_initcall(fn)module_init(fn) #define fs_initcall_sync(fn)module_init(fn) #define rootfs_initcall(fn)module_init(fn) #define device_initcall(fn)module_init(fn) #define device_initcall_sync(fn)module_init(fn) #define late_initcall(fn)module_init(fn) #define late_initcall_sync(fn)module_init(fn)  #define console_initcall(fn)module_init(fn) #define security_initcall(fn)module_init(fn)  \/* Each module must use one module_init(). *\/ #define module_init(initfn)\\ static inline initcall_t __maybe_unused __inittest(void)\\ { return initfn; }\\ int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));  \/* This is only required if you want to be unloadable. *\/ #define module_exit(exitfn)\\ static inline exitcall_t __maybe_unused __exittest(void)\\ { return exitfn; }\\ void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));  #endif<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c (\u0444\u0430\u0439\u043b .ko) \u2013 \u0443 \u043d\u0430\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0434\u0435\u0444\u0430\u0439\u043d MODULE, \u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 initcalls \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442. \u0424\u0443\u043d\u043a\u0446\u0438\u044f init_module() \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u044f (\u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435). \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u044f\u0434\u0440\u043e \u2013 \u0434\u0435\u0444\u0430\u0439\u043d MODULE \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f init \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 initcalls.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0443\u0444 \u043f\u0440\u043e MODULE<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u0434\u0435\u0444\u0430\u0439\u043d MODULE \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u0421\u0430\u043c\u044b\u043c \u0434\u0435\u0448\u0435\u0432\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 EEPROM AT24 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a:<\/p>\n<pre><code class=\"cpp\">#ifdef MODULE printk(\"%s: module built with MODULE define\\n\", __func__); #else printk(\"%s: module built without MODULE define\\n\", __func__); #endif<\/code><\/pre>\n<p>\u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 \u044f\u0434\u0440\u0430 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u2013 \u0441 \u044d\u0442\u0438\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c, \u0432\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432 \u044f\u0434\u0440\u043e, \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u0427\u0442\u043e \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<\/div>\n<\/details>\n<h3>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 *.ko<\/h3>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438\u043b\u0438 \u0432 \u0438\u043d\u0438\u0442-\u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 insmod\/modprobe.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u044f\u0434\u0440\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 uevent, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043c\u043e\u043d\u043e\u043c udev (\u0438\u043b\u0438 mdev, \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c). \u0414\u0435\u043c\u043e\u043d \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0447\u0442\u043e \u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 modprobe.<\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043a\u043e\u0434 insmod (\u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 busybox), \u0442\u0430\u043c \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435:<\/p>\n<p><strong>busybox\/modutils\/insmod.c<\/strong>:<\/p>\n<pre><code class=\"cpp\">rc = bb_init_module(filename, parse_cmdline_module_options(argv, \/*quote_spaces:*\/ 0));<\/code><\/pre>\n<p><strong>busybox\/modutils\/modutils.c<\/strong>:<\/p>\n<pre><code class=\"cpp\">int FAST_FUNC bb_init_module(const char *filename, const char *options) { \u2026 \/*  * First we try finit_module if available.  Some kernels are configured  * to only allow loading of modules off of secure storage (like a read-  * only rootfs) which needs the finit_module call.  If it fails, we fall  * back to normal module loading to support compressed modules.  *\/ # ifdef __NR_finit_module { int fd = open(filename, O_RDONLY | O_CLOEXEC); if (fd >= 0) { rc = finit_module(fd, options, 0) != 0; close(fd); if (rc == 0) return rc; } } # endif  image_size = INT_MAX - 4095; mmaped = 0; image = try_to_mmap_module(filename, &amp;image_size); if (image) { mmaped = 1; } else { errno = ENOMEM; \/* may be changed by e.g. open errors below *\/ image = xmalloc_open_zipped_read_close(filename, &amp;image_size); if (!image) return -errno; }  errno = 0; init_module(image, image_size, options); <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u2013 \u043a\u043e\u0434 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f\u0434\u0440\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 finit_module, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b, \u0438 \u0434\u0435\u0440\u043d\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430. \u0410 \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u2013 \u0442\u043e \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c, \u0438 \u0434\u0435\u0440\u043d\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 init_module, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0422\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435, \u043c\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u044f\u0434\u0440\u0430 <strong>kernel\/module.c<\/strong>. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u043e \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0442\u043a\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u043a\u043e\u0434 \u0432\u044b\u0448\u0435, \u043c\u044b \u043e\u043a\u0430\u0436\u0435\u043c\u0441\u044f \u0438\u043b\u0438 \u0442\u0443\u0442:<\/p>\n<pre><code class=\"cpp\">SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags) { struct load_info info = { }; loff_t size; void *hdr; int err;  err = may_init_module(); if (err) return err;  pr_debug(\"finit_module: fd=%d, uargs=%p, flags=%i\\n\", fd, uargs, flags);  if (flags &amp; ~(MODULE_INIT_IGNORE_MODVERSIONS       |MODULE_INIT_IGNORE_VERMAGIC)) return -EINVAL;  err = kernel_read_file_from_fd(fd, &amp;hdr, &amp;size, INT_MAX,        READING_MODULE); if (err) return err; info.hdr = hdr; info.len = size;  return load_module(&amp;info, uargs, flags); }<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0442\u0443\u0442:<\/p>\n<pre><code class=\"cpp\">SYSCALL_DEFINE3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs) { int err; struct load_info info = { };  err = may_init_module(); if (err) return err;  pr_debug(\"init_module: umod=%p, len=%lu, uargs=%p\\n\",        umod, len, uargs);  err = copy_module_from_user(umod, len, &amp;info); if (err) return err;  return load_module(&amp;info, uargs, 0); }<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e, \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u044b \u043f\u0440\u0438\u0434\u0435\u043c \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e load_module(). \u0412 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043e\u043a, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043c \u0432\u043e\u0442 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443:<\/p>\n<pre><code class=\"cpp\">return do_init_module(mod);<\/code><\/pre>\n<p>\u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0444\u0443\u043d\u043a\u0446\u0438\u044f do_init_module() \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043e\u0431\u0435\u0440\u0442\u043a\u0435 \u0432\u043e\u043a\u0440\u0443\u0433 \u0432\u043e\u0442 \u044d\u0442\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/* Start the module *\/ if (mod->init != NULL) ret = do_one_initcall(mod->init); if (ret &lt; 0) { goto fail_free_freeinit;<\/code><\/pre>\n<p>\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0434\u0435\u0440\u0433\u0430\u0435\u043c initcall, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043d \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0442\u0435\u0445 initcall-\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<h3>\u0421\u0442\u0430\u0440\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430<\/h3>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2013 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u043d\u043e \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b. \u0427\u0442\u043e\u0431\u044b \u043e\u043d \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f probe(). \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0432 linux \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0441\u044f, \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0448\u0438\u043d, \u0438 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u2013 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0448\u0438\u043d. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f0d\/aa0\/97c\/f0daa097c22c7d4d34425973a81acaa2.png\" width=\"622\" height=\"600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f0d\/aa0\/97c\/f0daa097c22c7d4d34425973a81acaa2.png\"\/><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0432\u044b\u0448\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043c \u0442\u0430\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f I2C-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 EEPROM AT24:<\/p>\n<p><strong>drivers\/misc\/eeprom\/at24.c<\/strong>:<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">return i2c_add_driver(&amp;at24_driver)<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">static struct i2c_driver at24_driver = { .driver = { .name = \"at24\", .of_match_table = at24_of_match, .acpi_match_table = ACPI_PTR(at24_acpi_ids), }, .probe_new = at24_probe, .remove = at24_remove, .id_table = at24_ids, };<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u0435\u0432\u0430\u0439\u0441\u0430 \u0432 device tree:<\/p>\n<pre><code class=\"cpp\">static const struct of_device_id at24_of_match[] = { { .compatible = \"atmel,24c00\",.data = &amp;at24_data_24c00 }, { .compatible = \"atmel,24c01\",.data = &amp;at24_data_24c01 }, ... { \/* END OF LIST *\/ }, };<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0448\u0438\u043d\u0430\u0445. \u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Wifi-\u043c\u043e\u0434\u0443\u043b\u044f RTL8xxxu:<\/p>\n<p><strong>drivers\/net\/wireless\/realtek\/rtl8xxxu\/rtl8xxxu_core.c<\/strong>:<\/p>\n<pre><code class=\"cpp\">static int __init rtl8xxxu_module_init(void) { int res;  res = usb_register(&amp;rtl8xxxu_driver); if (res &lt; 0) pr_err(DRIVER_NAME \": usb_register() failed (%i)\\n\", res);  return res; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">static struct usb_driver rtl8xxxu_driver = { .name = DRIVER_NAME, .probe = rtl8xxxu_probe, .disconnect = rtl8xxxu_disconnect, .id_table = dev_table, .no_dynamic_id = 1, .disable_hub_initiated_lpm = 1, };<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"cpp\">static const struct usb_device_id dev_table[] = { {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8724, 0xff, 0xff, 0xff), .driver_info = (unsigned long)&amp;rtl8723au_fops}, {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x1724, 0xff, 0xff, 0xff), .driver_info = (unsigned long)&amp;rtl8723au_fops}, \u2026<\/code><\/pre>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f ID \u043d\u0430 \u0448\u0438\u043d\u0435, \u0430 \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 Device Tree. \u041d\u043e \u0441\u0430\u043c \u0444\u0430\u043a\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u043b\u043e\u0433\u0438\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u0434\u0432\u0443\u043c\u044f \u043f\u0443\u0442\u044f\u043c\u0438:<\/p>\n<p>1) \u0415\u0441\u043b\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440.<\/p>\n<p>&#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>int bus_add_driver(struct device_driver *drv)<\/code> \u0438\u0437 <strong>drivers\/base\/bus.c<\/strong>. \u041e\u043d\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a:<\/p>\n<pre><code class=\"cpp\">if (driver_allows_async_probing(drv)) { pr_debug(\"bus: '%s': probing driver %s asynchronously\\n\", drv->bus->name, drv->name); async_schedule(driver_attach_async, drv); } else { error = driver_attach(drv); if (error) goto out_unregister; }<\/code><\/pre>\n<p>&#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>driver_attach_async()<\/code> \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u044b\u0437\u043e\u0432\u0443 <code>driver_attach()<\/code>:<\/p>\n<pre><code class=\"cpp\">static void driver_attach_async(void *_drv, async_cookie_t cookie) { struct device_driver *drv = _drv; int ret;  ret = driver_attach(drv);  pr_debug(\"bus: '%s': driver %s async attach completed: %d\\n\",  drv->bus->name, drv->name, ret); }<\/code><\/pre>\n<p>&#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>driver_attach()<\/code> \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u201c\u043f\u0440\u0438\u043c\u0435\u0440\u044f\u0435\u0442\u201d \u0435\u0433\u043e \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443:<\/p>\n<pre><code class=\"cpp\">\/**  * driver_attach - try to bind driver to devices.  * @drv: driver.  *  * Walk the list of devices that the bus has on it and try to  * match the driver with each one.  If driver_probe_device()  * returns 0 and the @dev->driver is set, we've found a  * compatible pair.  *\/ int driver_attach(struct device_driver *drv) { return bus_for_each_dev(drv->bus, NULL, drv, __driver_attach); } EXPORT_SYMBOL_GPL(driver_attach);<\/code><\/pre>\n<p>&#8212; \u0441\u0430\u043c\u0430 \u201c\u043f\u0440\u0438\u043c\u0435\u0440\u043a\u0430\u201d \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>__driver_attach()<\/code> \u0438 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u044b\u0437\u043e\u0432\u0443:<\/p>\n<pre><code class=\"cpp\">ret = driver_match_device(drv, dev);<\/code><\/pre>\n<p>&#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>driver_match_device()<\/code> \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0448\u0438\u043d\u044b:<\/p>\n<p><strong>drivers\/base\/base.h<\/strong>:<\/p>\n<pre><code class=\"cpp\">static inline int driver_match_device(struct device_driver *drv,       struct device *dev) { return drv->bus->match ? drv->bus->match(dev, drv) : 1; }<\/code><\/pre>\n<p>2) \u0415\u0441\u043b\u0438 \u043d\u0430 \u0448\u0438\u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 PCI\/USB\/etc, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0430\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c device tree.<\/p>\n<p>&#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437 <strong>drivers\/base\/core.c<\/strong> (\u043a\u0441\u0442\u0430\u0442\u0438, \u0437\u0434\u0435\u0441\u044c \u0436\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442\u0441\u044f uevent):<\/p>\n<pre><code class=\"cpp\">int device_add(struct device *dev) { \u2026 kobject_uevent(&amp;dev->kobj, KOBJ_ADD); bus_probe_device(dev);<\/code><\/pre>\n<p>&#8212; \u0432\u043e\u0442 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <code>bus_probe_device()<\/code>:<\/p>\n<pre><code class=\"cpp\">\/**  * bus_probe_device - probe drivers for a new device  * @dev: device to probe  *  * - Automatically probe for a driver if the bus allows it.  *\/ void bus_probe_device(struct device *dev) { struct bus_type *bus = dev->bus; struct subsys_interface *sif;  if (!bus) return;  if (bus->p->drivers_autoprobe) device_initial_probe(dev);<\/code><\/pre>\n<p>&#8212; <strong>drivers\/base\/dd.c<\/strong>:<\/p>\n<pre><code class=\"cpp\">void device_initial_probe(struct device *dev) { __device_attach(dev, true); }<\/code><\/pre>\n<p>&#8212; \u0430 \u0443\u0436\u0435 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u201c\u043f\u0440\u0438\u043c\u0435\u0440\u043a\u0430\u201d \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"cpp\">static int __device_attach(struct device *dev, bool allow_async) { ... ret = bus_for_each_drv(dev->bus, NULL, &amp;data, __device_attach_driver);<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u044f\u0434\u0440\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e <a href=\"https:\/\/www.kernel.org\/doc\/html\/latest\/driver-api\/driver-model\/binding.html\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u0438 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<blockquote>\n<p>When a new device is added, the bus&#8217;s list of drivers is iterated over to find one that supports it. In order to determine that, the device ID of the device must match one of the device IDs that the driver supports. The format and semantics for comparing IDs is bus-specific. Instead of trying to derive a complex state machine and matching algorithm, it is up to the bus driver to provide a callback to compare a device against the IDs of a driver. The bus returns 1 if a match was found; 0 otherwise.<\/p>\n<p>int match(struct device * dev, struct device_driver * drv);<\/p>\n<p>If a match is found, the device&#8217;s driver field is set to the driver and the driver&#8217;s probe callback is called. This gives the driver a chance to verify that it really does support the hardware, and that it&#8217;s in a working state.<\/p>\n<\/blockquote>\n<h3>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h3>\n<p> \u201c\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u201d \u2013 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0438\u0432\u0430\u044f \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u0430\u043b\u044c\u043a\u0430 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u201cplatform device\u201d \u0438 \u201cplatform driver\u201d. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<p>\u201c\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u201d (platform driver) \u2013 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u201c\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0448\u0438\u043d\u044b I2C\u201d \u0438\u043b\u0438 \u201c\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0448\u0438\u043d\u044b PCI\u201d, \u0438\u043b\u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u0448\u0438\u043d. \u0415\u0441\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u2013 \u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u044d\u0442\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u2013 \u044d\u0442\u043e IP-\u0431\u043b\u043e\u043a \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u044b, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u0448\u0438\u043d\u0435 AXI \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439. \u042d\u0442\u0438 \u0448\u0438\u043d\u044b, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043d\u0435 \u0432\u0438\u0434\u043d\u044b, \u0438 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438) \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0448\u0438\u043d\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 \u044f\u0434\u0440\u0435 \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c platform_driver.<\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c \u043e\u0442 \u0438\u0441\u0442\u0438\u043d\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e platform \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u044d\u0442\u043e \u201c\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f\u201d \u0448\u0438\u043d\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0448\u0438\u043d. \u0422\u043e \u0435\u0441\u0442\u044c, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/314\/1e8\/73c\/3141e873c92e14dc589fd52e9c1bc4a0.png\" width=\"617\" height=\"668\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/314\/1e8\/73c\/3141e873c92e14dc589fd52e9c1bc4a0.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0442\u043e\u0433\u043e \u0436\u0435 I2C, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e platform_driver_register().<\/p>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0435<\/h3>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u0430\u043c\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0432 \u044f\u0434\u0440\u0435 Linux. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0443\u044e \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 (&#171;\u043d\u0430\u0448\u043b\u0438 \u0434\u0435\u0432\u0430\u0439\u0441 &#8212; \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043a \u043d\u0435\u043c\u0443&#187;), &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c.<\/p>\n<p>\u0417\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 (\u0431\u0443\u0434\u044c \u0442\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 Device Tree), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u044f\u0434\u0440\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0438 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u043d\u0435\u043c, \u043a\u0430\u043a \u0438 \u0432\u043e \u0432\u0441\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 &#171;\u043f\u043e\u0434\u043a\u0430\u043f\u043e\u0442\u043d\u044b\u0445&#187; \u0432\u0435\u0449\u0435\u0439 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<\/p>\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<\/h3>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u0438\u043c\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0432\u0437\u044f\u0442\u044b \u043e\u0442\u0441\u044e\u0434\u0430:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/docs.kernel.org\/driver-api\/index.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.kernel.org\/driver-api\/index.html<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/proninyaroslav.gitbooks.io\/linux-insides-ru\/content\/\" rel=\"noopener noreferrer nofollow\">https:\/\/proninyaroslav.gitbooks.io\/linux-insides-ru\/content\/<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/785358\/\"> https:\/\/habr.com\/ru\/articles\/785358\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043f\u043e\u0434 Linux. \u041d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0432 \u0441\u0435\u0442\u0438. \u041e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; \u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432. \u042d\u0442\u043e \u043c\u0430\u043b\u043e \u043a\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435. \u041d\u043e \u0430\u0432\u0442\u043e\u0440\u0443 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0438 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u0432\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0435\u043c\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0437\u043a\u0438\u0439 \u043a\u0443\u0441\u043e\u0447\u0435\u043a.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0410\u0432\u0442\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u201c\u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0430\u0442\u044c\u044f \u0441 \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443-\u0442\u043e, \u0447\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u043e\u0447\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0438\u043a\u043e\u0433\u0434\u0430\u201d. \u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f. \u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b.<\/p>\n<p>\u0413\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u0441\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043a\u043e\u0432\u044b\u0440\u044f\u043d\u0438\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0438 \u0442\u043e \u043d\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u044f\u0434\u0440\u043e<\/summary>\n<div class=\"spoiler__content\">\n<p>C\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0430, \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e\u0449\u0435\u0435 \u043d\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f embedded \u0432\u043e\u043e\u0431\u0449\u0435 \u0438 embedded linux \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438. \u0417\u0430 \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e \u043f\u0430\u043b\u044c\u0446\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u044f\u0434\u0440\u0443 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0447\u0435\u043c \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0443\u0442\u0435\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439, \u0435\u0449\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439, \u0432\u0430\u0436\u043d\u043e\u0439, \u043d\u043e \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0442\u0443\u043f\u0435\u043d\u044c\u043a\u043e\u0439.<\/p>\n<p>\u0423 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u0439\u043a\u043e\u0435 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u044f\u0434\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0442\u0430\u043c \u0443\u0436\u0435 \u0438 \u0442\u0430\u043a \u0437\u043d\u0430\u044e\u0442, \u0430 \u043f\u0438\u0441\u044c\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0433\u0430\u0439\u0434\u043b\u0430\u0439\u043d\u044b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435, \u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0440\u0435\u0448\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438 \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0438\u043a\u043e\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e \u044f\u0434\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435. \u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0447\u0438\u0441\u0442\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<\/div>\n<\/details>\n<h3>\u0421\u0435\u0442\u0430\u043f \u0434\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u043b\u0430\u0442\u0443 BeagleBone Black \u0438 Buildroot 2021.02. \u0412 \u044d\u0442\u043e\u043c \u0441\u0435\u0442\u0430\u043f\u0435 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0430\u043a\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0438 \u0441 \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0443.<\/p>\n<p>Buildroot \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0434\u0440\u043e \u0432\u0435\u0440\u0441\u0438\u0438 4.19.79. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u043d\u043e \u043e\u0431\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0430\u043c \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430, \u043d\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c\/\u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c Buildroot \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043d\u0430\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432 \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437:<br \/><code>make beaglebone_defconfig<br \/>make linux-rebuild # \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u043b\u0438 \u0432 \u044f\u0434\u0440\u0435<br \/>make<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e output\/images, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c SD-\u043a\u0430\u0440\u0442\u0443 \u0432 \u0440\u0438\u0434\u0435\u0440, \u043f\u0440\u043e\u0448\u0438\u0432\u0430\u0435\u043c \u0435\u0435:<br \/><code>sudo dd if=sdcard.img of=\/dev\/sda bs=4K # \u0438\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e<br \/>sync<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u043f\u043e\u0440\u0442\u0443 UART \u043f\u043b\u0430\u0442\u044b, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c SD-\u043a\u0430\u0440\u0442\u0443, \u043f\u043e\u0434\u0430\u0435\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043b\u0430\u0442\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433\u0438 \u044f\u0434\u0440\u0430, \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u043e\u0432 \u0432 \u043a\u043e\u0434 \u044f\u0434\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433 \u044f\u0434\u0440\u0430 (dmesg). \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<p><code>[    0.268291] OMAP GPIO hardware version 0.1<\/code><\/p>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0439\u0442\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438. \u0414\u0430\u043b\u0435\u0435 \u043f\u0443\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u044f\u0434\u0440\u0430.<\/p>\n<p>\u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <strong>init\/main.c<\/strong>:<\/p>\n<p><code>asmlinkage __visible void __init start_kernel(void)<\/code><\/p>\n<p>\u042d\u0442\u043e, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0441\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u041d\u043e \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c, \u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0432\u043e\u0442 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"cpp\">\/*  * Ok, the machine is now initialized. None of the devices  * have been touched yet, but the CPU subsystem is up and  * running, and memory and process management works.  *  * Now we can finally start doing some real work..  *\/ static void __init do_basic_setup(void) {  cpuset_init_smp(); shmem_init(); driver_init(); init_irq_proc(); do_ctors(); usermodehelper_enable(); do_initcalls(); }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u0434 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u043d\u044b\u043c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439), \u0442\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2013 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 do_initcalls(). \u0417\u043d\u0430\u0447\u0438\u0442, \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">static void __init do_initcalls(void) { int level;  for (level = 0; level &lt; ARRAY_SIZE(initcall_levels) - 1; level++) do_initcall_level(level); }  static void __init do_initcall_level(int level) { initcall_entry_t *fn;  strcpy(initcall_command_line, saved_command_line); parse_args(initcall_level_names[level],    initcall_command_line, __start___param,    __stop___param - __start___param,    level, level,    NULL, &amp;repair_env_string);  trace_initcall_level(initcall_level_names[level]); for (fn = initcall_levels[level]; fn &lt; initcall_levels[level+1]; fn++) do_one_initcall(initcall_from_entry(fn)); }<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 initcalls, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c. \u041e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"cpp\">extern initcall_entry_t __initcall_start[]; extern initcall_entry_t __initcall0_start[]; extern initcall_entry_t __initcall1_start[]; extern initcall_entry_t __initcall2_start[]; extern initcall_entry_t __initcall3_start[]; extern initcall_entry_t __initcall4_start[]; extern initcall_entry_t __initcall5_start[]; extern initcall_entry_t __initcall6_start[]; extern initcall_entry_t __initcall7_start[]; extern initcall_entry_t __initcall_end[];  static initcall_entry_t *initcall_levels[] __initdata = { __initcall0_start, __initcall1_start, __initcall2_start, __initcall3_start, __initcall4_start, __initcall5_start, __initcall6_start, __initcall7_start, __initcall_end, };  \/* Keep these in sync with initcalls in include\/linux\/init.h *\/ static char *initcall_level_names[] __initdata = { \"pure\", \"core\", \"postcore\", \"arch\", \"subsys\", \"fs\", \"device\", \"late\", };<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u044d\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0431\u0435\u0440\u0443\u0442\u0441\u044f? \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 __initcall0_start, \u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e:<\/p>\n<p><strong>arch\/arm\/kernel\/vmlinux.lds<\/strong>:<\/p>\n<pre><code>.init.data : AT(ADDR(.init.data) - 0) { KEEP(*(SORT(___kentry+*))) *(.init.data init.data.*) *(.meminit.data*) *(.init.rodata .init.rodata.*) . = ALIGN(8); __start_ftrace_events = .; KEEP(*(_ftrace_events)) __stop_ftrace_events = .; __start_ftrace_eval_maps = .; KEEP(*(_ftrace_eval_map)) __stop_ftrace_eval_maps = .; . = ALIGN(8); __start_kprobe_blacklist = .; KEEP(*(_kprobe_blacklist)) __stop_kprobe_blacklist = .; *(.meminit.rodata) . = ALIGN(8); __clk_of_table = .; KEEP(*(__clk_of_table)) KEEP(*(__clk_of_table_end)) . = ALIGN(8); __reservedmem_of_table = .; KEEP(*(__reservedmem_of_table)) KEEP(*(__reservedmem_of_table_end)) . = ALIGN(8); __timer_of_table = .; KEEP(*(__timer_of_table)) KEEP(*(__timer_of_table_end)) . = ALIGN(8); __cpu_method_of_table = .; KEEP(*(__cpu_method_of_table)) KEEP(*(__cpu_method_of_table_end)) . = ALIGN(8); __cpuidle_method_of_table = .; KEEP(*(__cpuidle_method_of_table)) KEEP(*(__cpuidle_method_of_table_end)) . = ALIGN(32); __dtb_start = .; KEEP(*(.dtb.init.rodata)) __dtb_end = .; . = ALIGN(8); __irqchip_of_table = .; KEEP(*(__irqchip_of_table)) KEEP(*(__irqchip_of_table_end)) . = ALIGN(8); __earlycon_table = .; KEEP(*(__earlycon_table)) __earlycon_table_end = .; . = ALIGN(16); __setup_start = .; KEEP(*(.init.setup)) __setup_end = .; __initcall_start = .; KEEP(*(.initcallearly.init)) __initcall0_start = .; KEEP(*(.initcall0.init)) KEEP(*(.initcall0s.init)) __initcall1_start = .; KEEP(*(.initcall1.init)) KEEP(*(.initcall1s.init)) __initcall2_start = .; KEEP(*(.initcall2.init)) KEEP(*(.initcall2s.init)) __initcall3_start = .; KEEP(*(.initcall3.init)) KEEP(*(.initcall3s.init)) __initcall4_start = .; KEEP(*(.initcall4.init)) KEEP(*(.initcall4s.init)) __initcall5_start = .; KEEP(*(.initcall5.init)) KEEP(*(.initcall5s.init)) __initcallrootfs_start = .; KEEP(*(.initcallrootfs.init)) KEEP(*(.initcallrootfss.init)) __initcall6_start = .; KEEP(*(.initcall6.init)) KEEP(*(.initcall6s.init)) __initcall7_start = .; KEEP(*(.initcall7.init)) KEEP(*(.initcall7s.init)) __initcall_end = .; __con_initcall_start = .; KEEP(*(.con_initcall.init)) __con_initcall_end = .; __security_initcall_start = .; KEEP(*(.security_initcall.init)) __security_initcall_end = .; . = ALIGN(4); __initramfs_start = .; KEEP(*(.init.ramfs)) . = ALIGN(8); KEEP(*(.init.ramfs.info)) }<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u043d\u043e \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u2013 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u041e\u043a, \u0442\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442 \u043d\u0430\u0441 \u0432 <strong>include\/linux\/init.h<\/strong>:<\/p>\n<pre><code class=\"cpp\">#define core_initcall(fn)__define_initcall(fn, 1) #define core_initcall_sync(fn)__define_initcall(fn, 1s) #define postcore_initcall(fn)__define_initcall(fn, 2) #define postcore_initcall_sync(fn)__define_initcall(fn, 2s) #define arch_initcall(fn)__define_initcall(fn, 3) #define arch_initcall_sync(fn)__define_initcall(fn, 3s) #define subsys_initcall(fn)__define_initcall(fn, 4) #define subsys_initcall_sync(fn)__define_initcall(fn, 4s) #define fs_initcall(fn)__define_initcall(fn, 5) #define fs_initcall_sync(fn)__define_initcall(fn, 5s) #define rootfs_initcall(fn)__define_initcall(fn, rootfs) #define device_initcall(fn)__define_initcall(fn, 6) #define device_initcall_sync(fn)__define_initcall(fn, 6s) #define late_initcall(fn)__define_initcall(fn, 7) #define late_initcall_sync(fn)__define_initcall(fn, 7s)  #define __initcall(fn) device_initcall(fn)<\/code><\/pre>\n<p>\u0410 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435 \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"cpp\">#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS #define ___define_initcall(fn, id, __sec)\\ __ADDRESSABLE(fn)\\ asm(\".section\\\"\" #__sec \".init\\\", \\\"a\\\"\\n\"\\ \"__initcall_\" #fn #id \":\\n\"\\     \".long\" #fn \" - .\\n\"\\     \".previous\\n\"); #else #define ___define_initcall(fn, id, __sec) \\ static initcall_t __initcall_##fn##id __used \\ __attribute__((__section__(#__sec \".init\"))) = fn; #endif  #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c \u0448\u0442\u0443\u043a\u0438 \u0442\u0438\u043f\u0430 device_initcall \u2013 <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-364877","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/364877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=364877"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/364877\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=364877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=364877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=364877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}