Help in system call
Hi.
I am new to Linux. I just wanted to create a system call. I am using kernel 2.6.28.9. What I did to create a system call is:
1)I created a directory as /usr/src/linux-2.6.28.9/mycall.
2)I created a .c file as /usr/src/linux-2.6.28.9/mycall/mycall.c
SYSTEM_DEFINE1(mycall, int, i)
{
return i+10;
}
3)I created a Makefile file as /usr/src/linux-2.6.28.9/mycall/Makefile
obj-y := mycall.o
4) I edited /usr/src/linux-2.6.28.9/include/linux/syscalls.h
(original file)
asmlinkage long sys_mycall(void);
5) I edited /usr/src/linux-2.6.28.9/usr/include/asm/unistd_32.h
(original file)
#define __NR_mycall 333
6) I edited /usr/src/linux-2.6.28.9/arch/x86/kernel/syscall_table_32.S
(original file)
.long sys_mycall /* 333 */
Now finally when I run the command:
[linux-2.6.28.9]$make M=mycall/
I get the output as :
CC mycall/mycall.o
mycall/mycall.c:3: error: expected ‘)’ before ‘int’
make[1]: *** [mycall/mycall.o] Error 1
make: *** [_module_mycall] Error 2
Where am I wrong?
I tried for the same system call without any argument then on make I got the result as:
CC mycall/mycall.o
mycall/mycall.c:4: warning: return type defaults to ‘int’
mycall/mycall.c:4: warning: function declaration isn’t a prototype
LD mycall/built-in.o
Building modules, stage 2.
MODPOST 0 modules
y is it so?
Is the procedure I adopted, wrong?
Please help me...
|