CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >

11. mycall.c

Full path of the file - /usr/src/linux/mycall/mycall.c

  1. Create a source file named "mycall.c" in dir "mycall". mycall.c will have the code for our system call. The definition of the system call in the source file would be asmlinkage long sys_mycall(...){...} . It should include the file linux/linkage.h So, the file "mycall.c" will look like:

/*---Start of mycall.c----*/

#include<linux/linkage.h>

asmlinkage long sys_mycall(int i)

{

return i+10;

}

/*---End of mycall.c------*/

What is asmlinkage?

Asmlinkage is used to look for the arguments on the kernel stack.