LinuxQuestions.org
Review your favorite Linux distribution.
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 03-24-2011, 11:23 AM   #1
surabhi suppu
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
Smile process of creating system call


Hi ..,
how to create a new system call Linux? what is the process of creating ?my project is to create a system call for displaying owner of a file..where exactly we have to write the system call code? and where are the places need to change ?
Thank u
 
Old 03-24-2011, 11:43 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
You just need to create a binary program that performs the actions you wish and then place that in a directory that is included in your path; typically /usr/sbin is a good choice.

If you're talking about adding to your shell, then you'll need to grab the source for that shell and rebuild it. Typically that's not a necessity and you just need a script or executable that accomplishes the task you wish. For that matter, you can use a script to get the output of ls and use sed to edit that output to be in a suitable form.
 
Old 03-24-2011, 01:27 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by surabhi suppu View Post
my project is to create a system call
If this is your project then you should start by doing research. O'Reilly's Understanding the Linux Kernel version 3 (ULK3) would be a suggested starting point to read about how binaries interact with libraries and how userland interacts with the kernel. Then using your favorite search engine to search for "create system call" (and searching LQ for the same) should yield a ton of examples.
 
1 members found this post helpful.
Old 03-25-2011, 12:26 AM   #4
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
This might help
http://www.amazon.com/Linux-Kernel-D.../dp/0672325128

There is enough material available on line if you search
 
Old 03-25-2011, 02:24 AM   #5
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
and hit out Google with the keywords:
Tldp implementing a system call Linux 2.6
 
1 members found this post helpful.
Old 04-14-2011, 02:07 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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
[SOLVED] Problem in creating System call HGaurav Programming 6 07-31-2009 05:42 AM
How to a detect process is running in system call or not? nisarg Linux - Kernel 3 03-18-2009 06:19 PM
When does process swap happen in a system call? oldfogie Programming 3 05-03-2005 07:35 PM
help creating a system call drumlix18 Linux - Newbie 4 10-19-2004 07:14 PM
Changing Process Priority in Linux w/ System Call sptchamp Programming 2 07-21-2004 09:58 AM

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

All times are GMT -5. The time now is 07:27 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
Open Source Consulting | Domain Registration