LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-06-2007, 11:16 AM   #1
raga4223688
LQ Newbie
 
Registered: Feb 2007
Posts: 11

Rep: Reputation: 0
I want add my own system call using LKM (loadable kernel module)...


I want add my own system call using LKM (loadable kernel module)...


Can anybody help me out....i need to customize the system call such that it would help me to send parametres to it and be able to return values.........
 
Old 03-07-2007, 07:21 AM   #2
hal_2001
LQ Newbie
 
Registered: Oct 2003
Location: UK
Distribution: Mandriva, Red Hat, Fedora Core, MontaVista
Posts: 23

Rep: Reputation: 16
Not sure whether you really mean system call ? Perhaps you mean driver API ?

A solution is to create a kernel module that has an IOCTL interface to user-land. You need to create a /dev entry for the driver. The user-land application opens the /dev entry and uses your IOCTL messages.

Another method is to use /sys entries. Your kernel module creates /sys entries and assoicates functions to reading and writing of those /sys entries. Therefore, using command line cat and echo commands, the sys entries can be read or writen to respectively. This would allow you to read and write parameters into the kernel module.

Suggest you look at Linux O'Reilly books called "Linux Device Drivers" 3rd edition and "Understanding the Linux Kernel" 3rd edition.

Otherwise, find source code for an existing driver and use it as a template.

Last edited by hal_2001; 03-07-2007 at 07:22 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
system call to load and unload the module in kernel sharad Linux - Kernel 3 03-01-2007 05:00 AM
Help, loadable kernel module . ERBRMN Linux - General 3 10-13-2006 07:34 AM
Add New System Call in RH9 kernel-2.4.20-8 kamal_h_mehta Programming 0 04-08-2006 08:51 AM
how to add another system call in to the kernel?? Pratik H Pandya Programming 1 03-26-2006 02:02 AM
how to add new loadable module to kernel? Mistreated Linux - Software 7 02-02-2005 10:22 AM

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

All times are GMT -5. The time now is 08:12 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