17.05.2015 Views

TI486 Microprocessor - Al Kossow's Bitsavers

TI486 Microprocessor - Al Kossow's Bitsavers

TI486 Microprocessor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Testing/Debugging SMM Code<br />

A.6 Testing/Debugging SMM Code<br />

There are several ways to debug SMM code:<br />

1) Emulation Technology <strong>TI486</strong>SLC/E pod with an HP 16500/550 Logic<br />

Analyzer.<br />

Supports selective trace capture<br />

SMM instruction disassembly<br />

•<br />

2) Periscope - Software only<br />

Full screen debugging<br />

• TSR<br />

Single stepping and break points<br />

3) DOS debug - Software only<br />

Single stepping and break points<br />

•<br />

4) Other selected logic analyzers<br />

A.6.1<br />

Software Only Debugging<br />

It is possible to write an SMI handler and debug it as a TSR. You will need to<br />

use a debugger that can set break points at any address in memory. Use the<br />

following code sequence as a model of how to build your SMI handler as a<br />

TSR. This code sequence also contains a section that loads the CS<br />

non-program mer-visible section to change the limit. This is required so that a<br />

protection error will not occur whenever code is executed outside of the SMM<br />

region. It is assumed that ADS and SMADS from the CPU are ORed together<br />

by the chip set or external logic. <strong>Al</strong>so, the chip set should support<br />

programmable SMM locations.<br />

This code will mark the SMI handler address in the user interrupt INT 66<br />

location (O:198h). This is done so that the programmer can determine the<br />

location of the SMM region and set break pOints.<br />

The debugger will only be able to set a code break point using INT 3 outside<br />

of the SMI handler. This is because the debug control register DR7 is set to<br />

the reset value upon entry to the SMI handler. This causes break conditions<br />

in DRO-3 to be disabled. Debug registers can be used if set after entry to the<br />

8MI handler and DRO-3 are saved.<br />

Using a TSR to debug SMI has some limitations:<br />

• Other code could overwrite the region.<br />

• Jumps or calls must be to known offsets.<br />

A-22<br />

Tl486 SMM Programmer's Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!