HiveBrain v1.2.0
Get Started
← Back to all entries
debugMinor

How does software detect if an interrupt has occurred if it cannot set it's own interrupt handlers?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
cannotinterrupthandlerssethasownsoftwaredoeshowoccurred

Problem

I'm currently working on designing a relatively simple processor using a custom ISA .
It will use interrupts for I/O .

From what i know , once the interrupt controller issues an interrupt , the processor acknowledges it and set it's PC to the IVT , from where it executes the relevant interrupt handler , which specifies what the CPU does .

These interrupt handlers are set by the OS and cannot be modified by the user-mode process.

My question is this : how does the process know when an interrupt has occurred ? the cpu might execute the handler and place the acquired controller data in a memory location , but how is the application notified ? what are the common methods of doing this ?

For example , say i have a platform game ; when i press the assigned jump key , the cpu will acquire the keyboard data , but how does it go from there to actually making the sprite jump in a video game ? does the app still have to check for controller input at regular intervals ?

Solution

The interrupt handler adds the new data to an input queue. Typically the user level process will have a thread waiting for input to appear, or will poll periodically to see if new input is available. If your process does neither, it would never notice the new data.

Context

StackExchange Computer Science Q#90634, answer score: 3

Revisions (0)

No revisions yet.