Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Interrupt handler
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer systems programming special block code}} {{More citations needed|date=February 2015}} {{Use mdy dates|date=February 2015}} In computer [[systems programming]], an '''interrupt handler''', also known as an '''interrupt service routine''' ('''ISR'''), is a special block of code associated with a specific [[interrupt]] condition. Interrupt handlers are initiated by hardware interrupts, software interrupt instructions, or software [[exception handling|exceptions]], and are used for implementing [[device driver]]s or transitions between protected modes of operation, such as [[system call]]s. The traditional form of interrupt handler is the hardware interrupt handler. Hardware interrupts arise from electrical conditions or low-level protocols implemented in [[digital logic]], are usually dispatched via a hard-coded table of interrupt vectors, asynchronously to the normal execution stream (as interrupt masking levels permit), often using a separate stack, and automatically entering into a different execution context (privilege level) for the duration of the interrupt handler's execution. In general, hardware interrupts and their handlers are used to handle high-priority conditions that require the interruption of the current code the [[Central processing unit|processor]] is executing.<ref name="tldp-lkmpg">{{Cite web | url = http://www.tldp.org/LDP/lkmpg/2.6/html/x1256.html | title = The Linux Kernel Module Programming Guide, Chapter 12. Interrupt Handlers | date = May 18, 2007 | access-date = February 20, 2015 | publisher = [[The Linux Documentation Project]] }}</ref><ref name="lwn-ldd3">{{Cite web | url = https://lwn.net/images/pdf/LDD3/ch10.pdf | title = Linux Device Drivers, Chapter 10. Interrupt Handling | date = January 27, 2005 | access-date = February 20, 2015 | author1 = Jonathan Corbet | author2 = Alessandro Rubini | author3 = Greg Kroah-Hartman | publisher = [[O'Reilly Media]] }}</ref> Later it was found convenient for software to be able to trigger the same mechanism by means of a software interrupt (a form of synchronous interrupt). Rather than using a hard-coded interrupt dispatch table at the hardware level, software interrupts are often implemented at the [[operating system]] level as a form of [[Callback (computer programming)|callback function]]. Interrupt handlers have a multitude of functions, which vary based on what triggered the interrupt and the speed at which the interrupt handler completes its task. For example, pressing a key on a [[computer keyboard]],<ref name="tldp-lkmpg" /> or moving the [[Computer mouse|mouse]], triggers interrupts that call interrupt handlers which read the key, or the mouse's position, and copy the associated information into the computer's memory.<ref name="lwn-ldd3" /> An interrupt handler is a low-level counterpart of [[event handler]]s. However, interrupt handlers have an unusual execution context, many harsh constraints in time and space, and their intrinsically asynchronous nature makes them notoriously difficult to debug by standard practice (reproducible test cases generally don't exist), thus demanding a specialized skillset—an important subset of [[system programming]]—of software engineers who engage at the hardware interrupt layer.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)