Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: Abu Rasheda <rcpilot2010@gmail.com>
To: "Irfan Ullah (울라 이르판)" <irfan@dke.khu.ac.kr>
Cc: Linux Kernel List <kernelnewbies@kernelnewbies.org>
Subject: Re: Kernel Module with multiple source files not initializing
Date: Fri, 25 Oct 2019 09:15:58 -0700
Message-ID: <CACYKDthYMRU3RtcYdJXBv7Q86T9fXMR4N-Dq_z4-tOiJ6rrHog@mail.gmail.com> (raw)
In-Reply-To: <CA+mB8Oz1Hu82nk2vbinhpOQW8uasp7_b8CFNf2jNovqP==OH6A@mail.gmail.com>

[-- Attachment #1.1: Type: text/plain, Size: 1247 bytes --]

On Fri, Oct 25, 2019 at 2:16 AM Irfan Ullah (울라 이르판) <irfan@dke.khu.ac.kr>
wrote:

> Dear All,
> I have developed a kernel module consists of one source file that sends
> and receives  message to the user space.  I have spitted the source code in
> two files, and now I  am trying to develop kernel module from these source
> files. After compiling and linking without any problems, I insmod the
> module but I didn’t see any of the printk() I wrote, in fact, the module
> can be inserted and removed, but it does nothing. Code is in the attached
> file zipped file.
> I tried many things , e.g.,  link <https://paguilar.org/?p=7>1, link2
> <https://www.linuxquestions.org/questions/linux-kernel-70/kernel-module-with-multiple-source-files-not-initializing-886190/>,
> and link3
> <https://android.googlesource.com/kernel/msm/+/android-msm-dory-3.10-kitkat-wear/Documentation/kbuild/modules.txt> etc.
> but nothings worked out.
> I also used *nm* to inspect the module, but, as expected, there was no
> signs of "__init and __exit" functions can in the output.
>

I assume you have verified that your module is loaded by something like

lsmod | grep your_module_name

and log level allows KERN_ALERT printing.

[-- Attachment #1.2: Type: text/html, Size: 1686 bytes --]

<div dir="ltr"><div dir="ltr">On Fri, Oct 25, 2019 at 2:16 AM Irfan Ullah (울라 이르판) &lt;<a href="mailto:irfan@dke.khu.ac.kr">irfan@dke.khu.ac.kr</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear All,<div>I have developed a kernel module consists of one source file that sends and receives  message to the user space.  I have spitted the source code in two files, and now I  am trying to develop kernel module from these source files. After compiling and linking without any problems, I insmod the module but I didn’t see any of the printk() I wrote, in fact, the module can be inserted and removed, but it does nothing. Code is in the attached file zipped file.</div><div>I tried many things , e.g.,  <a href="https://paguilar.org/?p=7" target="_blank">link</a>1, <a href="https://www.linuxquestions.org/questions/linux-kernel-70/kernel-module-with-multiple-source-files-not-initializing-886190/" target="_blank">link2</a>, and <a href="https://android.googlesource.com/kernel/msm/+/android-msm-dory-3.10-kitkat-wear/Documentation/kbuild/modules.txt" target="_blank">link3</a> etc.  but nothings worked out. </div><div>I also used <i>nm</i> to inspect the module, but, as expected, there was no signs of &quot;__init and __exit&quot; functions can in the output. </div></div></blockquote><div><br></div><div>I assume you have verified that your module is loaded by something like</div><div><br></div><div>lsmod | grep your_module_name</div><div><br></div><div>and log level allows KERN_ALERT printing.</div></div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  9:14 Irfan Ullah (울라 이르판)
2019-10-25 16:15 ` Abu Rasheda [this message]
2019-10-27  7:11   ` Irfan Ullah (울라 이르판)
2019-10-27  8:43 ` Bernd Petrovitsch
2019-10-28  9:43   ` Irfan Ullah (울라 이르판)
2019-10-28 10:04     ` Bernd Petrovitsch
2019-10-29  8:30       ` Irfan Ullah (울라 이르판)
2019-11-05 16:52 ` Aruna Hewapathirane
2019-11-07  1:50   ` Irfan Ullah (울라 이르판)

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACYKDthYMRU3RtcYdJXBv7Q86T9fXMR4N-Dq_z4-tOiJ6rrHog@mail.gmail.com \
    --to=rcpilot2010@gmail.com \
    --cc=irfan@dke.khu.ac.kr \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git