Kernel Module with multiple source files not initializing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.,  link1, link2, and link3 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@ssd:~/Desktop/Kernel_User_comm$ ls
Makefile  netlink_kernel_module.c  netlink_kernel_space.c  netlink_kernel_space.h  netlink_user_module.c
---------------------------------------------------
ssd@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@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.
 sahibzada_irfanullah

Attachment: Kernel_User_comm.zip
Description: Zip archive

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

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux