• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How Interrupt Works

By Abhishek Ghosh May 2, 2024 10:53 pm Updated on May 2, 2024

How Interrupt Works

Advertisement

In previous article, we have discussed the basics of interrupt. In order to be able to trigger an interrupt, the hardware connected to the main processor (CPU) must be interrupt-capable, i.e. generate an output signal (electrical voltage at an output pin) via the so-called interrupt line when a certain event occurs. The CPU generally has separate pins for maskable (disabled) interrupts (INTR) and non-maskable interrupts (NMI). Since the interrupt number must also be transmitted to the CPU for interrupts that cannot be masked, many systems have an interrupt controller to which this task is delegated in case the peripheral cannot do it itself.

How Interrupt Works

 

Unmaskable Interrupt

 

When the NMI is triggered, the CPU disables the maskable interrupts and jumps to an address specified by the CPU manufacturer for NMI, which is usually located in the fixed-value memory, depending on the computer. The ISR (Interrupt Service Routine) stored there usually triggers a restart of the system or a global error handling. Application software has no influence whatsoever on the behavior of an NMI. Even the system software cannot prevent an NMI from being treated.

 

Masked interrupt

 

This section needs a major overhaul. More details should be provided on the talk page. Please help improve it, and then remove this marker.
If a signal ([Vcc]) appears on this pin, which is usually referred to as NMI, while interrupts are currently not masked (for x86 the interrupt flag (IF) is set), the CPU disables all maskable interrupts and reads the number of the requested interrupt from the system bus (Intel64 hardware distinguishes 256 interrupt numbers). There, the requester must create the number before the request. The CPU then consults the interrupt vector table and extracts the address of the corresponding interrupt service routine. This is part of the driver software of the triggering hardware. When executed, this routine must first secure the entire compromised processing context, i.e. the processor registers it will use. This is followed by the actual handling of the interrupt, and finally the return of the context and return to the statement that was last executed before the interrupt was handled. When rebounding, the previously locked interrupts are also unmasked (reactivated). For this, there is a special interrupt return statement from the CPU instruction set that is used instead of the normal return statement. Technically, the process is similar to that of a normal subroutine call with additional handling of interrupt masking.

Advertisement

---

 

Software-triggered interrupt

 

On many processors, interrupt handling can also be triggered by a machine instruction (“INT nn”). As with hardware interrupts, when handling the interruption request, the processor achieves a higher level of privilege at which the interrupt routine runs. This is how individual operating systems implement system calls.

 

Latency

 

The time between the creation of the IRQ signal and the start of the corresponding processing is called latency. For an interrupt of the highest assigned priority, the latency depends mainly on the hardware – with shadow registers, context switching can succeed in a clock cycle. For lower-priority interruptions, latency is determined by the execution time of the preferred interrupt routines. Real-time operating systems are organized and configurable in a way that makes real-time requirements easier and more demonstrable.

 

Masking

 

Interrupt requests can be temporarily ignored by the CPU, for example, when another interrupt is being handled. This may be necessary for certain time-sensitive and synchronizing routines, such as in device drivers. Masking (temporary blocking/deactivation) is possible for all interrupts except for the non-maskable interrupts (NMI: Non Maskable Interrupt). The latter are intended for special cases (power failure, hardware failure, etc.). Also not maskable are so-called software interrupts, which are triggered by a machine command in a program – for example, ‘int IRQNUMMER’ is used in Linux x86 systems to switch from normal applications to kernel mode via system calls (syscalls).

 

Asynchrony

 

External interrupts (hardware interrupts) are generally asynchronous with respect to the interrupted program, i.e. the execution of the program is at an indeterminate point when the interrupt occurs. Therefore, interrupts must not have a direct impact on programs (or program variables) or devices (such as hard drives) without special synchronization measures. ISRs are not tasks in the sense of the operating system. For ISRs, it should also be pointed out that interrupt masking may only be removed (interrupt enable) with special software concepts within the ISRs, as both interrupt nesting by third-party ISRs and a re-entry option of the same interrupt are created.

Some processors have special commands to trigger so-called “software interrupts” from a running task, which, apart from the special entry and return conditions, act like subroutine calls and are therefore not asynchronous. The same applies to traps that are triggered by the CPU itself in the event of errors (protected access, forbidden instructions (e.g. division by zero), single-step debugging, memory management events, but also as a standard interface to operating system calls, etc.) and usefully use the same mechanism.

 

Interrupt Service Routines as a Programming Principle

 

Especially in the case of hardware-related event-driven applications, as they are common in embedded systems, one possible approach is to move more or less the entire functionality of the system to the interrupt routines or tasks triggered by them. Typically, the processor can be put into an energy-saving hibernation state (idle state), from which it wakes up in the event of interrupt requests (i.e. external events). In extreme cases, the main program consists only of an initialization part, which is run through after the system starts, followed by an infinite loop in which – apart from activating the above-mentioned hibernation state – nothing happens.

Tagged With plainznk
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How Interrupt Works

  • What is Interrupt?

    An interrupt is a short-term interruption of the normal execution of a program, in order to process a usually short, but time-critical, process. The triggering event is called an interrupt request (IRQ).

  • Multi-Core Processor Based Computer vs. Multi-CPU Computer

    Multi-Core Processor Based Computer vs. Multi-CPU Computer has differences. For Servers, Workstations the processors are multiple plus multi-core on one board.

  • Basic Arduino Oscilloscope (on Serial Plotter)

    Here is a Basic Arduino Oscilloscope, Which Will Show Plotting on Serial Plotter of Arduino Web IDE and Analog Inputs Work as 6 Channels.

  • Processor – How It Works

    Processor or CPU is the most important part of any computing device. Here are the details of this living heart of your Computer or Mobile Computing device.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

vpsdime

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cloud-Powered Play: How Streaming Tech is Reshaping Online GamesSeptember 3, 2025
  • How to Use Transcribed Texts for MarketingAugust 14, 2025
  • nRF7002 DK vs ESP32 – A Technical Comparison for Wireless IoT DesignJune 18, 2025
  • Principles of Non-Invasive Blood Glucose Measurement By Near Infrared (NIR)June 11, 2025
  • Continuous Non-Invasive Blood Glucose Measurements: Present Situation (May 2025)May 23, 2025
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2026 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy