mardi 13 janvier 2015

Adding a System call in linux kernel 3.5


I am trying to implement system call to print hello world in linux kernel 3.5 running in virtual box


Here is the source of implementation http://ift.tt/1BZw1eY


However when i try to use my system call it gives an error in /var/log/syslog


atkbd serio0: Spurious NAK on isa0060/serio0. Some program migenter code hereht be trying to access hardware directly


here is code of helloworld system call



#include<linux/kernel.h>
#include<linux/syscalls.h>

asmlinkage long sys_helloworld(const char *input) {

printk(KERN_ALERT "HELLO WORLD SYSTEM CALL called with string::%s\n ",input);
return 0;


}


here is the code for testing the helloworld system call(system call number::358) after it has been installed in linux kernel



#include<unistd.h>
int main()
{
syscall(358,"hiIH");
return 0;

}


kindly share your ideas on how the error could be resolved


Thanks in anticipation



Aucun commentaire:

Enregistrer un commentaire