eCos interrupt handling

or what makes eCos real time.

I’m trying to use Freemind – this is an initial mindmap of my current understanding of eCos internals:


Interrupt handling is critical to real time systems – and quick handling can be disturbed by atomic activities which run with interrupts disabled. To minimize latencies, eCos has a split interrupt handling system:

  • ISR – Interrupt Service Routine
  • DSR – Deferred Service Routine

DSRs can be run with interrupts enabled, and ISRs should complete quickly. DSRs execute later when thread scheduling is allowed – this allows higher priority interrupts to umm, interrupt. This also allows them to interact with the kernel.

ISRs can be coded to:

  • Disable interrupts till DSR is serviced (typical behaviour).
  • Setup counters such that one DSR can service multiple interrupts.

On eCos, thread stack size is defined by CYGNUM_HAL_STACK_SIZE_MINIMUM. Since interrupts are enabled during DSRs, we can have nested interrupts, and this may cause a stack overflow. Hence interrupts have a separate stack, which is large enough to handle some predefined “N” interrupts. Thus each thread needs to hold only one interrupt state, and nested interrupts go on the interrupt stack. Using a separate interrupt stack is configurable, and if not chosen, then the thread stacks have to be larger.

Reference: Redhat eCos reference manual.


One thought on “eCos interrupt handling

  1. I’m trying to monitor the ACK pin on a prallel port using IRQ 7 interrupts. I seem to be stuck. All the examples I find use #inlude which isn’t in the Ubuntu 6.06.1 distro. Do you have any insight or recommendations?

    Basically, I’m trying to capture engine RPM from an MSD 6AL ignition module in my 1967 Mustang to help get a picture of what’s happening on a 1/4 mile pass at the local drag strip. My Blog has more detail.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s