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
135
votes
3 answers

kernel stack and user space stack

What's the difference between kernel stack and user stack? Why kernel stack is used? If a local variable is declared in an ISR, where it will be stored? Does each process has its own kernel stack? Then how the process coordinates between both these…
jkv
  • 1,627
  • 4
  • 12
  • 14
80
votes
4 answers

How to trap ERR when using 'set -e' in Bash

I have a simple script : #!/bin/bash set -e trap "echo BOO!" ERR function func(){ ls /root/ } func I would like to trap ERR if my script fails (as it will here b/c I do not have the permissions to look into /root). However, when using set…
irritable_phd_syndrome
  • 4,631
  • 3
  • 32
  • 60
29
votes
5 answers

How to save the registers on x86_64 for an interrupt service routine?

I am looking at some old code from a school project, and in trying to compile it on my laptop I ran into some problems. It was originally written for an old 32 bit version of gcc. Anyway I was trying to convert some of the assembly over to 64 bit…
Mr. Shickadance
  • 5,283
  • 9
  • 45
  • 61
27
votes
3 answers

Do interrupts interrupt other interrupts on Arduino?

I have an Arduino Uno (awesome little device!). It has two interrupts; let's call them 0 and 1. I attach a handler to interrupt 0 and a different one to interrupt 1, using attachInterrupt() :…
Chris Laplante
  • 29,338
  • 17
  • 103
  • 134
27
votes
5 answers

How are interrupts handled on SMP?

How are interrupts handled on SMP (Symmeteric multiprocessor/multicore) machines? Is there only one memory management unit or more? Say two threads, A and B running on different cores touch a memory page (at the same time) which is not there in the…
pythonic
  • 20,589
  • 43
  • 136
  • 219
24
votes
4 answers

Difference between SoftIRQs and Tasklets

While studying Linux interrupt handling I found that Tasklets and SoftIRQs are two different methods of performing "bottom half" (lesser priority work). I understand this (quite genuine need). Difference being, SoftIRQs are re-entarant while a…
ultimate cause
  • 2,264
  • 4
  • 27
  • 44
23
votes
3 answers

How to send an interrupt signal

I'm trying to implement a function that would call an interrupt signal in Go. I know how to intercept interrupt signals from the console, by using signal.Notify(interruptChannel, os.Interrupt), however, I can't find a way to actually send the…
ThePiachu
  • 8,695
  • 17
  • 65
  • 94
19
votes
1 answer

On x86, when the OS disables interrupts, do they vanish, or do they queue and 'wait' for interrupts to come back on?

My platform is x86 and x86-64, on Windows. The point of the interrupt priority system is to have the highest priority interrupt beat out the others. To enforce this, I'm guessing that Windows will disable all interrupts of lower level completely,…
VoidStar
  • 5,241
  • 1
  • 31
  • 45
18
votes
4 answers

Linux Interrupt Handling in User Space

In Linux, what are the options for handling device interrupts in user space code rather than in kernel space?
Brandon E Taylor
  • 24,881
  • 6
  • 47
  • 71
16
votes
2 answers

printk inside an interrupt handler , is it really that bad?

everybody knows that interrupt handler should be short as possible. and adding functions like printk for debugging inside an interrupt handler is something that shouldn't be done. Actually, I tried it before when I was debugging the linux kernel for…
stdcall
  • 27,613
  • 18
  • 81
  • 125
16
votes
5 answers

what is meant by disabling interrupts?

When entering an inteerupt handler, we first "disable interrupts" on that cpu(using something like the cli instruction on x86). During the time that interrupts are disabled, assume say the user pressed the letter 'a' on the keyboard that would…
trohit
  • 163
  • 1
  • 1
  • 5
16
votes
3 answers

Which stack is used by Interrupt Handler - Linux

In a multitasking system when any hardware generates a interrupt to a particular CPU, where CPU can be performing either of below cases unless it is already serving a ISR: User mode process is executing on CPU Kernel mode process is executing on…
Sunil Bojanapally
  • 12,528
  • 4
  • 33
  • 46
16
votes
3 answers

How processor handles case of division by zero

Curious what the processor/CPU does in general or let say, on intel cpu & Linux, when it executes a division by zero instruction. Also how the error is relayed to the application, so that it can log the error or notify the developer? Thank you!
Alfred
  • 1,709
  • 8
  • 23
  • 38
13
votes
1 answer

Differences among various interrupts: SCI, SMI, NMI, and normal Interrupt

I am learning the Intel Architecture. So far I have encountered several types of interrupts: SCI: System Control Interrupt, A system interrupt used by hardware to notify the OS of ACPI events. The SCI is an active, low, shareable, level…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
13
votes
1 answer

(Writing kernel) How do I modify the interrupt descriptor table?

I am writing a small kernel just to poke around the low level stuff a bit. Right now, it boots in Virtual Box and I can display text to the screen, allocate some memory, and other really basic things. It's written in C++ and a little asm. One of…
rovaughn
  • 1,213
  • 15
  • 24
1
2 3
55 56