Error while compiling a newly added system call
:/usr/src/linux-2.6.31.5-0.1/arch/x86/kernel # vi syscall_table_32.S
.long sys_hello
:/usr/src/linux-2.6.31.5-0.1/include/asm # vi unistd_32.h
#define __NR_hello 337
:/usr/src/linux-2.6.31.5-0.1/include/asm # vi unistd_64.h
#define __NR_hello 299
__SYSCALL(__NR_hello, sys_hello)
:/usr/src/linux-2.6.31.5-0.1/include/linux # vi syscalls.h
asmlinkage long sys_hello(int i,int j);
:/usr/src/linux-2.6.31.5-0.1/kernel# vi hello.c
#include<linux/linkage.h>
asmlinkage long sys_hello(int i,int j)
{
return i+j;
}
:/usr/src/linux-2.6.31.5-0.1/kernel#vi Makefile
..........
obj-y += hello.o
obj-y += groups.o
.............
:/usr/src/linux-2.6.31.5-0.1 # make
....
....
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
arch/x86/built-in.o: In function `sys_call_table':
(.rodata+0x754): undefined reference to `sys_real_time_rr'
make: *** [.tmp_vmlinux1] Error 1
After few lines are compiled,the above error is generated..
Please help me to know where the changes should be made and how to resolve it.?
Last edited by Taraka Praveen; 07-25-2014 at 02:19 AM.
|