Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 11-29-2005, 08:48 PM   #1
Registered: Nov 2005
Posts: 337

Rep: Reputation: 30
Linux Interrupt Handler

Are Linux Interrupt handler basically the same as DOS? Also, how to write an interrupt handler for NMI? Just very generally
Old 12-01-2005, 11:55 AM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,508
Blog Entries: 4

Rep: Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954
Interrupts are handled by the kernel, usually in device-drivers. The best place to learn about them is to look at some of the driver source-code in your kernel.

The Linux Documentation Project (TLDP) has several articles on the subject, including this relevant chapter of the Module Programming guide.

If you like to read books in the loo , not just online (that is, I hope you don't have a computer there!), then there are many good titles on O'Reilly Publishing's web-site, such as this one.

It is very important to understand the complete relationship of the various parts of the kernel. In DOS, there is no multitasking, no virtual memory. In Linux, you might be sharing the world with eight other CPUs and a thousand active processes. So, the interrupt handling system is logically split into two parts, sometimes called the "top half" and the "bottom half." (There was, at one time, a mechanism called TH/BH, now generally superseded by tasklets.) Anyhow, the essential idea is that the hardware interrupt itself (the "top half") is essentially only a signal that causes the "real" work, in the "bottom half," to be immediately scheduled. But you also have issues to consider, like what happens if the process that requested the I/O operation has been swapped-out while waiting? What if the user, accidentally or deliberately, specified a memory-address that he does not own, or owns but is not permitted to write to? And the address, of course, is virtual, not real.

It's not extraordinarily difficult but it is tricky. You can often base your work on an existing production driver, copying it and changing only the essential parts of the code.


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
printk in the interrupt handler lordofring Programming 3 08-23-2005 08:00 PM
Custom Timer Interrupt Handler Linux 2.4x ratwings Linux - Software 2 01-13-2005 01:51 AM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
Why this interrupt handler does not work? opereira Programming 1 03-04-2004 01:37 PM
Timer Interrupt Handler opereira Programming 1 03-03-2004 04:57 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration