LinuxQuestions.org
Help answer threads with 0 replies.
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
 
LinkBack Search this Thread
Old 07-12-2008, 07:15 AM   #1
ashok449
Member
 
Registered: Sep 2007
Location: noida
Distribution: suse
Posts: 63

Rep: Reputation: 16
lowest level of interrupt handling in kernel


Hi All,

I was trying interrupt handling.

request_irq(13, &ash_irq_handler, SA_SHIRQ, "ashok_interrupt", NULL);

from this I got entry in /proc/interrupts

now I wanna handle interrupt at hardware level, Book, Linux Device Drivers -Runini says The lowest level of interrupt handling can be found in entry.S

Can any one tell me how to handle interrupts at low level in linux kernel. what all the other files where I need to add my interrupt?

Thanks all in advance ...


-Ashok
 
Old 07-15-2008, 06:41 AM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 489

Rep: Reputation: 49
Quote:
Can any one tell me how to handle interrupts at low level in linux kernel.
what do you mean by this?
If you need a lowest level than the one provided by linux kernel mechanism, so don't use linux kernel, try a "stand alone" application. When A. Rubini says that "The lowest level of interrupt handling can be found in entry.S", you have to understand that is where the linux kernel connect with hardware interrupts. But right after that, the interrupts is "caught" by the kernel and the only good way to use it is through the "request_irq" mechanism. Maybe, if your a "place your arch here" guru, and you're well aware of the linux interrupts handling mechanism, you can modify the entry.S to fit a latence requirement for a specific IRQ... But IMHO it's the wrong way: I think it's far better to try a RT OS, or a 'stand alone' application (I mean an application which doesn't need facility given by a complex system like linux)
 
Old 07-15-2008, 11:42 PM   #3
ashok449
Member
 
Registered: Sep 2007
Location: noida
Distribution: suse
Posts: 63

Original Poster
Rep: Reputation: 16
okay, I have a register boot time value 0x03 , when an interrupt comes it becomes 0x02 at this time I would like to call my interrupt handle.

request_irq(13, &ashok_irq_handler, SA_SHIRQ, "ashok_interrupt", NULL);
is this enough to handle the same?

how that interrupt will call "ashok_irq_handler" handler ?

I may be wrong but I would like to know what is the process to do the same.


Thanks in advance,
Ashok
 
Old 07-27-2008, 08:49 PM   #4
sundialsvcs
Senior Member
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 3,681

Rep: Reputation: 329Reputation: 329Reputation: 329Reputation: 329
All hardware interrupts can call one or more "bottom-half handlers." These handlers generally check to see if "their" device is the one responsible for the interrupt, and if so, they schedule a "top-half routine" to do the meat-and-potatoes work. Any number of handlers can be called.

The exact mechanisms for doing this have changed over time, but the essential idea is the same: the hardware-triggered response is short and sweet, and it schedules the "real consequences" to take place a very short time later.
 
Old 07-27-2008, 09:05 PM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Squeeze, Fedora 14
Posts: 7,268

Rep: Reputation: 83
Quote:
Originally Posted by ashok449 View Post

now I wanna handle interrupt at hardware level, Book, Linux Device Drivers -Runini says The lowest level of interrupt handling can be found in entry.S
Here is entry.S:

http://lxr.linux.no/linux/arch/i386/kernel/entry.S

-------------------------
Steve Stites
 
Old 07-28-2008, 08:28 AM   #6
ashok449
Member
 
Registered: Sep 2007
Location: noida
Distribution: suse
Posts: 63

Original Poster
Rep: Reputation: 16
Code:
request_irq(13, &ash_irq_handler, SA_SHIRQ, "ashok_interrupt", NULL);
Can u plz tell me how should my interrupt entry looks like in entry.s
note: I'm working on powerpc


It would be appreciable if you can explain the flow of interrupt form hardware level to ISR.


Thanks in advance ...
Ashok
 
Old 07-28-2008, 08:44 AM   #7
sundialsvcs
Senior Member
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 3,681

Rep: Reputation: 329Reputation: 329Reputation: 329Reputation: 329
If you trace this logic from this foundation up to routines like do_IRQ(), you'll see that the interrupt handler code attempts to spend the least possible amount of time in a hardware-interrupt context. It wants to gather whatever status-information is to be found on the hardware-device latches, and then "get the hell out of there."

The usual response is to pre-empt the current task on this CPU, having scheduled the top-half interrupt handling routine to run. The time between this "bottom-half" response and the "top-half" response is called interrupt latency. Unlike a "real-time operating system (RTOS)," Linux does not guarantee latency-time.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
interrupt handling... culin Programming 2 02-12-2007 11:35 PM
Interrupt handling in C vkmgeek Programming 4 02-28-2006 01:42 AM
interrupt handling mp4-10 Programming 5 02-14-2005 06:13 AM
handling packets at kernel level using C/C++ valib4u Linux - Networking 3 09-14-2003 02:29 PM
packet handling at the kernel level valib4u *BSD 4 09-14-2003 03:16 AM


All times are GMT -5. The time now is 12:39 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration