The Clock ISR

Clock ISR

The XINU clock ISR (on the PDP-11 and the current version of the code) is an assembly routine. You should take a look at it. The PDP-11 version performed the following each time it was invoked:

  1. Test to see if this is the 6th interrupt - if not, decrement the counter and return right away.
  2. Test to see if we are in clock defer mode, if we are, count this clock tick, and return right away.
  3. Test to see if there is a sleeping process. If there is, decrement the delta value of the first process on the delta queue. If it has reached zero, call a routine called wakeup which readies any processes that should be woken up.
  4. Decrement the preemption counter for the running process. If it is now zero, call resched().
  5. Return from interrupt.

The PC version does not check for deferred processing and processes the sleep Q on every tick.

1