|
Part 2ıBuilding on the Basics
by Ed Sutter
Start ı The
Ethernet Interface ı The Command Line Interface
ı "Get Your Tokens Here" ı One
Last Topic About CLI ı Executable Scripts
ı Application-to-Monitor Hook-Up ı The
Moncom() Function ı The Monconnect() Function
ı Letıs Regroup ı Xmodem
and Tftp ı OK, Iım Done! ı Sources
and PDF
LETıS REGROUP
The application starts up. It wants to
use some of the facilities provided by the monitor, so assuming it
knows the well-known address, it calls monConnect(). The monConnect()
function is fed the well-known address and pointers to lock and unlock
functions. The code in monConnect() now assumes that it can
call moncom() in the monitor space through the well-known address.
Each call to moncom() loads a function pointer in the application
space with the address of the corresponding function in monitor space,
based on the GETMONFUNC_XXX macro passed into moncom().
When monConnect() is done, there is a full set of mon_xxx
(like mon_putchar()) functions in the application space that
can now be used by the application to interface to facilities in the
monitor. Note that there are a lot more than three functional connections
established by monConnect(), but they are all basically done
in the same way as the three shown in this example.
So where are you? Youıve got quite a
bit, but without some way to transfer files and data to and from the
target system, youıre still limited, hence the need for some file
transfer capabilities. There are certainly plenty to choose from,
but for the sake of a monitor, keeping it simple must continue to
be the goalıyour RS-232 interface will support XMODEM and your Ethernet
interface will run a TFTP server. Both will support transfers to and
from RAM and the file system.
Donıt worry, I have no intention of discussing
either of the protocols here; theyıve both been around long enough
that you probably already have a book on your shelf that digs into
it. The point is to briefly discuss some of the enhancements that
Iıve added to each of them to work with the monitor. Both of these
mechanisms download into RAM and then, if necessary, the data is transferred
to TFS.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |