Questions tagged [interrupt-handling]

The concept of handling system interrupts in an application or embedded system.

The concept of handling system interrupts in an application.

This tag may also refer to an operating-system-specific way of handling interrupts, or interrupt handling in a specific type of microcontroller or processor.

Use this tag only if you have reason to believe that your issue is directly related to interrupt handling. Do not use this tag if your application is using interrupt handling, but interrupt handling does not cause the issue your are asking about.

828 questions
9
votes
4 answers

Does executing an int 3 interrupt stop the entire process on Linux or just the current thread?

Suppose the architecture is x86. And the OS is Linux based. Given a multithreaded process in which a single thread executes an int 3 instruction, does the interrupt handler stop from executing the entire process or just the thread that executed the…
MciprianM
  • 513
  • 1
  • 7
  • 18
9
votes
1 answer

Atmel Studio Dummy_Handler

Occasionally I will get an unexpected interrupt, and my code will hang inside Dummy_Handler() in exceptions.c of the Atmel Studio Framework (ASF). I am using the ATSAM3X8E microcontroller of the Arduino Due. void Dummy_Handler(void) { while(1)…
Bob Stein
  • 16,271
  • 10
  • 88
  • 101
9
votes
2 answers

Detecting the type of iPhone interrupt

I can detect that the iPhone went to sleep and came back from sleep, by using the applicationWillResignActive and applicationDidBecomeActive. But how do I find out what kind of interrupt it was. I am making an audio player application, and need to…
Prashant
  • 937
  • 1
  • 10
  • 23
8
votes
3 answers

What happens if another interrupt is raised before the first interrupt action is completed?

This question is from the interrupt handling topic. Suppose an interrupt is being serviced. What happens if another interrupt is raised even before the first interrupt action is completed?
pinky
8
votes
3 answers

interrupt() not working as expected (how does interrupt work?)

I want to interrupt a thread, but invoking interrupt() doesn't seem to work. Below is the sample code: public class BasicThreadrRunner { public static void main(String[] args) { Thread t1 = new Thread(new Basic(), "thread1"); …
jason
  • 1,621
  • 6
  • 21
  • 39
8
votes
2 answers

How can I add a user interrupt to an infinite loop?

I have a ruby script below which infinitely prints numbers from 1 onward. How can I make the script stop its infinite execution through an interrupt in the terminal like 'Ctrl+C' or key 'q'? a = 0 while( a ) puts a a += 1 # the code should…
boddhisattva
  • 6,908
  • 11
  • 48
  • 72
8
votes
2 answers

what is chained irq in linux, when are they need to used?

What is chained IRQ ? What does chained_irq_enter and chained_irq_exit do, because after an interrupt is arised the IRQ line is disabled, but chained_irq_enter is calling functions related to masking interrupts. If the line is already disabled why…
valmiki
  • 701
  • 9
  • 24
8
votes
2 answers

How to correctly handle SIGINT to close files/connections

I want to implement a proper SIGINT handling in my script, which opens multiple files and a database connection. These should be closed if the script is CTRL+C'd or somehow else interrupted. Previously I've used the KeyboardInterrupt exception to…
Daedalus Mythos
  • 565
  • 2
  • 8
  • 24
8
votes
3 answers

Are polling and event-driven programming different words for the same technique?

I studied interrupts vs cyclical polling and learnt the advantages of interrupts that don't have to wait for a poll. Polling seemed to me just like event-driven programming or at least similar to a listener and what the polling does is actually much…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
8
votes
2 answers

How To Let Java Handle System Interrupts Like Ctrl+C

I have a java program which creates a lock file to ensure that no other executions run at the same time as it. If the program runs it creates the file, and upon exit, either successful or via an exception, the file is removed. But if the user hits…
dimo414
  • 47,227
  • 18
  • 148
  • 244
8
votes
1 answer

Identifying faulting address on General Protection Fault (x86)

I am trying to write a ISR for the General Protection Fault (GP#13) on x86. I am unable to figure out from the INTEL docs as to how I can find out the faulting address causing the exception. I know that for Page fault exceptions (GP#14) the cr2…
rss
  • 83
  • 1
  • 3
7
votes
7 answers

Difference between return from interrupt(RTI) and return from subroutine(RTS)

I would like to know what is difference between return from interrupt(RTI) and return from subroutine(RTS). Are both are the same or there is any difference between these two?
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
7
votes
2 answers

Function parameter passing in a Linux kernel interrupt handler (from asm to C)

When I read the Linux kernel source, I came across this piece of code: __visible void __irq_entry smp_apic_timer_interrupt(struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); entering_ack_irq(); …
7
votes
1 answer

How do interrupts work in hardware virtualization?

Suppose A Virtual Machine (VM1) is running and it creates an IO request (file read) Before the request is finished another Virtual Machine (VM2) is scheduled by VMM Now the IO is finished and DMA causes interrupt. This interrupt will cause…
7
votes
1 answer

detecting interrupt on GPIO in kernel module

I am toggling the input into a GPIO line on my BeagleBone from high to low every 500 ms using an Atmel uC. I have registered a handler for this in my Linux Kernel Module, but the handler is not being called for some reason. My module code is…
1 2
3
55 56