Nucleus – Interrupt Handling

In most of RTOS, whenever an interrupt arrives, the interrupt vector table’s corresponding routine is invoked to execute some piece of code to take the required action for that interrupt.

Nucleus RTOS had peculiar interrupt handling mechanism which is not found in some of those RTOS mechanism. Nucleus interrupts are handled in two phases called LISR (Low level ISR-Interrupt Service Routine) and HISR (High level ISR) parts.

The LISR routine is similar to existing RTOS’s ISR, but the important difference is if required more processing, it activates the corresponding HISR.  During LISR processing, only limited system calls are allowed and minimal processing is done. This ensures to respond to interrupt in very quick manner and reduces the latency for the same.

The HISR are scheduled similar to the task. They have priority 0 to 2 that are the highest priority levels defined by Nucleus. The remaining 3 to 255 priority levels are given to the tasks.  The lower the priority value, the higher the chances of task or HISR to get scheduled. The HISR can access most of the system calls.

Moreover, whenever the scheduler runs, it checks any activated HISR first. If found, it schedules all HISR before any of the task is scheduled.  This allows to perform the required extra processing in HISR after LISR is executed without spending much time in ISR.

No comments yet

Leave a reply

You must be logged in to post a comment.