how to add my own system call in RedHat linux9.0(2.4.7-20kernel)
hi
I am a beginner of Linux kernel development.
reecntly, I have add some new system call in RedHad Linux7.0(2.4.7.2 kernel), and they do work! I was very pleased.
but today, I install Redhat 9.0. the system call crash!
my job is :
1 firstly, I add my system call num in unistd.h
2 secondly, I write function in sys.c file under kernel directory
asmlinkage int sys_mycall(struct pt_regs regs){
#define a regs.ecx
#define b regs.ebx
#define c regs.edx
...................
...................
return 0;
}
3 in program:
_syscall3(int, mycall, int, a, int, b, int, c)
main(){
...............
ret = mycall(a, b, c);
.................
}
then I complied and linked, the error happens in link stage.
the message is:" reference to undefined erron in mycall..."
what is wrong? help, please! thank you!
|