You are not logged in.
Pages: 1
Hi,
I hope everyone is having a great day.
I am learning Kernel programming and I have a newbie, question. So I have a Kernel module that I wrote which goes like:
SYSCALL_DEFINE2(testFunction, pid_t, pid, uid_t *, uid)
{
// I do a bunch of stuff here
}
but now I want to convert it into a Loadable Kernel function, and I know I have to do something like this:
static int __init testFunction(pid_t, pid, uid_t *, uid)
&
static void __exit exit_module(void)
&
module_init(testFunction);
module_exit(exitModule);
My question is, how exactly am I supposed to integrate the SYSCALL_DEFINE2(testFunction, pid_t, pid, uid_t *, uid) now?
Thanks in advance!
Offline
In my opinion, Linux Device Drivers is the canonical reference. Look at chapter 2
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
In my opinion, Linux Device Drivers is the canonical reference. Look at chapter 2
Thank you, read the document, it is really good. From my understanding,
SYSCALL_DEFINE2(testFunction, pid_t, pid, uid_t *, uid)
{
// I do a bunch of stuff here
}
I do the bunch of stuff in module_init() instead of this system call, then I publish a pointer to the testFunction and then modify the Makefile?
am I right?
Offline
I think so. It has been awhile since I have played with modules and I cannot access my home computer from here
. I did try all the examples in that book and they do work.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pages: 1