From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Tue, 3 Jun 2014 21:19:35 -0700 Subject: How to test a syscall prior to compiling the kernel In-Reply-To: References: <20140604035223.GA28272@kroah.com> Message-ID: <20140604041935.GB30014@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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