Matthewgao
Matthewgao

Reputation: 291

How to call a self-defined Kernel function in the user space?

I wrote a new kernel module which has export a function symbol using EXPORT_SYMBOL(). But How can I call that function in the user space just like the other Linux system call?

Upvotes: 0

Views: 2036

Answers (1)

Vivek S
Vivek S

Reputation: 1261

System calls are different from functions exported by modules using EXPORT_SYMBOL(). These symbols exported by your module are for other parts of the kernel. You can expose interfaces to user space (read abot proc and sys filesystems on linux) which can inturn call you modules function (not necessarily exported).

If you want to write a system call, go through these links

How is the system call in Linux implemented?

http://tldp.org/HOWTO/Implement-Sys-Call-Linux-2.6-i386/

There are numerous resources on the internet that can aid you in implementing your system call.

Upvotes: 2

Related Questions