Interrupt Priorities

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ddas

Interrupt Priorities

Post by ddas »

Intel 386 architecture does not support interrupt priorities.
  How to implement interrupt priority levels in s/w for such a machine ??
VE3MTM

RE:Interrupt Priorities

Post by VE3MTM »

That would require some sort of a queuing system inside the kernel, because ISRs block other interrupts until complete (until they execute IRET). You could rig up some sort of a system where interrupt calls are pushed onto a queue when they are received, and whenever the kernel has free time, it leafs through the queue and handles them according to their priority. That's the only way, really.

Another strategy would be to make the ISRs minimal. For a keyboard interrupt, for example, it just pushes the key onto the buffer and sets a flag. Then, the keyboard driver (a seperate thread), reads that and does whatever it needs to, like pass the keystroke to whatever process is listening, etc., but that is done outside the ISR, and thus it can be scheduled properly.
Stefan

RE:Interrupt Priorities

Post by Stefan »

A good idea anyways, as (in a normal os) when an ISR is running nothing else can.
Post Reply