hi all , i followed the link and tried to add a system call in kernel-version 2.6.37 here is the code : #include<linux/linkage.h> #include<linux/kernel.h> #include<linux/fs.h> //for getname #include<linux/err.h> //for PTR_ERR asmlinkage int sys_hariohm(const char __user *filename) { char *tmp = getname(filename); int fd=PTR_ERR(tmp); if (!IS_ERR(tmp)) { printk("filename %s \n",tmp); putname(tmp); return fd; } else { return 2; } } the compilation process was silent (without any error). but when i try to boot into the kernel having this system call , i get the errors like : do_exit() ,do_group_exit() , syscall_init() error lines with some addresses. can someone help me understand what is wrong with this code? thanks in advance :) -- ........................ *MOHIT VERMA*
hi all ,
i followed the link and tried to add a system call in kernel-version 2.6.37
here is the code :
#include<linux/linkage.h> #include<linux/kernel.h> #include<linux/fs.h> //for getname #include<linux/err.h> //for PTR_ERR asmlinkage int sys_hariohm(const char __user *filename) { char *tmp = getname(filename); int fd=PTR_ERR(tmp); if (!IS_ERR(tmp)) { printk("filename %s \n",tmp); putname(tmp); return fd; } else { return 2; } }
the compilation process was silent (without any error). but when i try to boot into the kernel having this system call , i get the errors like :
do_exit() ,do_group_exit() , syscall_init() error lines with some addresses.
can someone help me understand what is wrong with this code?
thanks in advance :)
and also when i tried to boot into this kernel , it was showing some * initrafs* error.
-- ........................ *MOHIT VERMA*
-- ........................ *MOHIT VERMA*
On Tue, Feb 22, 2011 at 22:18, mohit verma <mohit89mlnc@gmail.com> wrote:
hi all ,
i followed the link and tried to add a system call in kernel-version 2.6.37 here is the code :
#include<linux/linkage.h> #include<linux/kernel.h> #include<linux/fs.h> //for getname #include<linux/err.h> //for PTR_ERR asmlinkage int sys_hariohm(const char __user *filename) { char *tmp = getname(filename); int fd=PTR_ERR(tmp); if (!IS_ERR(tmp)) { printk("filename %s \n",tmp); putname(tmp); return fd; } else { return 2; } }
which syscall number did you assigned to this syscall? and exactly how do you assign it? NB: your code style doesn't follow the Linux kernel coding standart.... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
hi mulyadi, i used syscall number 264 . and for the coding standard , can u tell me where am i off the track ? On Tue, Feb 22, 2011 at 11:20 PM, Mulyadi Santosa <mulyadi.santosa@gmail.com
wrote:
On Tue, Feb 22, 2011 at 22:18, mohit verma <mohit89mlnc@gmail.com> wrote:
hi all ,
i followed the link and tried to add a system call in kernel-version 2.6.37 here is the code :
#include<linux/linkage.h> #include<linux/kernel.h> #include<linux/fs.h> //for getname #include<linux/err.h> //for PTR_ERR asmlinkage int sys_hariohm(const char __user *filename) { char *tmp = getname(filename); int fd=PTR_ERR(tmp); if (!IS_ERR(tmp)) { printk("filename %s \n",tmp); putname(tmp); return fd; } else { return 2; } }
which syscall number did you assigned to this syscall? and exactly how do you assign it?
NB: your code style doesn't follow the Linux kernel coding standart....
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
-- ........................ *MOHIT VERMA*
participants (2)
-
mohit verma -
Mulyadi Santosa