3.3. Exceptions

The above section has introduced device programming and has placed this function within the operating system. The interrupt mechanism is used to transfer control from any running program (inside or outside the operating system) to an interrupt service routine which is part of the operating system. The processor state is set to 'privileged' by the interrupt mechanism and the minimum necessary processor state (the PC and PSR) is saved so that the interrupted program can be resumed later.

The operating system is entered by this means when a device signals that it needs attention. The mechanism can be generalized to be the standard means by which the operating system is entered.

Note that the interrupt signal from the device has, ...

Get Operating Systems: Concurrent and Distributed Software Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.