LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 07-28-2009, 06:17 AM   #1
HGaurav
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 1
Exclamation Help in System call


Hi.
I am new to Linux. I just wanted to create a system call. I am using kernel 2.6.28.9. What I did to create a system call is:
1)I created a directory as /usr/src/linux-2.6.28.9/mycall.
2)I created a .c file as /usr/src/linux-2.6.28.9/mycall/mycall.c
SYSTEM_DEFINE1(mycall, int, i)
{
return i+10;
}
3)I created a Makefile file as /usr/src/linux-2.6.28.9/mycall/Makefile
obj-y := mycall.o

4) I edited /usr/src/linux-2.6.28.9/include/linux/syscalls.h
(original file)
asmlinkage long sys_mycall(void);
5) I edited /usr/src/linux-2.6.28.9/usr/include/asm/unistd_32.h
(original file)
#define __NR_mycall 333
6) I edited /usr/src/linux-2.6.28.9/arch/x86/kernel/syscall_table_32.S
(original file)
.long sys_mycall /* 333 */

Now finally when I run the command:
[linux-2.6.28.9]$make M=mycall/
I get the output as :

CC mycall/mycall.o
mycall/mycall.c:3: error: expected ‘)’ before ‘int’
make[1]: *** [mycall/mycall.o] Error 1
make: *** [_module_mycall] Error 2

Where am I wrong?

I tried for the same system call without any argument then on make I got the result as:

CC mycall/mycall.o
mycall/mycall.c:4: warning: return type defaults to ‘int’
mycall/mycall.c:4: warning: function declaration isn’t a prototype
LD mycall/built-in.o
Building modules, stage 2.
MODPOST 0 modules

y is it so?
Is the procedure I adopted, wrong?
Please help me...
 
Old 07-28-2009, 10:48 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...d.php?t=743372

Last edited by Tinkster; 07-28-2009 at 10:55 PM.
 
  


Closed Thread


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
OSE system call functions to Linux Sytem Call functions required roshantraj30 Linux - General 0 06-08-2009 03:06 AM
How to call system call from usb driver's code Mr.J Linux - Kernel 4 09-29-2008 04:47 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
How do I include my own system call in file system driver kgp Linux - Kernel 3 06-06-2007 11:41 AM
Calling a system call from a system call? Loc_8 Programming 0 09-16-2006 05:21 PM


All times are GMT -5. The time now is 10:26 AM.

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