<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hello world kernel module for Android 13 i.MX 8MQ in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1730735#M213288</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;*** When i used Makefile, i didn't know what is tool to compile, that's reason Makefile error.&lt;/P&gt;
&lt;P&gt;On the path where is Hello.c and your make file, run the next command:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;make all&lt;/LI-CODE&gt;
&lt;P&gt;If you get errors, please share them.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 18:48:31 GMT</pubDate>
    <dc:creator>JorgeCas</dc:creator>
    <dc:date>2023-09-27T18:48:31Z</dc:date>
    <item>
      <title>Hello world kernel module for Android 13 i.MX 8MQ</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1728363#M213062</link>
      <description>&lt;P&gt;Hello everyone, i'm a beginner of android embedded. i'm using i.MX8 MQ EVK board to build Android and i want write a helloworld kernel module to test. But i have some problems when compiler.&lt;BR /&gt;I don't know how to config and build kernel module. Can you help me indicate steps to do that?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2023 13:45:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1728363#M213062</guid>
      <dc:creator>builinhhh</dc:creator>
      <dc:date>2023-09-24T13:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hello world kernel module for Android 13 i.MX 8MQ</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1729086#M213131</link>
      <description>&lt;P&gt;Hello, I hope you are doing well.&lt;/P&gt;
&lt;P&gt;Could you please share me the steps you are following to replicate the error?&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 18:18:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1729086#M213131</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2023-09-25T18:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Hello world kernel module for Android 13 i.MX 8MQ</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1729230#M213141</link>
      <description>&lt;P&gt;I created 2 files: hello.c, Android.bp&lt;BR /&gt;This is code of Hello.c&lt;/P&gt;&lt;P&gt;// hello.c&lt;BR /&gt;#include &amp;lt;linux/module.h&amp;gt;&lt;BR /&gt;#include &amp;lt;linux/kernel.h&amp;gt;&lt;/P&gt;&lt;P&gt;int init_module(void) {&lt;BR /&gt;printk(KERN_INFO "Hello, kernel!\n");&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void cleanup_module(void) {&lt;BR /&gt;printk(KERN_INFO "Goodbye, kernel!\n");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is code of Android.bp&lt;/P&gt;&lt;P&gt;cc_library {&lt;BR /&gt;name: "hello_kernel_module",&lt;BR /&gt;srcs: [&lt;BR /&gt;"hello.c",&lt;BR /&gt;],&lt;BR /&gt;arch: ["x86_64"],&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Then I used mm to make file but it didn'n success.&lt;/P&gt;&lt;P&gt;I try alternative way by Makefile, but I think my Makefile is not true.&amp;nbsp;&lt;BR /&gt;this is Makefile and Hello.c&lt;/P&gt;&lt;P&gt;Hello.c&lt;/P&gt;&lt;DIV&gt;//kernel/hello_module/hello.c&lt;/DIV&gt;&lt;DIV&gt;#include &amp;lt;linux/module.h&amp;gt; /* Needed by all modules */&lt;/DIV&gt;&lt;DIV&gt;#include &amp;lt;linux/kernel.h&amp;gt; /* Needed for KERN_INFO */&lt;/DIV&gt;&lt;DIV&gt;#include &amp;lt;linux/init.h&amp;gt; /* Needed for the macros */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;///&amp;lt; The license type -- this affects runtime behavior&lt;/DIV&gt;&lt;DIV&gt;MODULE_LICENSE("GPL");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;///&amp;lt; The author -- visible when you use modinfo&lt;/DIV&gt;&lt;DIV&gt;MODULE_AUTHOR("ABC");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;///&amp;lt; The description -- see modinfo&lt;/DIV&gt;&lt;DIV&gt;MODULE_DESCRIPTION("Hello World");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;static int __init hello_start(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;printk(KERN_INFO "Loading hello module...\n");&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;printk(KERN_INFO "Hello world\n");&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return 0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;static void __exit hello_end(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;printk(KERN_INFO "Goodbye Mr.\n");&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;module_init(hello_start);&lt;/DIV&gt;&lt;DIV&gt;module_exit(hello_end);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is Makefile&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;obj-m += hello.o&lt;/DIV&gt;&lt;DIV&gt;PWD := $(shell pwd)&lt;/DIV&gt;&lt;DIV&gt;CLANG := /opt/prebuilt-android-clang/clang-r450784e/bin&lt;/DIV&gt;&lt;DIV&gt;KERNEL := /home/ubuntu/android_build/out/target/product/evk_8mq/obj/KERNEL_OBJ&lt;/DIV&gt;&lt;DIV&gt;LD = /opt/prebuilt-android-clang/clang-r450784e/bin/ld.lld&lt;/DIV&gt;&lt;DIV&gt;all:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;make LD=$(LD) ARCH=arm64 CC=$(CLANG) -C $(KERNEL) M=$(PWD) modules&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;clean:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;make -C $(KERNEL) M=$(PWD) clean&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;When i used Makefile, i didn't know what is tool to compile, that's reason Makefile error.&lt;BR /&gt;The first, i want to compile Hello.c, with output have Hello.ko&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I want insmod Hello.ko to kernel through adb. Can you help me?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Sep 2023 01:22:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1729230#M213141</guid>
      <dc:creator>builinhhh</dc:creator>
      <dc:date>2023-09-26T01:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hello world kernel module for Android 13 i.MX 8MQ</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1730735#M213288</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;*** When i used Makefile, i didn't know what is tool to compile, that's reason Makefile error.&lt;/P&gt;
&lt;P&gt;On the path where is Hello.c and your make file, run the next command:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;make all&lt;/LI-CODE&gt;
&lt;P&gt;If you get errors, please share them.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 18:48:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1730735#M213288</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2023-09-27T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hello world kernel module for Android 13 i.MX 8MQ</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1731753#M213371</link>
      <description>&lt;P&gt;when i used make all, this error is "this kernel was built by clang-450784e, your hello.c was built by gcc"&lt;BR /&gt;so file .ko was not compatible version kernel in android board"&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 02:47:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1731753#M213371</guid>
      <dc:creator>builinhhh</dc:creator>
      <dc:date>2023-09-29T02:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hello world kernel module for Android 13 i.MX 8MQ</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1732199#M213403</link>
      <description>&lt;P&gt;Got it.&lt;/P&gt;
&lt;P&gt;Could you please share more about which Linux version are you using to compile?&lt;/P&gt;
&lt;P&gt;I am having some issues to compile it since there are missing some packages for my current Linux version.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 21:32:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hello-world-kernel-module-for-Android-13-i-MX-8MQ/m-p/1732199#M213403</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2023-09-29T21:32:36Z</dc:date>
    </item>
  </channel>
</rss>

