How to test a syscall prior to compiling the kernel

Greg KH greg at kroah.com
Wed Jun 4 00:19:35 EDT 2014


On Wed, Jun 04, 2014 at 09:29:39AM +0530, Dipanjan Das wrote:
> 
> Hi Greg,
> 
> You have misunderstood the question. That, too, because me being too brief.
> 
> What I tried to mean is NOT to test the syscall after the modified kernel is
> compiled and booted. That's easy.
> 
> To add the syscall to the kernel, one needs to drop a C code implementing the
> body of the call itself to some appropriate location of the kernel source tree.
> Isn't it so? I am doing that for the first time and want to be sure that the
> compilation, especially the includes work. Otherwise, the kernel compilation
> may throw an error midway, thereby wasting my time.

There are lots of example tutorials online for how to add a syscall to
the kernel, have you tried them?  It should not take long to rebuild the
kernel if you add a single syscall.  You can always just rebuild a
single directory, or a single file, if you are worried about long build
times to find syntax errors in your code.

Try doing the build for one file first, as you do development, to not
have to worry about build times.  Or, build on a ram disk, that goes
much faster :)

Hope this helps,

greg k-h



More information about the Kernelnewbies mailing list