! VxInstallation2600 -- Getting started with VxWorks on the 2600 PPC
! Version 5, October 16, 1997
! Hugh Sparks (with much help from Jim Rosenow & Mark Fullen)

Processor card (MVME 2600-2) Hardware configuration:
	Install the pair of vxWorks ROMS on each MVM2600 card.
	(See PROM burning section below for details.)
	Configure jumpers on the board: (All jumpers should be
	set to their factory defaults.)

	J10	Between pins 2,3	Select Flash bank B
	J22	Between pins 2,3	Auto select system controller

	Serial port 4 configuration jumpers.
	These don't matter if you don't user port 4 on the card.

	J16	Between pins 2,3	Receive RxC
	J17	Between pins 2,3	Receive TxC
	J20	Installed		Buffer enabled 

Transition Module Hardware configuration:
	The transition module has jumpers to select for the ethernet
	connection type and the sex of the serial ports. 
	If you have a modem cable from the PC to Serial 1 then put the 
	transition module jumpers for serial 1 on the MODEM jumpers.
	If you have a terminal cable from the PC to Serial 1 then put the 
	transition module jumpers for serial 1 on the TERM jumpers.
	The ethernet switch SW1 needs to have switches 1-6 moved to the
	"ON" position.

Host hardware configuration:
	Install an additional ethernet board. (3COM Etherlink III)
	Don't try to use any of the software that comes with the
	board. Install a serial cable between the first PPC board 
	and the host. Configure a terminal program to talk with the
	board at 9600 baud.

Installing the EtherNet:
	Using thin wire hardware, connect each PPC board on the
	back and the additional host ethernet card. You MUST use
	50 ohm cable with 50 ohm terminators on each end. Each
	cable must be at least 2.5 meters long (8.2 feet), including
	the cables that interconnect the processor cards.
	(Jim likes to use the backplane network option, but this
	has drawbacks. The "Backplane Ethernet" uses the VME
	bus to implement the network between processor cards.
	You might think this is faster, but we want to leave
	the bus uncluttered for our A/D & D/A traffic. The
	network stuff is for the low priority configuration 
	messages.

Configuring TCP/IP for the extra Ethernet card:
	(You need to be administrator to do this stuff.)
	
	Using the the Network Control Panel, Network Adapters
	section:
		ADD: "3COM Etherlink III PCI Bus Master Adapter (3C590)

	On Network Control Panel select the "Protocols" tab.
	Select TCP/IP and on the new card set: 

		IP Number:	90.0.0.127
		Subnet mask:	255.255.255.0

	On Network Control Panel select the "Bindings" tab.
	Show Bindings for: 'all adapters'
		for Building ethernet card 	: enable all
		for VME Ethernet card		: enable TCP/IP Protocol ONLY

	The system performs much better if the host and
	target are given IP names that can be resolved
	locally. This is done by editing the workstation's
	hosts file located in:

		winNT/System32/drivers/etc/hosts

	Add these lines:

		90.0.0.127	host
		90.0.0.1	dsp1 (or just "dsp" for a 1 DSP systems)
		...
		90.0.0.N	dspN

FTP Configuration
	Install this FTP service before you install NT Service Pack 3 or
	you will have .dll resource version conflicts.

	The code gets loaded by the target processor using FTP.
	An FTP server must be configured on the host.

	The best results are obtained by using the FTP service
	that comes with the "Microsoft Peer Web Services" package.
	This package is an user-installable option that included with
	the WindowsNT distribution CD. You have to locate the product
	on the NT CD and run the setup program.

	To get the Internet Service Manager installed, run the
	installer from the CD. For example, on drive D:

		D:\I386\Inetsrv\Inetstp.exe

	Ask for the Internet Service Manager, the FTP Server, and 
	the Help files. 

	An alias will be added to the start menu to run the server. 
	When asked for an FTP publishing directory, use C:\
	You may be warned about allowing Guest access. Do it anyway.
	
	After installing the package, 
	Use the StartMenu to start the FTP Service Manager.
	Double Click on the computer name of your host
	When the FTP Service Properties for 'yourComputer' opens choose 'Directories' tab.
	Double Click on the <Home> Directory and enter C: and press OK.
	Select the Logging tab
	Disable the logging feature to avoid accumulating an enormous log file
	
Install NT Service Pack 3
	Obtain executable:
		"NT Service Pack 3 nt3sp3_i.exe"
	Double click to install the correct drivers.
	Note: if any information from the Windows NT 4.0 disk needs to be
	re-installed, then NT Service Pack 3 will need to be reinstalled

Network trouble shooting
	Open a MS-DOS Prompt window
	You should be able to ping the host adapter:

		ping 90.0.0.127

	You should be able to FTP to the host using the adapter address:

		ftp 90.0.0.127

	Log in as anonymous, password guest. Try the unix ls command:
	you should see a directory of your top level files on drive C.

	If the above tests work and you still can't see the host from the
	PowerPC, check the following:

	1) Ethernet terminators at each end of the wire.
	2) Make sure thinwire is not too short. (3 meters is recommended min.)
	3) VME transition module jumpers for Ethernet type.


Making the MVM2604 boot ROM:
	The 2604 uses two PROMS that are "split" images of the
	actual boot code data. The two files are created by
	programs supplied by Jim Rosenow:
	A batch file:
		makeroms.bat
	and a program:
		splitrom.exe
	These files must be copied into your mv2604 directory.
	When you run makeroms.bat, two files are created:
		xu1_2604.hex
		xu2_2604.hex
	These are PROM images required by the ROM burner down
	in the PPG lab.
	The PROM burner program is called "TL.EXE". It is in a folder
	on the PROM burning PC called "TL".
	Install the proper chip carrier labeled "32 PIN PLCC".
	Make sure the proper device data floppy is in the drive under the
	chip carrier: "3900 Programming System, Disk 1 of 3".
	(If you must change the disk, cycle the power on the PROM burner.)
	Insert the floppy with your ROM images in the PC drive.
	Using the menu bar:
		Select/ Select Device
			Type : AMD
			Device : 29F040-PLCC
		(Double click on the device. A bug prevents
		 the text display box from updating properly.)
	
		Setup/ General Parameters
			Check the bulk erase box.
		Data/ Load RAM from file
			Choose one of your image files xu1 or xu2.
		Program/ Program-Verify
			Press the start button.
	
Setting up HyperTerminal program to communicate with a processor.
	Get a serial cable to connect between the PC com1 port and the 
	processor serial port 1

	Open a HyperTerminal window using by executing:
		c:\Program Files\Windows NT\Accessories\hypertrm.exe


	If there is a problem exectuing then check:
		Version of hypertrm.exe (Verison 4.0)
		existence of file: c:\winnt\help\hypertrm.cnt
		existence of file: c:\winnt\help\hypertrm.GID
		existence of file: c:\winnt\help\hypertrm.hlp
		existence of file: c:\winnt\system32\hypertrm.dll

	File\properties\Connect To\ Configure for:
		baud rate 	= 9600	
		data bits 	= 8
		parity 		= None
		stop bits 	= 1
		flow Control 	= Xon/X0ff

	Restart VME processor with keystroke 'Ctrl-x'

Configuring the MVM2604 boot ROM:
	Fire up the host terminal program.
	Cycle the power on the VME box & hit any key to interrupt
	the boot.  You can change the boot image file & FTP
	parameters here. Use ? to get a menu.

	The VxWorks network boot process can be interrupted by pressing
	any key. To interrupt VxWorks and force a reboot anytime, press:
		<control> x
	To reboot from the rom monitor prompt, use the @ key.

	From the rom prompt, use the "P" command to display the boot
	parameters. To change the parameters, use "C" and press return
	to skip to the next setting. To erase a setting, use the period
	character as the value of the field.

	Typical boot configuration for the first processor in the box:

	boot device          : dc
	processor number     : 1
	host name            : host
	file name            : \programs\tornado\target\config\mv2604\vxWorks
	inet on ethernet (e) : 90.0.0.1
	host inet (h)        : 90.0.0.127
	user (u)             : anonymous
	ftp password (pw)    : guest
	flags (f)            : 0x8
	target name (tn)     : dsp1  (Use the appropriate name for each processor)
	startup script (s)   : \projects\yourApplication\appcon\vxstartup1.txt

	You can use "." to clear a field.
	Use "@" to reboot.
	Use <Control> X to reboot after VxWorks is running.

	Notes: The processor number N occurs in several places in the script:

		Processor number: Must be N-1.
		Last digit of the "inet on ethernet"
		Last letter of target name.
		Last letter of the startup script file name.
		
Installing Tornado:
	The program won't work right if you try to install as the
	administrator and later operate as a user.  Login with your
	normal account. NOT the  administrator account. If you want
	to use the services of a domain, create a local account on
	your machine that matches the user name and password of the
	domain. DO THIS AFTER YOU HAVE JOINED THE DOMAIN!
	Give the local account administrator privilages to avoid
	other configuration difficulties.  Login to the local
	account to install and use Tornado your machine. You will be
	able to access domain resoures and map domain drives whenever
	you need them.

	Use the setup program with the assigned key.
	For this example, we install tornado in the directory:

		C:\Programs\Tornado

	When asked about configuring the Portmapper and Registry 
	systems, choose the "Install as Services" option.

	It is also possible to install the Portmapper and Registry
	services later. The need to do this may arrise if you
	update NT. Follow the instructions in the appendix E of the
	Tornado Users Guide "Windows NT Service Manager". Actually,
	the need is very likely to arrise because the installation
	script doesn't do this correctly.
	1) execute the Tornado server utility 
		(c:\programs\tornado\host\x86-win32\bin\servUtil.exe)
	2)Install PortMapper
		Service Name: Tornado Portmapper
		Service Executable Pathname: 
			C:\Programs\Tornado\host\x86-win32\bin\portserv.exe
		Service Dependency Name: 
	3) Install Tornado Registry
		Service Name: Tornado Registry
		Service Executable Pathname:
			C:\Programs\Tornado\host\x86-win32\bin\wtxregds.exe
		Service Dependency Name: Tornado Portmapper


Configuring c:\autoexec.bat for Tornado
	The addition below to the autoexec.bat file will allow compilation via 
	the MSDOS prompt at c:\projects\ProjectCode\appcon with the 'make' command.

		REM BEGIN VxWorks Stuff, 
		REM Allows compilation in MSDOS window via directory C:\projects\ProjectCode\Appcon
		REM with command 'make'
		REM Command line build environments
		set WIND_HOST_TYPE=x86-win32
		set WIND_BASE=C:\Programs\Tornado
		set WIND_REGISTRY=
		set GCC_EXEC_PREFIX=C:\Programs\Tornado\host\x86-win32\lib\gcc-lib\
		set PATH=C:\Programs\Tornado\host\x86-win32\bin;%PATH%
		REM END VxWorks Stuff


Patching Tornado
	Currently (January 21, 1997) there is only one outstanding
	WRS patch applied after installing from the CD. 
	Via the MSDOS prompt type 'set WIND_BASE=c:\programs\Tornado'
	The file is called:

		5_3FCS_PPC604_7605.exe

Uninstalling Tornado
	You cannot uninstall while the Portmapper and Registry
	Services are running. Stop these services with the Services
	Control panel. There is an iconic shortcut for uninstalling
	Tornado in the Start menu group for Tornado. If you loose
	this shortcut, you can use the the Control panel: 

		Add/Remove Programs

	If you prefer, the DOS command to uninstall is:

		C:\WINNT\uninst.exe 
			-fC:\Programs\Tornado\DeIsL1.isu

Doing the "Whirlwind Tour"
	The vxColor example shows how to add an item to the project
	menu. One of the parameters passed to the makefile in the
	dialog box is a selector for the CPU type. The example shows
	a 68k processor. The correct setting for the MVM1600 is
	PPC604.

Using the compiler:
	The examples use the compiler switch -g to enable debugging
	with the flag -o2 for level 2 optimization. You should
	override these options in your make file:

		-gdwarf		Use DWARF debugging information
		-o0		No optimization. (This is the letter
				lower case "Oh" followed by a zero.)

	These (and any other flags you add) are introduced into your
	makefile with an additional line:

		ADDED_CFLAGS = -O0 -gdwarf -D_GNU_TOOL
	
	Note the added flag for -D_GNU_TOOL. This is recommended
	in the "Tornado for PowerPC Archtectuer Supplement". Please
	refer to the example COOPS makefile for additional details.

	When you load a module with GDB two steps occur. First the
	code is downloaded, then the symbolic information is read
	into the debugger. If you use -g the symbol reading process
	takes a very very long time. If you use -gdwarf the symbol
	reading process will be instantanious.
	HOWEVER: The -g option must be used if you are using C++,
	so C++ folks just have to suffer.

OPEN Tornado through the Start Menu

Changes to VxWorks BSP REQUIRED for MTS applications:
	If you can get a copy of the whole mv2604 directory patched by
	someone at MTS, you can skip all this. But then you will never
	know for sure what's wrong with your dsp application!
	Place the folder in the directory:
		c:\programs\Tornado\target\config

	A number of changes, including bug fixes, must be made to
	the source files that build the VxWorks image.  These changes
	are documented in the "Tornado MV2600 Support" directory. The current
	set of changes include memory management configuration to access the
	VME bus and PCI bus and modifications to the interrupt dispatcher
	to support reentrant interrupts.  The changes consist of 
	replacement files that are installed in the VxWorks
	Target directory.  After copying these files into there proper 
	locations, bring up the "Config BSP" dialog. Press the "Config"
	and "Build" buttons to rebuild the VxWorks.o file. (This is the
	BSP and operating system downloaded at boot time.)
	More details are in the "MTSChanges2600.txt" file located in the
	"MTS VxWorks Changes" directory.

Under the debug menu, add the following source search path names:
	C:\Programs\Tornado\target\config\mv2600
	C:\Projects\ProjectCode\AppCon
	C:\Projects\ProjectCode\AppDsp
	C:\Projects\Schema\CoopsCom
	C:\Projects\ProjectCode\Workspace\LibDSP

Configuring Tornado:
	Using the Tools/Target Server/Configure menu, add a new
	target server. The only field on the first page you need
	to fill in is the target IP number. The target server
	will connect much faster if you use the target IP name
	instead of the IP number.

		Target IP name/address: dsp1 (Use the appropriate name)

VxWorks header file Code Changes
	file - c:\programs\tornado\target\h\setjmp.h
	Add at the top:
	#ifndef __INCvxWorksh
	#include <vxworks.h>
	#endif

	If you plan to use a PCI scramnet card on the processor
	file - c:\programs\tornado\target\config\mv2604\mv2600.h
	Find:
	#define CPU_PCI_MEM_SIZE	0x01000000	/* 16 meg */
	Replace with:
	/* (MTS) changed from 0x01000000 to create 16M more space for the scramnet card */
	#define CPU_PCI_MEM_SIZE	0x02000000	/* 32 meg */

Adding your project to the Tornado menu
	Using Projects\Customize add the following project symbols:

	Menu Text		: Update Coops
	Build Target		: UpdateCoops
	Working Directory	: c:\projects\ProjectCode\appcon

	Menu Text		: Update VxSocket
	Build Target		: UpdateVxSocket
	Working Directory	: c:\projects\ProjectCode\appcon

	Menu Text		: Update VxSerial
	Build Target		: UpdateVxSerial
	Working Directory	: c:\projects\ProjectCode\appcon
	
	The build targets refer to labels in your makefile. Some projects
	will require other components which you may add here.

	You must build VxSocket and VxSerial now because they are required for
	configuring the BSP in the next step. So select Update VxSerial & Update
	VxSocket from the Projects menu. The object files should get produced.
	You must have a valid COOPS makefile in your AppCon directory for this
	to work. If you are starting from scratch, first build and run Generic.exe,
	(See file InstallingVisualC.txt)

Configuring the BSP to use the target shell
	After you work with the great WYSIWYG Tornado development environment
	for a few hours, you may want to try going back to old glass-crt
	interface provided by the target-based shell.
	The menu Projects\Config BSP dialog has nice interface for building
	the BSP by adding or removing selected serivices.
	First save your current configuration by pressing the "save" button.
	Edit a new configuration name and change the following items.
	You need to include the following features:

		INCLUDE_DEBUG           /* native debugging */
		INCLUDE_LOADER		/* object module loading */
		INCLUDE_NET_SYM_TBL     /* load symbol table from network */
		INCLUDE_RLOGIN          /* remote login */
		INCLUDE_SHELL		/* interactive c-expression interpreter */
		INCLUDE_SHOW_ROUTINES	/* show routines for system facilities*/
		INCLUDE_SPY		/* spyLib for task monitoring */
		INCLUDE_STARTUP_SCRIPT	/* execute start-up script */
		INCLUDE_STAT_SYM_TBL	/* create user-readable error status */
		INCLUDE_SYM_TBL 	/* symbol table package */
		INCLUDE_TELNET		/* telnet-style remote login */
		INCLUDE_UNLOADER	/* object module unloading */
	
	You need to remove the following feature:

		INCLUDE_WDB		/* tornado debug agent */

	Press the "Save" button to save your configuration changes.
	Press the "Configure" and "Build" button to make a new VxWorks.o file.

	To restore any previously saved configuration, simply select the
	configuration name from the pull down menu and press the "Config"
	and "Build" buttons. You will definitely want at least two configurations:
	one for debugging with WDB and one for the target shell. The target
	shell setup is by far the most efficient when target debugging is not
	required.

Adding modules to the VxWorks BSP image

	At the bottom of the "Config BSP" dialog box there is a display box
	that shows the names of addtional object modules to be linked when
	building the VxWorks.o image.
 
	Use the "Add" button to include additional object modules:
	In ASD, we currently require the the following modules to
	avoid name conflicts between Unix RTL functions and COOPS selectors:

		C:\Projects\ProjectCode\Workspace\LibDSP\vxSocket.o	(Required for socket links.)
		C:\Projects\ProjectCode\Workspace\LibDSP\vxSerial.o	(Only needed if you are using target serial ports.)

	In both of these cases, we are avoiding collisions between the Unix I/O 
	functions: read, write, open, close and the COOPS selectors with the same
	names. Modules such as vxSocket provide wrapper functions with names like
	socketRead, socketWrite, etc., to call the Unix functions read, write, etc.
	By linking the module with VxWorks first, the Unix names are bound to their
	proper RTL library functions. When coops.o is downloaded, the Unix functions
	that match selector names become inaccessable.

	After adding your modules, press the "Configure" and "Build" buttons to create
	a new VxWorks.o file.

Specifying a startup command script file:
	When using the target shell, you can specify a host-based startup
	command file that runs after VxWorks boots. The path for this file
	is specified in the startup monitor window.

	A typical COOPS startup file is displayed below:
	
	/* VxStartup.txt -- Startup script for VxWorks */

	ld 1,0,"/projects/ProjectCode/workspace/libdsp/coops.o"
	heapInit(8000000)
	shareInit(0x00F00000, 0x100000)
	mainStart(1)

	The parameter to mainStart(n) is the processor number for that processor.
	The convention is to create several VxStartupN.txt files where N is the
	processor number. They each contain the line:
		mainStart(n)
	You have to make n the literal processor number.

Build Visual C++ using document 'GettingStartedVisualC.txt'
	After building your Visual C++ projects you should run the Generic.exe program 
	in the AppCon directory. The following
	C files will be created automatically:

	ConfigDSP.c	! Application functions for the DSP target
	ConfigSim.c	! Application functions for the simulation target
	ConfigSup.c	! Application functions for the supervisor dll.
	makefile	! The make file for VxWorks

	A this point you should be able to select the Update Coops selection
	from the Project menu and rebuild the target coops.o image file.

	You must edit the VxStartup.txt file in the AppCon directory to
	reflect the path to your coops.o file before rebooting the system.


After you are complete with the Tornado and Visual C++ installtion then restart machine
to allow for the FTP and Tornado services to start effectively.


APPENDIX: Getting into the Wind River System WEB support service
	The Web URL for Wind River Systems:

		www.wrs.com

	To get into the "24 hour support" part of their web page
	you need a user name and password:

		Windserve
		Valid

APPENDIX: Wind River people:

	The WindRiver field engineer is:

		Ed Klein:	847-490-6062
		Support line:	510-748-4100
		License stuff:	license@wrs.com

	License support folks: Diane Harvey, Melissa Robbins
	
	Tech Support People I Have Known
	   (Not in the Biblical sense)

		Richard Levine
		Bill Grifith
		Jerry Pendleton is the WRS Expert on PPC.
			Jerry is a BMTS victim and does not return calls.
		 	(Battered by MTS Syndrome)

	Support contract person
		Megan Shanahan 510-814-2586
