From: ebg@atr-hr.atr.co.jp (Ed Gamble)
Newsgroups: comp.os.vxworks
Subject: Re: CSPI supercard and MV147
Date: 10 Oct 92 01:51:42 GMT
Organization: ATR Auditory and Visual Perception Research Labs., Japan
In-reply-to: prb@aplexus.jhuapl.edu's message of 8 Oct 92 20:25:20 GMT


    From: prb@aplexus.jhuapl.edu (Paul R. Bade)
    Newsgroups: comp.os.vxworks
    Subject: CSPI supercard and MV147
    Date: 8 Oct 92 20:25:20 GMT

    Hello,

    I am curious if there is anybody out there using a
    CSPI supercard with a MV147 or MV167?

I've got such a system.   I bought a CSPI RTS-860 box with 2 SC-2XL
Supercards and *without* their supplied pSOS operating system.  I've
got the CSPI VxWorks driver and, of course, VxWorks running on the MV147.

    We recently purchased a supposedly "turn key" CSPI card
    that we still hope to use with our MV167 boards.
    But so far it has been far from turn key.
    Our major problem has been the inability of CSPI to
    answer questions about the CSPI supplied driver.
    When compiling the CSPI code with the specified flags,
    I had an unresolved symbol.  It took them 2 days
    to tell me that they forgot to specify the -Dsun flag.
    After several other problems, we still have
    not been able to run any code on the supercard.
    So I am really curious if there are any happy users
    or if I should not waste my time.

I had similar problems to yours.  In particular, since I purchased a
"less than RTS-860" system (no pSOS operating system) I was told that
if I had any questions about configuring the RTS hardware (tape
drive, hard disk, serial ports, etc) that I should talk to my VxWorks
vender.  It only took two weeks to get hardware manuals.  

One person at CSPI who *has been* helpful is Owen McGonagle.  If you
haven't already spoken to him, try.

My system is now working after several bug fixes that I tracked down
on my own.  For VME Software Release 3.02 dated August 1991 with
VxWorks 5.0.2:

1)  Add the -Dsun flag to the makefile entry for cs.o which you added
to the VxWork config 

2) Under VxWorks there is a major bug in csinit() which prevents the
use of the SuperCards.  From hsl/csinit.c

/*--------------------------------------------------------------*/
/* SELECT A SUPERCARD                                           */
 

   for ( i=0; i<XLMAXCP_K && (fd == -1) && (csarray[i] != -1) ; i++ )
      {
       (void)sprintf(fname,"/dev/cs%1.1d",(csunit=csarray[i])) ;
#ifdef unix
	    fd = cmfd = dmfd = open (fname, O_RDWR, 0666);
#endif
#ifdef PCDOS
            fd = cmfd = dmfd = csdil_open(&devarray[csunit]) ;
#endif 
	    }

    if (fd == -1)
	xlerror (csunit, FATAL, "csinit", "No SuperCard available");

The directives '#ifdef unix' and '#ifdef PCDOS' are not compiled
under VxWorks consequently no supercard is ever opened and the
warning cs0:csinit:FATAL: No SuperCard available" occurs.  Here is an
example of the problem:

-> ld < cstst
value = 0 = 0x0
-> sp cstst
task spawned: id = 0x29e5a4, name = t1
value = 2745764 = 0x29e5a4
-> 
                        SUPERCARD TEST SUITE

PERFORMING SSL DATA TESTS...

cs0:csinit:FATAL: No SuperCard available

-> setenv("CS", "1,0");
value = 0 = 0x0
-> sp cstst
task spawned: id = 0x29e5a4, name = t2
value = 2745764 = 0x29e5a4
-> 
                        SUPERCARD TEST SUITE

PERFORMING SSL DATA TESTS...

cs1:csinit:FATAL: No SuperCard available


The fix is to change the compilation directive to the following:

#if defined unix || defined VXWORKS
	    fd = cmfd = dmfd = open (fname, O_RDWR, 0666);
#endif


3) That is the primary bug but there are others.  The environment
variables CS, CS_LOADFILE, and CS_LOADSSL won't work because in the
file cschkenv.c the getenv() calls are not compiled.  Reason: same as
above, just change the #ifdef unix to #if defined unix || defined
VXWORKS.

4) Same problem in xlwint.c

5) Also in csinit.c, the function all: strchr(csenv,(char)",") is
performed.  This will fail under VxWorks, the proper call is
strchr(csenv,',')

Good luck.  Contact me if you've got any questions.  And, if you've
experienced other problems, tell me so I can avoid the same.

-- Ed
Newsgroups: comp.os.vxworks