LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-06-2009, 02:37 AM   #1
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
a part of a project running as a kernel module !!


friends,

any one dealing with interrupt handelers in linux ? i've been trying out a keyboard interrupt handeler ! Kindly share your practical experiences with interrupt handelers in linux !

Last edited by Aquarius_Girl; 10-06-2009 at 03:45 AM. Reason: wrong title
 
Old 10-06-2009, 03:34 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
Kernel module has to be be linked to kernel library, so how it a standard project run as kernel module.

thnks
 
Old 10-06-2009, 05:52 AM   #3
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
What's to share? You write a handler, it grabs the interrupt, you process it appropriately in an interrupt service routine, you keep on going.
 
Old 10-09-2009, 02:08 AM   #4
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/home/anisha/Desktop/t2.c: In function ‘irq_handler’:
/home/anisha/Desktop/t2.c:62: error: ‘INIT_WORK’ undeclared (first use in this function)

I got this error message while compiling a user defined keyboard interrupt handler

kernel: 2.6.22.5-31-default i686

kindly help !
 
Old 10-09-2009, 02:13 AM   #5
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by anishakaul View Post
error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/home/anisha/Desktop/t2.c: In function ‘irq_handler’:
/home/anisha/Desktop/t2.c:62: error: ‘INIT_WORK’ undeclared (first use in this function)

I got this error message while compiling a user defined keyboard interrupt handler

kernel: 2.6.22.5-31-default i686

kindly help !
Read the error message -- pass 2 arguments, not 3. I would be more specific, but you haven't posted the code that created the error message.
 
Old 10-09-2009, 02:15 AM   #6
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
just now I found out the INIT_WORK macro's syntax has changed since kernel 2.6.22.5-31, it now takes just 2 arguements ! Now what about the original data storage so that the work function could retrieve it.
 
Old 10-09-2009, 02:52 AM   #7
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
friends,
do you know something regarding function inb(). I read the following in man but couldnt make it out !!

-------------------------------------
This family of functions is used to do low-level port input and output. The out* functions do port output, the in* functions do
port input; the b-suffix functions are byte-width and the w-suffix functions word-width; the _p-suffix functions pause until the
I/O completes.

They are primarily designed for internal kernel use, but can be used from user space.

You compile with -O or -O2 or similar. The functions are defined as inline macros, and will not be substituted in without opti‐
mization enabled, causing unresolved references at link time.

You use ioperm(2) or alternatively iopl(2) to tell the kernel to allow the user space application to access the I/O ports in ques‐
tion. Failure to do this will cause the application to receive a segmentation fault.
-------------------------------------

thanks !
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem running kernel module jopu Linux - Newbie 2 03-14-2007 11:58 PM
how to make my module part of kernel furahm Linux - General 1 07-10-2006 03:33 AM
compile module for running kernel maenho Linux - Software 5 06-27-2005 01:44 PM
Kernel Module compilation and running imransadat Programming 3 03-04-2005 06:56 AM
insert module into non-running kernel... howto? euph0rix Linux - Newbie 2 01-25-2005 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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