Hi,
I have read your post. I m trying to add my system call in RH9 kernel 2.4.20-8 but i am not successfull till now. I am telling you what i have done.
1. I have added syscall number in /linux-2.4.20-8/include/asm/unistd.h
...
#define __NR_proc_mig 259
2. I have made sys_proc_mig() function in kernel/sys.h
...
asmlinkage int sys_proc_mig(int pid)
{
printk("proc_mig");
return pid;
}
3. I have modified arch/i386/kernel/entry.S
.data...
...
... /*258*/
.rept (NR_syscalls-(.-sys_call_table)/4 -1)
.long SYMBOL_NAME(sys_ni_syscall)
.endr
.long SYMBOL_NAME(sys_proc_mig) /*259*/
This much is also not working and generating stub for this is also not working.
4. My user program is:
#include <errno.h>
#include <unistd.h>
static inline _syscall1(int,proc_mig,int,pid);
int main(int argc,char *argv[])
{
printf("%d",proc_mig(atoi(argv[1])));
return 1;
}
Removing '
static inline' also not working and i am getting error msgs like:
[root@broadmind root]# gcc -o hello hello.c
hello.c:4: parse error before "proc_mig"
hello.c:4: warning: data definition has no type or storage class
[root@broadmind root]#
if I add '
static inline' then warning is removed but error remain as it is. If I remove stub then i get
gcc -o hello hello.c
/tmp/ccIwjYEM.o(.text+0x28): In function `main':
: undefined reference to `proc_mig'
collect2: ld returned 1 exit status
adding init function to main also not working.
Please help me as soon as possible my friend.
Thanks.