KERN_DIR = 100ask_stm32mp157_pro-sdk\/Linux-5.4\/<\/span><\/code><\/pre>\n<\/p>\n10.5.2\u7f16\u8bd1<\/p>\n
\u8bbe\u7f6e\u597d\u5de5\u5177\u94fe\u3001\u914d\u7f6e\u3001\u7f16\u8bd1\u8fc7\u5185\u6838\u4ee5\u540e\uff0c\u572801_hello_drv\u76ee\u5f55\u4e0b\u6267\u884cmake\u547d\u4ee4\u5373\u53ef\u7f16\u8bd1\u9a71\u52a8\u7a0b\u5e8f\u53ca\u6d4b\u8bd5\u7a0b\u5e8f\uff0c\u5982\u4e0b\uff1a<\/p>\n
<\/p>\n
10.5.3\u5728\u5f00\u53d1\u677f\u4e0a\u8fd0\u884c<\/p>\n
\u5f00\u53d1\u677f\u542f\u52a8\u540e\u901a\u8fc7nfs\u6302\u8f7dUbuntu\u76ee\u5f55\u7684\u65b9\u6cd5\uff0c\u5c06\u76f8\u5e94\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u5f00\u53d1\u677f\u4e0a\u3002\u5047\u5982\u4f60\u4f7f\u7528\u7684\u662fVMwareNAT\u5f62\u5f0f\uff0c\u5047\u5b9aWindowsIP\u4e3a192.168.1.100\uff0c\u5728\u5f00\u53d1\u677f\u4e0a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4(\u6ce8\u610f\uff1a\u5fc5\u987b\u6307\u5b9aport\u4e3a2049\u3001mountport\u4e3a9999)\uff1a<\/p>\n
\n
[root@board:~]# mount -t nfs -o nolock,vers=3,port=2049,mountport=9999 192.168.1.100:\/home\/book\/nfs_rootfs \/mnt<\/span><\/code><\/pre>\n<\/p>\n\u5047\u5982\u4f60\u4f7f\u7528\u7684\u662fVMware\u6865\u63a5\u65b9\u6cd5\uff0c\u5047\u5b9aUbuntuIP\u4e3a192.168.1.100\uff0c\u5728\u5f00\u53d1\u677f\u4e0a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n
\n
[root@board:~]# mount -t nfs -o nolock,vers=3 192.168.1.100:\/home\/book\/nfs_rootfs \/mnt<\/span><\/code><\/pre>\n<\/p>\n\u6302\u8f7dNFS\u6210\u529f\u540e\uff0c\u628a\u9a71\u52a8\u548c\u6d4b\u8bd5\u7a0b\u5e8f\u590d\u5236\u5230\u5f00\u53d1\u677f\u4e0a\uff1a<\/p>\n
\n
[root@board:~]# cp \/mnt\/hello_drv.ko .\/<\/span><\/code>[root@board:~]#\u00a0cp\u00a0\/mnt\/hello_drv_test\u00a0.\/<\/span><\/code><\/pre>\n<\/p>\n\u4e4b\u540e\u5b89\u88c5\u9a71\u52a8\u7a0b\u5e8f\u5e76\u9a8c\u8bc1\u662f\u5426\u6210\u529f\uff1a<\/p>\n
\n
[root@board:~]# insmod hello_drv.ko<\/span><\/code><\/pre>\n<\/p>\n\u6267\u884c\u201clsmod\u201d\u53ef\u4ee5\u770b\u89c1hello_drv\u9a71\u52a8\uff0c\u5982\u4e0b\uff1a<\/p>\n
<\/p>\n
\u6267\u884c\u201ccat\/proc\/devices\u201d\uff1a<\/p>\n
<\/p>\n
\u6267\u884c\u201cls-l\/dev\/hello\u201d\uff0c\u53ef\u4ee5\u53d1\u89c9\u6709\u8fd9\u4e2a\u8bbe\u5907\u8282\u70b9\uff0c\u4f46\u662f\u5b83\u7684\u4e3b\u8bbe\u5907\u53f7\u8ddf\u4e0a\u56fe\u4e00\u6837\uff1a<\/p>\n
\u6700\u540e\u6267\u884c\u6d4b\u8bd5\u7a0b\u5e8f\uff1a<\/p>\n
\n
.\/hello_drv_test -w www.100ask.net<\/span><\/code>.\/hello_drv_test -r<\/span><\/code><\/pre>\n<\/p>\n\u5018\u82e5\u4e0d\u60f3\u89c1\u5230\u9a71\u52a8\u8c03\u8bd5\u4fe1\u606flinux\u64cd\u4f5c\u7cfb\u7edf\u8bba\u6587\uff0c\u53ef\u4ee5\u5148\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u62ff\u6765\u5173\u6389\u5185\u6838\u7684\u590d\u5370\u4fe1\u606f\uff1a<\/p>\n
\n
echo \"1 4 1 7\" > \/proc\/sys\/kernel\/printk<\/span><\/code><\/pre>\n<\/p>\n10.6\u5e38\u89c1\u95ee\u9898<\/p>\n
\u5b89\u88c5\u9a71\u52a8\u7a0b\u5e8f\u65f6\uff0c\u5047\u82e5\u6709\u4ee5\u4e0b\u63d0\u793a\u4fe1\u606f\uff0c\u7f18\u7531\u5c31\u662f\u677f\u5b50\u4e0a\u8fd0\u884c\u7684\u5185\u6838\u592a\u8001\u4e86\uff0c\u89e3\u51b3\u65b9\u5f0f\u5c31\u662f\u5148\u7f16\u8bd1\u5185\u6838\u3001\u66ff\u6362\u677f\u80fd\u4e0a\u7684\u5185\u6838\uff0c\u518d\u91cd\u65b0\u7f16\u8bd1\u3001\u5b89\u88c5\u9a71\u52a8\u7a0b\u5e8f\uff1a<\/p>\n
\n
disagrees about version of symbol device_create<\/span><\/code>[ 2098.200219] hello_drv: Unknown symbol device_create (err -22)<\/span><\/code>[ 2098.208445] hello_drv: disagrees about version of symbol device_destroy<\/span><\/code>[ 2098.215871] hello_drv: Unknown symbol device_destroy (err -22)<\/span><\/code>insmod: ERROR: could not insert module hello_drv.ko: Invalid parameters<\/span><\/code><\/pre>\n<\/p>\n\u5168\u6587\u4e0b\u8f7d\uff1a<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7f16\u8bd1\u9a71\u52a8\u65f6\u7528\u7684\u5185\u6838\u3001\u5f00\u53d1\u677f\u4e0a\u8fd0\u884c\u5230\u5185\u6838\uff0c\u8981\u4e00\u81f4\uff1a\u5f00\u53d1\u677f\u4e0a\u8fd0\u884c\u5230\u5185\u6838\u662f\u51fa\u5382\u65f6\u70e7\u5f55\u7684\uff0c\u4f60\u7f16\u8bd1\u9a71\u52a8\u65f6\u7528\u5230\u5185\u6838\u662f\u4f60\u81ea\u5df1\u7f16\u8bd1\u7684\uff0c\u8fd9\u4e24\u4e2a\u5185\u6838\u4e0d\u4e00\u81f4\u65f6\u4f1a\u5bfc\u81f4\u4e00\u4e9b\u95ee\u9898\u3002\u65e0\u8bba\u662f\u54ea\u4e2a\u7248\u672c\u7684STM32MP157\u5f00\u53d1\u677f\uff0c\u7f16\u8bd1\u5185\u6838\u6a21\u5757\u7684\u547d\u4ee4\u662f\u4e00\u6837\u7684\u3002\u5b89\u88c5\u5185\u6838\u548c\u6a21\u5757\u5230\u5f00\u53d1\u677f\u4e0a\u76ee\u5f55\u7684\u65b9\u5f0f\uff0c\u5c06\u76f8\u5e94\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u5f00\u53d1\u677f\u4e0a\u3002<\/p>\n","protected":false},"author":1,"featured_media":294402,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[4304],"class_list":["post-294401","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-snhmkbybbml"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/294401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=294401"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/294401\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/294402"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=294401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=294401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=294401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}