Kernel Module with multiple source files not initializing

Irfan Ullah (울라 이르판) irfan at dke.khu.ac.kr
Fri Oct 25 05:14:42 EDT 2019


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.
                                 U __alloc_skb
00000000000001c0 T create_socket
0000000000000030 T data_update
                                 U __fentry__
                                 U fortify_panic
0000000000000000 r __func__.5058
                                 U init_net
0000000000000000 t kernel_space_receiver
0000000000000080 T kernel_space_sender
                                  U memcpy
0000000000000038 r __module_depends
0000000000000008 D msg_size
                                 U msleep
                                 U __netlink_kernel_create
                                 U netlink_kernel_release
                                 U netlink_unicast
0000000000000078 B nlh
                                 U __nlmsg_put
0000000000000080 B nl_sk
0000000000000000 r _note_6
0000000000000004 D pid
                                 U printk
0000000000000000 D res
0000000000000000 B s_data
0000000000000070 B skb_out
                                  U __stack_chk_fail
                                  U strlen
0000000000000000 D __this_module
0000000000000000 r __UNIQUE_ID_license381
000000000000004d r __UNIQUE_ID_name240
0000000000000041 r __UNIQUE_ID_retpoline241
0000000000000010 r __UNIQUE_ID_srcversion242
0000000000000068 r __UNIQUE_ID_vermagic239
--------------------
*Following is the output of some useful commands:*
-------------------------------------------------
*ssd at ssd:~/Desktop/Kernel_User_comm$ ls*
Makefile  netlink_kernel_module.c  netlink_kernel_space.c
 netlink_kernel_space.h  netlink_user_module.c
---------------------------------------------------
*ssd at ssd:~/Kernel_User_comm$ make --version*
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
-------------------------------------------------------
*ssd at ssd:~/Kernel_User_comm$ uname -r*
5.2.0-rc6
--------------------------------------------------------
Can you please help me: what's the problem/mistake I am doing?
Thank you very much.

-- 
*Best Regards,*


*Mr. Irfan Ullah*
PhD Candidate
Data and Knowledge Engineering(DKE) Lab
Department of Computer Science and Engineering
Kyung Hee University, South Korea.
 +82-010-591-51651 <+82%2010-3877-8867>
  sahibzada.iu at gmail.com
 sahibzada_irfanullah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20191025/c974a78e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Kernel_User_comm.zip
Type: application/zip
Size: 4284 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20191025/c974a78e/attachment.zip>


More information about the Kernelnewbies mailing list