LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 06-02-2004, 12:16 PM   #16
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30

i finally got to play w/ this last night, fun stuff im going to put a tutorial on my website on how to do it, i'll be sure to credit u. want me to put up ur email addy, or site, or w/e ?
 
Old 06-02-2004, 11:35 PM   #17
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
http://www.1nfamus.netfirms.com/#syscalls

there it is.
 
Old 04-08-2006, 06:50 AM   #18
kamal_h_mehta
LQ Newbie
 
Registered: Oct 2005
Posts: 3
Blog Entries: 1

Rep: Reputation: 0
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.

Last edited by kamal_h_mehta; 04-08-2006 at 06:52 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a system call to SuSE Linux khcm8jw Linux - Newbie 3 10-23-2005 04:36 AM
Adding system call in linux guam Programming 2 12-04-2004 01:38 PM
Adding system call dumb82 Linux - Newbie 0 07-20-2004 02:25 AM
Adding new System Call to Kernel kurt_ram Linux - General 1 10-22-2002 03:59 PM
adding system call in linux udayan Programming 1 05-02-2002 03:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration