LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-29-2010, 08:29 AM   #1
anil007523
LQ Newbie
 
Registered: Jul 2010
Posts: 16

Rep: Reputation: 2
calling our own system call


i'm working on opensuse .
i wrote my system call which will return thread_size.
for that i updated the file

--> linux 2.6.27.7/include/asm-x86/ unistd_32.h
#define__NR_abc 325
-->linux2.6.27.7/arch/x86/kernel/syscall_table_32.s
.long sys_abc
--> linux 2.6.27.7/kernel/sys.c
asmlinkage long sys_abc(void)
{
return THREAD_SIZE
}
i compiled and installed the kernel but when i call the that abc() in a program its showing some error of undefined reference to abc(). i included all the header files and tried but it din't worked.Can any one say why its not working and where the necessary corrections to be made.
Thank you in advance
 
Old 07-29-2010, 08:38 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Study the following links:

http://tldp.org/LDP/lkmpg/2.6/html/x978.html
and
http://tldp.org/HOWTO/html_single/Im...inux-2.6-i386/
 
0 members found this post helpful.
Old 07-29-2010, 08:45 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Anil

I have noticed that you have not replied to most of your threads which is very bad.

It is *very* important to reply to your own threads in this forum if you want people to help you.
 
0 members found this post helpful.
Old 07-29-2010, 09:37 AM   #4
anil007523
LQ Newbie
 
Registered: Jul 2010
Posts: 16

Original Poster
Rep: Reputation: 2
Thanks for the links about system calls but it is not sufficient it din't helped me as because i already gone through that pages so please if u have any other thing plz send it
 
0 members found this post helpful.
Old 07-29-2010, 09:55 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
anil;

As Anisha points out, you are not posting any follow-up in your other threads where people have tried to help you. If this pattern continues, noone here is going to be able to help you with anything. Please go back to your other threads and respond to the suggestions, requests for clarification, etc.
Quote:
Thanks for the links about system calls but it is not sufficient it din't helped me as because i already gone through that pages so please if u have any other thing plz send it
You need to tell us exactly what you don't understand.

Finally, please do not use texting shorthand here.
 
Old 07-30-2010, 01:37 AM   #6
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by anil007523 View Post
Thanks for the links about system calls but it is not sufficient it din't helped me as because i already gone through that pages so please if u have any other thing plz send it
If you have already gone thorough those pages, it was your responsibility to mention it and all that you have done till now in your first post, simply marking the thread as not helpful and moving ahead is not going to help you here.

Read the following link till end and see if it helps you:
http://www.linuxjournal.com/article/3326

The following is mentioned there:
Quote:
smlinkage int sysSum(int a, int b)
{
printk("calling sysSum\n");
return a+b;
}

Then edit unistd.h and add

#define __NR_sysSum 171

171 is the next in numerical order. In entry.S near the end, add

.long SYMBOL_NAME(sysSum)

Finally, increment by one the number that is the last line:

.space (NR_syscall-172)*4

If you don't match number and name in both files, you will get an “undefined reference to sysSum” error message. If you have a working kernel, you have to be careful only about incrementing the numbers by one and correctly writing your function name. At this point, you have added your system call; now you should get the new kernel with it. To recompile the kernel, take the following sequential steps:

Last edited by TheIndependentAquarius; 07-30-2010 at 02:09 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call system call from usb driver's code Mr.J Linux - Kernel 4 09-29-2008 04:47 AM
Calling a system call in a kernel module linuxdoniv Programming 3 08-08-2008 04:28 AM
How can i make centos 4.5's system call using vDSO(call *%gs:0x10) instead of int80 tclwp Red Hat 3 08-06-2007 01:07 AM
Calling a system call from a system call? Loc_8 Programming 0 09-16-2006 05:21 PM
java, call function in calling object exodist Programming 9 06-14-2004 12:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration