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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.