Introduction
The Paradigm C++ software development tools are often used by developers
to produce embedded, ROMable 32-bit applications for 80386 protected
mode target hardware. This document will show how to produce a ROMable
version of the AMX 386/ET Sample Program using the Paradigm C++ IDE.
It is assumed that Paradigm C++ has been installed. It is further assumed
that AMX 386/ET has been installed into directory C:\KADAK\AMX722 .
Step 1: Start the PDREMOTE/ROM Target Monitor
For purposes of illustration, a conventional 80x86 PC/AT operating
in protected mode will be used as the embedded PC.
In order to treat a standard PC as an embedded Paradigm PDREMOTE/ROM
target, you must first boot the target PC from a custom Paradigm boot
disk, thereby starting the Paradigm PDREMOTE/ROM Target Monitor. You
can create the boot floppy disk by using the PDREMOTE/ROM Wizard
as follows:
From the Paradigm C++ IDE File menu, create a new PDREMOTE/ROM
Wizard project. In the dialog that appears, enter the properties
as shown.

The wizard will create the new PDREMOTE/ROM monitor project shown below:

By default, the newly created PDREMOTE/ROM Target Monitor is configured
to communicate at 115200 baud via COM1 of the target PC. If you need
to use a different COM port or baud rate, edit the COMPORT
declaration line in the PDREM32.CFG file.
Next, build the new monitor by selecting the Build all command
on the Project menu.
Finally, create the boot disk floppy by right-clicking the PDREM32.RTB
node and selecting the BootDisk32 command.
Connect COM1 of the host PC on which the Paradigm tools are being used
to COM1 of the target PC. Then reboot the target PC using the boot disk
created by the Paradigm utility. Your 80x86 embedded target is then
ready for test.
Step 2: Prepare AMX 386/ET Files
The AMX 386/ET installation directory AMX722\TOOLPD\IDE
will be used as the home directory for this sample Paradigm C++ IDE
project. The Sample Program files will be found in directory AMX722\TOOLPD\SAMPLE .
Since a conventional PC is being used as the target processor, the board
specific files will be taken from directory AMX722\TOOLPD\SAMPLE\AT386 .
The AMX 386/ET System Configuration Module and Target Configuration
Module must be created outside the Paradigm C++ IDE environment. The
AMX 386/ET Configuration Manager utility CJ722CM.EXE is
used to create and/or edit the AMX 386/ET Sample Program User Parameter
File CJSAMSCF.UP and Target Parameter File CJSAMTCF.UP
as described in the AMX 386/ET Reference Manual. Copy files AMX722\TOOLPD\SAMPLE\CJSAMSCF.UP
and AMX722\TOOLPD\SAMPLE\AT386\CJSAMTCF.UP to the project
directory AMX722\TOOLPD\IDE .
From the Windows Start menu, select the MS-DOS Command Prompt.
Then make directory AMX722\TOOLPD\IDE the current directory.
To start the AMX 386/ET Configuration Manager, issue the following command
from the MS-DOS command prompt:
..\..\CFGBLDW\CJ722CM CJSAMSCF.UP
Once the Configuration Manager has been started, choose Templates
from the File menu and update the locations of the AMX System
Configuration Template file CJ722CG.CT and the AMX Target
Configuration Template file CJ722HDW.CT . You can browse
to find these files. Both are located in directory AMX722\TOOLPD\CFG .
Generate the System Configuration Module CJSAMSCF.C by
selecting the Generate option from the File menu. If you
generated the System Configuration Module in some other directory, move
or copy the resulting file CJSAMSCF.C to the sample project
directory AMX722\TOOLPD\IDE .
From the manager's File menu, choose Open and open the
Target Parameter File CJSAMTCF.UP . Generate the Target
Configuration Module CJSAMTCF.ASM by selecting the Generate
option from the File menu. If you generated the Target Configuration
Module in some other directory, move or copy the resulting file CJSAMTCF.ASM
to the sample project directory AMX722\TOOLPD\IDE .
Step 3: Create the Paradigm C++ Project
From the Paradigm C++ IDE File menu, create a new project. In
the New Target dialog that appears, enter the properties as shown.
The project name cjsample was chosen arbitrarily. As noted in
Step 2, the project has been created in the AMX722\TOOLPD\IDE
directory for convenience. The AMX 386/ET object modules and libraries
in directory TOOLPD\LIB can be readily imported by the
Paradigm tools.
Note that you must select the Protected address mode
Platform and the Win32 Embedded Target Model. AMX 386/ET does
not support the Win32 Emulation model.
From the Advanced options, select the No Source Node
option since existing files will be imported. When creating a new application,
you may wish to create an initial node.

Step 4: Set the Project Options
There are several project options which must be selected to properly
build an AMX 386/ET application. From the main menu, select Options ==> Project...
to invoke the Project Options dialog.
Add the path to the directory containing the AMX 386/ET header files
to the Include: list of search directories. Append the text ;..\DEF
to the existing search path. This path is relative to the project directory
AMX722\TOOLPD\IDE . The semicolon is used as a separator
when multiple paths are specified.

Step 5: Set the Environment Options
From the main menu, select Options ==> Environment... .
to invoke the Environment Options dialog.
Make sure that Start application execution at application entry
point is enabled. If the option is disabled, the program will attempt
to start at address 0FFFFFFF0 and will not operate properly
when used with the PDREMOTE/ROM Target Monitor on PC hardware.

Step 6: Modify the Locate Configuration
The AMX 386/ET Sample Program Link Specification File CJSAMPLE.LKS
and Locate Specification File CJSAMPLE.CFG provided with
AMX 386/ET are not used when generating the AMX 386/ET Sample Program
within the Paradigm IDE. Instead, a custom Locate Configuration File
CJSAMPLE.CFG is used. This file is automatically generated
in the project directory AMX722\TOOLPD\IDE by the Paradigm
tools.
The Locate Configuration File CJSAMPLE.CFG generated by
the Paradigm tools must be edited before it can be used with AMX 386/ET.
The memory region definitions must be copied from the Locate Configuration
File, PDREM.CFG , used to build the PDREMOTE/ROM monitor
in Step 1. Also, the Reserve directive must be modified
to point to the monitor's PDREM32.RTB file.

Step 7: Add the Files to the Project
Next, add to the project all of the files which are required to build
the application. Files are added by right clicking on the CJSAMPLE.ROM
node in the Project window and selecting Add node. For
the AMX 386/ET Sample Program, the list of files is as shown below.
All file paths are relative to the project directory, AMX722\TOOLPD\IDE .
The AMX 386/ET Sample Program requires character level console services
for display output. The AMX 386/ET serial I/O driver CH8250S.C
provides this service for a conventional PC COM port. Note that, for
this configuration, two COM ports are required: one for the terminal
and one for the Paradigm PDREMOTE/ROM Target Monitor.
The AMX 386/ET Sample Program also requires a clock for timing purposes
and a board support module. The AMX 386/ET clock driver CH8253T.C
and PC/AT board support module AT386BRD.C are used in this
example.

Step 8: Build and Run the AMX 386/ET Sample
Program
From the main menu, select Project ==> Make all
or click on the toolbar button. Either action will
force the application to build, producing an executable load module
with the name CJSAMPLE.AXE .
Upon completion of the build, the following dialog will appear, indicating
that the build was successful.

From the main menu, select Debug ==> Run
or click on the toolbar button. Either action will
force the debugger to download module CJSAMPLE.AXE to the
target hardware and begin execution.

Once the AMX 386/ET Sample Program is running, the application will
send the timer tick messages generated by the AMX 386/ET application
out the PC's COM2 interface at 9600 baud.
|