Chaining The Isrs; Enabling The Watchdog Nmi - Intel NetStructure ZT 5504 Manual

System master processor board
Table of Contents

Advertisement

Chaining the ISRs

Save the original NMI ISR vector so that it can be invoked from the new watchdog NMI ISR.
Alter the interrupt vector table so that the NMI ISR vector is overwritten with a vector to the
watchdog ISR. C code to do this in DOS might look like the following:
#define NMI_INTERRUPT_VECTOR_NUMBER 2
void interrupt far (*OldNmiIsr)();
void HookWatchdogIsr(void){
//
// To be absolutely certain the interrupt table is not accessed by an
// NMI (this is quite unlikely), the application could disable NMI in
// the chip set before installing the new vector.
//
//
// Install the new ISR.
//
oldNmiIsr = getvect(IsrVector);
setvect(NMI_INTERRUPT_VECTOR_NUMBER, WatchdogIsr); // Install the new.
}

Enabling the Watchdog NMI

To activate the NMI feature, enable it in the watchdog register
might look like the following:
#define WD_NMI_EN_BIT_SET 0x10
void EnableWatchdogNmi(void){
unsigned char WdValue;
WdValue = inb(WD_CSR_IO_ADDRESS);
WdValue |= WD_NMI_EN_BIT_SET;
outb(WD_CSR_IO_ADDRESS,WdValue);
}
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
.
.
.
// Save the old vector.
(Port
79h). The code to do this
// Holds watchdog register values.
//
// Read the current contents of the
// watchdog register.
// Assert the enable bit in the
// local copy.
// Assert the enable in the watchdog
// register.
7. Watchdog Timer
49

Advertisement

Table of Contents
loading

Table of Contents