Interrupt Handling
One characteristic which serves to distinguish real-time systems from any other kind is interrupt handling. The real-time system must respond to external stimuli-interrupts-in a time frame dictated through the external world because multiple stimuli interrupts are often priority interrupts and present priorities must be build. In other words, the most important task must always be serviced within predefined time constraints regardless of other events.
Interruption handling entails is not only storing information so which the computer can correctly restart the interrupted task but also avoiding endless and deadlocks loops. The whole approach to interrupt handling is described in the figure 24.1. Normal processing flow is interrupted through an event which is detected through processor hardware. An event is any occurrence which needs immediate service and may be generated through either software or hardware. The state of the interrupted program is saved example for all register contents and control blocks, etc. are saved and control is passed to an interrupt service routine which branches to appropriate software for handling the interrupt. Its upon completion of interrupt servicing the state of the machine is normal and restored processing flow continuous.
In several conditions, interrupt servicing for one event may itself be interrupted through another, higher-priority event. The Interrupt priority levels Figure may be building. If a lower-priority procedure is accidentally allowed to interrupt a higher-priority one it may be hard t restart the processes in the right order and an endless loop may result.
To handle interrupts and since meet the system time constraints several real-time operating systems make dynamic calculations to determine whether the system motives can be met. These dynamic calculations are based on the average frequency of occurrence of events the amount of time it takes to service them if they can be serviced and the routines which can interrupt them and temporarily prevent their servicing.
If the dynamic calculations show which it is impossible to handle the events which can happen in the system and since meet the time constraints the system must decide on a plan of action. Required possible approach involves buffering of the data so which it can be processed fast when the system is ready.