12.2 Kernel Mode Traps

The trap is unexpected and with one exception, the reaction is to “panic”. The code executed is the “default” of the “switch” statement:

2716:

Print:

  • the current value of the seventh kernel segment address register (i.e. the address of the current per process data area);

  • the address of “ps” (which is in the kernel stack); and

  • the trap type number;

2719:

“panic”, with no return.

Floating point operations are only used by programs, and not by the operating system. Since such operations on the PDP11/45 and 11/70 are handled asynchronously, it is possible that when a floating point exception occurs, the processor may have already switched to kernel mode to handle an interrupt.

Thus a kernel mode floating point exception trap can be expected occasionally and is the concern of the current user program.

2793:

Call “psignal” (3963) to set a flag to show that a floating point exception has occurred;

2794:

Return.

This raises an interesting question: “Why are the kernel mode and user mode floating point exceptions handled slightly di�ferently?”