Link to home
Start Free TrialLog in
Avatar of triptik
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?
Avatar of slyong
slyong


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
Avatar of triptik

ASKER

&#304; did these changes :


/usr/src/linux-2.6.17.4/arch/i386/kernel/syscall_table.S

 .long sys_first_system_call   /* 317
---------------------------------------------------------------
/usr/src/include/asm/unistd.h

#define __NR_first_system_call  317
----------------------------------------------------------------
linux/fs/stat.c


asmlinkage long sys_first_system_call()
{
      printk("system call");
}
----------------------------------------------------------------
ASKER CERTIFIED SOLUTION
Avatar of manish_regmi
manish_regmi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial