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
3
votes
1 answer

Understand IDTR register?

I can't understand this image which explain IDTR in intel X86-64 processor. IDT base adress size is 64 and I totally get that since it can be nearly anywhere in memory. But, why IDT limit is 16 bits? why we need all of these bits? each vector is of…
user15961623
3
votes
1 answer

My EXTI0 interrupt handler is not overwritten/working properly (STM32F3Discovery)

I'm trying to learn about coding for embedded devices and want to implement an interrupt. For that, I have written a program where the main function is just a loop that blinks one led and the interrupt should light up another led to test if…
MEisebitt
  • 122
  • 7
3
votes
1 answer

Is this a safe way to disable interrupts on PIC24?

I am working on a project that uses a Microchip PIC24FJ256GA702. For several days I have been looking for an intermittent bug with some UART code. It uses an interrupt service routine (ISR) to transmit a buffer named char txBuff[] and its length int…
James
  • 5,635
  • 2
  • 33
  • 44
3
votes
1 answer

Python: handling interrupts whilst running subprocess

I wrote a simple Python parser for tcpdump. The idea is to continuously run tcpdump as a subprocess, parse its output and output basic reports when the user requests them (by Ctrl-Z interrupts) without stopping the script. A Ctrl-C should also…
ktorn
  • 1,032
  • 8
  • 14
3
votes
1 answer

Interrupt handler on C doesn't work after one interrupt

I'm trying to implement keyboard interrupt handler using C and QEMU. But when I execute the program my handler print only one character. After that the handler doesn't work at all. My IDT setup: struct IDT_entry { unsigned short int…
3
votes
1 answer

What happens if we sleep in an interrupt handler on SMP

What will happen if we sleep in an interrupt handler on a SMP Machine, I wrote a sample keyboard driver and added sleep on the interrupt handler #include #include #include #include…
md.jamal
  • 4,067
  • 8
  • 45
  • 108
3
votes
3 answers

Will disabling interrupts protect a non-volatile variable or can reordering happen?

Suppose INTENABLE is a microcontroller's register that enables/disables interrupts, and I have it declared somewhere in my libraries as a volatile variable located at the appropriate address. my_var is some variable that is modified within one or…
tlongeri
  • 122
  • 1
  • 7
3
votes
1 answer

iretq throwing GP fault

I'm trying to write a 64 bit OS. It throws a GP on iretq from the timer interrupt handler, then repeatedly throws more GPs from the iretq of the GP handler. I know this because my generic handler prints the ISR number on the serial port, and it…
Adrian May
  • 2,127
  • 15
  • 24
3
votes
0 answers

How to terminate waiting threads created by interrupting third party thread

I believe I have researched answers to similar problems and have not found the answer to my specific issue. I am using an open source Text-To-Speech software from a third party in Java, and when I cancel and/or interrupt the text to speech message,…
3
votes
1 answer

STM32F303VCT6 external interrupt with PA0 button won't toggle LED

I want to use a button connected to PA0 as an external interrupt to toggle LED on PE14 on button press. However calling the configure_PA0 function doesn't seem to work. I did a simple blinking instruction in while loop to test and it turns out when…
Viral
  • 31
  • 4
3
votes
1 answer

The cross-platform version of gcc ignore the attribute tag __attribute__((interrupt)) of my function

I downloaded the intel IA-64 and 32 book because I wanted to know more in depth about how a CPU works. So I read the book and started to code some stuff. I enabled the IDT and when I want to program an interrupt handler I have that code : extern "C"…
Adrien
  • 439
  • 4
  • 15
3
votes
4 answers

Creating interruptible process in python

I'm creating a python script of which parses a large (but simple) CSV. It'll take some time to process. I would like the ability to interrupt the parsing of the CSV so I can continue at a later stage. Currently I have this - of which lives in a…
Glycerine
  • 7,157
  • 4
  • 39
  • 65
3
votes
1 answer

Set and reset keyboard Interrupt Service Routines in x86 real mode within DOS with Assembly

How do you properly set, and then reset, the keyboard ISR in DOS? (x86 assembly, real mode, 16 bit, with TASM) I have the following assembly code which sets up my ISR for the keyboard. All it is supposed to do is print out a sentence each time a…
MarkInTheDark
  • 244
  • 2
  • 15
3
votes
1 answer

qemu kvm: how to get permformance monitoring interrupt?

I write some function in my OS kernel to issue the performance monitoring interrupt (PMI) on instructions counter overflow. It works well on my machine (Intel core i5). But when I run it on qemu using qemu-system-x86_64 -enable-kvm -cpu host -m…
Mahouk
  • 902
  • 9
  • 28
3
votes
0 answers

Setting up IDT in long mode

I am writing a kernel and as an assembly project, I am writing the whole thing in assembly (specifically intel). I have searched the internet trying to find info on what an IDT should look like in long mode, but I haven't really found a concise…
Mike
  • 175
  • 1
  • 13