how to use the system call in the module ?

zjznliang zjznliang_popo at 163.com
Wed Nov 16 13:19:08 EST 2005


Hi linuxppc-embedded!

	     In the device driver, we always want to send some data to the application . So I was  thinking , the IPC would  do me a favor . I used the sys_msgget and sys_msgsnd in the module ,but I got this when I type the "insmod  module" command :
		insmod: unresolved symbol sys_msgget 
		insmod: unresolved symbol sys_msgsnd 

		In my opinion ,the system call is the system call to the user application and the function to the kernel mode (eg: module ),so how to use the system call in kernel mode is the way that how to recognise the function of system call in the module .
 
		At the beginning, I had to open and read a file in the module , so I used  this way to add the system call :

		#define _KERNEL_SYSCALLS_
		#include <linux/unistd.h>

		When I typed the "insmod module ",the symbol open and read could be found ,but the function was not availability.So I checked the /proc/ksyms for the function which the kernel could call , and used the filp_open () and kernel_read () for instead .
		
		Now , I did a test , compile the module with the linux kernel, the sys_msgget and sys_msgsnd could work fine . I thought the reason is that the sys_msgget is an extern function when compiling with the kernel.So perhaps , when I do insmod the module, I did not exporte the sys_msgget and sys_msgsnd as the kernel symbols.

		How to exporte the system call as the kernel symbols?? 

       Any help on this would be greatly appreciated. Thanks for your patience. 

 				

  zjznliang
    zjznliang_popo at 163.com
      2005-11-16


More information about the Linuxppc-embedded mailing list