		README for the GNX Configurable monitor (CMON)

Introduction:

This directory contains the GNX configurable monitor (CMON) source files. 
It is based and compatible with the old assembly GNX monitors for the boards 
CG16-EDB, GX32-EDB, etc.  
CMON is ported to the following boards: FX164-EDB, CG16-EDB, AM160-EDB, A1D, 
GX32-EDB and SF641-EDB.

Cmon is organized as a kernel which contains the basic features common to
all the boards. It contains also, group of drivers each for a different device.
Each board is defined by a set of macros defined in its configuration file
(e.g. fx164ed.h).

CMON is written in the C language. Only critical parts, which need direct 
access to registers or trap and interrupt handlers are written in assembly.


CMON operation:

CMON has two possible states of operations: monitor time and user time.
Monitor time is when CMON is reading or executing the user (usually, the
GNX debugger) commands.
Commands entered in monitor time allow debugging or loading programs to be
run in user time.

Upon reading a program execution command, CMON loads the CPU registers
with the program values and control is transferred to the user program. 
This marks the beginning of the User time. User time continues until a
breakpoint, NMI or TRAP occurs. At that point the program register contents
are saved and CMON register values are restored. This is a turn to monitor
time.

For a complete description of CMON commands, refer to the GNX Development
Board Monitor reference manual.


File list :

The following conventions are used with CMON file names.

    File name of the form *.hx0 or *.hx1 (e.g. fx164ed.hx0) indicates that its
    a monitor executable in the INTEL HEX format ready to be burned.

    File names of the form *.lnk (e.g. fx164ed.lnk) indicates that its
    a specific board link file.

    File names of the form *.dlk (e.g. fx164ed.dlk) indicates that its
    a specific board link file for debugging the monitor.

    File names of the form *_diag.c (e.g. ram_diag.c) indicates that its
    one of the diagnostic tests.

    File names of the form *_d.c (e.g. lan_d.c) indicates that its one 
    of the CMON drivers.

    Most of the C and assembly source files have a corresponding *.h
    file which exports its global functions and variables to other modules.




    Following is CMON file list:

	readme		-   This file
	makefile.cross	-   Makefile for Sun4, HP, Ultrix ...
	makefile.nat	-   Makefile for native Unix machines (e.g. Opus).
	makefile.vms	-   Makefile for VMS , Using the MMS utility.
	makefile.dos	-   Makefile for DOS, Using the polymake utility.

	reset.s		-   CMON trap and reset handler routines.
	cpu_e.s		-   Assembly routines for the CPU driver.
	fpu_e.s		-   Assembly routines for the FPU driver.

	cpu_d.c		-   CPU driver routines.
	fpu_d.c		-   FPU driver routines.
	board_d.c	-   Board driver routines.
	uwire_d.c	-   Microwire driver routines.
	lan_d.c		-   LAN (Ethernet) driver routines.
	sio_d.c		-   Serial I/O driver routines. This file includes
			    one of the UART drivers bellow (e.g. fx200.h).

	bpt.c		-   Functions which controls the breakpoint mechanism.
	cmd.c		-   Command line interpreter of CMON.
	cpu.c		-   Functions which controls the CPU driver.
	exec.c		-   Functions which controls the different execution
			    operations done by CMON.
	global_f.c	-   Misc. global routines.
	misc.c		-   Misc routines.
	io.c		-   I/O routines: initialization, read & write by
			    using the appropriate I/O driver (serial or LAN).
	mem.c		-   Memory operations routines.
	svc.c		-   Functions which handle the various supervisor 
			    calls.
	traps.c		-   Interface routines between the trap assembly 
			    handlers and the C routines.
	user_cmd.c	-   Dummy user command extension routine.
	date.c		-   CMON creation date.

	cc_def.c	-   Global definitions for the C modules in CMON.
	global.h	-   global definitions for the assembly and C modules
			    in CMON. This file is included by cc_def.c.
			    This file include the board definition file.
	device.h	-   Constant definitions used by the board definition
			    file.
	ns16550.h	-   NS16550/2 Uart driver.
	z8530.h		-   Z8530 Uart driver.
	emul.h		-   PC emulation Uart driver.
	fx200.h		-   FX200 Uart driver.

	diag_ext.s	-   diagnostic tests entry point.
	diag.c		-   diagnostic tests manager.
	afe_diag.c	-   Analog Front End diagnostic test.
	cnt_diag.c	-   Centronics diagnostic test.
	cpu_diag.c	-   CPU diagnostic test.
	eep_diag.c	-   EEPROM diagnostic test.
	epr_diag.c	-   EPROM  diagnostic test.
	fpu_diag.c	-   FPU diagnostic test.
	icu_diag.c	-   ICU diagnostic test.
	lcd_diag.c	-   LCD diagnostic test.
	led_diag.c	-   LED diagnostic test.
	ram_diag.c	-   RAM diagnostic test.
	scs_diag.c	-   SCSI diagnostic test.
	sio_diag.c	-   UART diagnostic test.

	fx164ed.h	-   FX164-EDB definition file.
	a1d.h		-   A1D definition file
	cg16ed.h	-   CG16-EDB definition file.
	gx32ed.h	-   GX32-EDB definition file.
	am160ed.h	-   AM160-EDB definition file.

	fx164ed.lnk	-   FX164-EDB link file.
	a1d.lnk		-   A1D link file.
	cg16ed.lnk	-   CG16-EDB link file.
	gx32ed.lnk	-   GX32-EDB link file.
	am160ed.lnk	-   AM160-EDB link file.

	fx164ed.dlk	-   FX164-EDB CMON debug link file.
	a1d.dlk		-   A1D CMON debug link file.
	cg16ed.dlk	-   CG16-EDB CMON debug link file.
	gx32ed.dlk	-   GX32-EDB CMON debug link file.
	am160ed.dlk	-   AM160-EDB CMON debug link file.


	fx164ed.hx0	-   FX164-EDB burn file bank 0.
	fx164ed.hx1	-   FX164-EDB burn file bank 1.



    To compile the monitor:

	On Unix:    make -f [makefile.cross | makefile.nat] BOARD.[hx0|hx1]
	On Dos:	    make -f makefile.dos  BOARD.[hx0|hx1]
	On VMS:	    mms	/des=makefile.vms  BOARD.[hx0|hx1]

	For example :
	    make -f makefile.cross fx164ed.hx0

	The output monitor is created in the INTEL HEX format ready to be
	burned on EPROMs.
	To burn these files, refer to your eprom programmer manual.
