triptik
asked on
Adding a new system call
Hi,
i added a system call into kernel on Fedora.How can i test my system call?
-------------------------- ---------- --------
asmlinkage long sys_first_system_call()
{
printk("This is my first system call");
}
-------------------------- ---------- ---------
will i have to add a first_system_call.h under /usr/include/linux ?
and what will have the header of my test code?
-------------------------- ---------- ---------- ---
#include <linux/first_system_call.h >
#include <stdio.h>
int main ()
{
first_system_call();
return 0;
}
-------------------------- ---------- -------
is it right?
i added a system call into kernel on Fedora.How can i test my system call?
--------------------------
asmlinkage long sys_first_system_call()
{
printk("This is my first system call");
}
--------------------------
will i have to add a first_system_call.h under /usr/include/linux ?
and what will have the header of my test code?
--------------------------
#include <linux/first_system_call.h
#include <stdio.h>
int main ()
{
first_system_call();
return 0;
}
--------------------------
is it right?
Have a read here: http://www.linuxjournal.com/article/3326
If you are using Red hat 9 and have not updated to 2.6 kernel versions, You can do it.
things are explained here
http://www.csee.umbc.edu/courses/undergraduate/CMSC421/fall02/burt/projects/howto_add_systemcall.html
what do you write in frist system_call.h??
using asm/unistd.h would be easy.
regards
Manish Regmi
ASKER
İ did these changes :
/usr/src/linux-2.6.17.4/ar ch/i386/ke rnel/sysca ll_table.S
.long sys_first_system_call /* 317
-------------------------- ---------- ---------- ---------- -------
/usr/src/include/asm/unist d.h
#define __NR_first_system_call 317
-------------------------- ---------- ---------- ---------- --------
linux/fs/stat.c
asmlinkage long sys_first_system_call()
{
printk("system call");
}
-------------------------- ---------- ---------- ---------- --------
/usr/src/linux-2.6.17.4/ar
.long sys_first_system_call /* 317
--------------------------
/usr/src/include/asm/unist
#define __NR_first_system_call 317
--------------------------
linux/fs/stat.c
asmlinkage long sys_first_system_call()
{
printk("system call");
}
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.