LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-08-2006, 08:51 AM   #1
kamal_h_mehta
LQ Newbie
 
Registered: Oct 2005
Posts: 3
Blog Entries: 1

Rep: Reputation: 0
Add New System Call in RH9 kernel-2.4.20-8


Help Me????

--------------------------------------------------------------------------------

Hi,
I have read your post. I m trying to add my system call in RH9 kernel 2.4.20-8 but i am not successfull till now. I am telling you what i have done.

1. I have added syscall number in /linux-2.4.20-8/include/asm/unistd.h

...
#define __NR_proc_mig 259

2. I have made sys_proc_mig() function in kernel/sys.h

...
asmlinkage int sys_proc_mig(int pid)
{
printk("proc_mig");
return pid;
}

3. I have modified arch/i386/kernel/entry.S

.data...
...
... /*258*/


.rept (NR_syscalls-(.-sys_call_table)/4 -1)
.long SYMBOL_NAME(sys_ni_syscall)
.endr

.long SYMBOL_NAME(sys_proc_mig) /*259*/

This much is also not working and generating stub for this is also not working.

4. My user program is:

#include <errno.h>
#include <unistd.h>

static inline _syscall1(int,proc_mig,int,pid);

int main(int argc,char *argv[])
{
printf("%d",proc_mig(atoi(argv[1])));
return 1;
}

Removing 'static inline' also not working and i am getting error msgs like:
[root@broadmind root]# gcc -o hello hello.c
hello.c:4: parse error before "proc_mig"
hello.c:4: warning: data definition has no type or storage class
[root@broadmind root]#
if I add 'static inline' then warning is removed but error remain as it is. If I remove stub then i get
gcc -o hello hello.c
/tmp/ccIwjYEM.o(.text+0x28): In function `main':
: undefined reference to `proc_mig'
collect2: ld returned 1 exit status
adding init function to main also not working.
Please help me as soon as possible my friend.
Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
add new system call linux_lover2005 Programming 2 10-14-2006 01:37 AM
how to add another system call in to the kernel?? Pratik H Pandya Programming 1 03-26-2006 02:02 AM
To add our own system call,compilation problem hegdeshashi Linux - Networking 1 01-27-2006 11:13 PM
how to add my own system call in RedHat linux9.0(2.4.7-20kernel) tyler28 Programming 0 06-15-2005 04:06 AM
Error when add a new system call in RH9.0. GreenStar Linux - Newbie 2 11-01-2003 01:52 PM


All times are GMT -5. The time now is 02:50 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration