ChorusOS 5.0 Application Developer's Guide

Exception Handlers

The ChorusOS operating system provides three kinds of exceptions:

Traps

Generated voluntarily by the current thread -- traps are used to change the thread privilege level to execute system code.

Software exceptions

Generated involuntarily by the current thread -- usually due to errors such as division by 0.

Panics

Explicitly generated by specific microkernel modules or supervisor actors -- panics correspond to software/hardware faults which are not recoverable at the application level.

The core executive API provides basic services for subsystems to handle these three kinds of exceptions. For this purpose, the core executive exports an interface for subsystems to declare trap, exception, and panic handlers. Exception handlers are declared on a per actor basis, while trap handlers and panic handlers are declared on a site-wide basis.

The core executive API includes a number of exception handler system calls, described in the following table.

Table 13-1 Exception Handler System Calls

System Call 

Purpose 

svExcHandler()

Sets an actor's exception handler (compatible with the ChorusOS 4.x API) 

svActorExcHandlerConnect()

Connects an actor's exception handler 

svActorExcHandlerDisconnect()

Disconnects an actor's exception handler 

svActorExcHandlerGetConnected()

Gets an actor's exception handler