Книга: Real-Time Concepts for Embedded Systems
10.5.1 Installing Exception Handlers
10.5.1 Installing Exception Handlers
Exception service routines (ESRs) and interrupt service routines (ISRs) must be installed into the system before exceptions and interrupts can be handled. The installation of an ESR or ISR requires knowledge of the exception and interrupt table (called the general exception table).
The general exception table, as exemplified in Table 10.1, has a vector address column, which is sometimes also called the vector table. Each vector address points to the beginning of an ESR or ISR. Installing an ESR or ISR requires replacing the appropriate vector table entry with the address of the desired ESR or ISR.
The embedded system startup code typically installs the ESRs at the time of system initialization. Hardware device drivers typically install the appropriate ISRs at the time of driver initialization.
If either an exception or an interrupt occurs when no associated handler function is installed, the system suffers a system fault and may halt. To prevent this problem, it is common for an embedded RTOS to install default handler functions (i.e., functions that perform small amounts of work to ensure the proper reception of and the proper return from exceptions) into the vector table for every possible exception and interrupt in the system. Many RTOSes provide a mechanism that the embedded systems programmer can use to overwrite the default handler function with his or her own or to allow the programmer to insert further processing in addition to the default actions. If allowed, the embedded systems programmer can code specific actions before and after the default action is completed.
In this book, the general term service routine means either an ESR or an ISR when the distinction is not important.
- 10.4 A Closer Look at Exceptions and Interrupts
- 19. Beyond Exception Handling: Conditions and Restarts
- Выражения в EXCEPTION
- Chapter 5 Installing and Configuring VirtualCenter 2.0
- CHAPTER 1 Installing Fedora
- Installing from CD or DVD
- Installing Using a Network
- Choosing, Configuring, and Installing the Boot Loader
- Installing and Configuring OpenOffice.org
- Installing Proprietary Video Drivers
- Installing Popular Games in Fedora
- Installing Xen