implementing custom system calls

416 views
Skip to first unread message

DK

unread,
May 12, 2012, 12:29:51 PM5/12/12
to Android Linux Kernel Development
Hi,

I am trying to implement a system call for testing, called test1. I am
getting this error.
Can someone tell how to over come this.

arch/arm/kernel/built-in.o: In function `__sys_trace_return':
io.c:(.text+0xd28): undefined reference to `sys_test1'

Thanks
DK

Vladimir Murzin

unread,
May 13, 2012, 9:57:01 AM5/13/12
to android...@googlegroups.com
> --
> unsubscribe: android-kerne...@googlegroups.com
> website: http://groups.google.com/group/android-kernel
Hi

Could you provide some details what you exactly did?

Best wishes
Vladimir Murzin

Kanishka Ariyapala

unread,
May 13, 2012, 11:56:55 PM5/13/12
to android...@googlegroups.com
Hi,

For testing I want to implement a system call. I was following this link,
http://miguelaosorio.com/index.php?option=com_content&view=article&id=53:create-a-system-cal..

as it tells I added
CALL(sys_test1)  in goldfish/arch/arm/kernel calls.S
#define __NR_test1 (__NR_SYSCALL_BASE+361)  in goldfish/arch/arm/include/asm unistd.h
asmlinkage long sys_test1(void);  in goldfish/include/linux syscalls.h
core-y        := usr/ testsyscalls/  in goldfish Makefile
create testsyscalls folder and implement the new function
create a make file in testsyscalls directory.
It says undefined reference do I need to add an entry in another file too.

Here is my test1(),
#include <asm/unistd.h>
#include <linux/linkage.h>

asmlinkage long sys_test1(void)
{
    return 10;
}

I plan to implement another systemcall say test2 and based on which one is called, plan to do some work.

Thanks
DK
Reply all
Reply to author
Forward
0 new messages