
Intel386™ EX EMBEDDED MICROPROCESSOR USER’S MANUAL
7-16
7.5 PROGRAMMING CONSIDERATIONS
7.5.1 System Management Mode Code Exam ple
The following code example contains these software routines.
SerialWriteStr2 Located in SMRAM upon pro gram exe cuti on, this routine l oops
endlessly while writing a character “X” out the serial port on the
EV386EX board.
SerialWriteStr Located in the main program in FLASH, this routine loops endlessly
while writing a string out the serial port before entering SMM.
InitSIO Initializes the serial port including the mode, baud rate, and clock
rate.
MAIN Executes the program once it is located in FL ASH. It also configures
chip selects, copies SMM handler to SMRAM, and loops endlessly
until an SMI# is issued.
See Appendix C for the included header files.
#include “80386EX.h”
#include “EV386EX.h”
#include <string.h>
#include <conio.h>
#include <dos.h>
#if _DEBUG_ == 0 // _DEBUG_ must be defined on the command line
#define SIO_PORT SIO_1 // The debugger uses SIO_0 for host communications
#else // Under the debugger we must avoid using SIO_0
#define SIO_PORT SIO_0
#endif
#define BAUD_CLKIN 1843200L // Clock rate of COMCLK, i.e., External clocking,
extern char far SMMString[];
extern void InitEXSystem(void);
int DataSeg; // For assembly data segment register init.
BYTE Buf[20];
/*********************** Function SerialWriteStr2 **************************
Parameters:
None
Returns:
None
Assumptions:
Not called from main. This function is used as a jump point and is
relocated by the main to 38000H (SRAM) for SMM.
Real/Protected Mode:
No changes required