UDA driver query

Chris Torek chris at umcp-cs.UUCP
Mon Mar 24 07:52:36 AEST 1986


In article <1986 at brl-smoke.ARPA> eichelbe at nadc.arpa writes:
>I have a VAX 11/780 under 4.1 BSD UNIX and [a] (UDA50/RA81) driver
>that compiles but for one error.  In the routine udprobe ... there
>is a reference to a variable uh_lastiv in the uba_hd structure. ...
>I don't find a uh_lastiv in the structure.

Ah, at last, I can show off my wizardly skills again! :-)  Actually,
I had the exact same thing happen when I installed a uda.c on a 4.1
system, long ago.

>(1) What is uh_lastiv supposed to do?

It is the `last interrupt vector' address, for devices with
programmable interrupt vectors.  These did not appear until well
after the 4.1 release, so only `late 4.1s' have the code.  The
variable is set to 0x200 (01000) in autoconf.c, and predecremented
by the appropriate amount by any driver needing a programmable
interrupt vector.

>(2) Can I (and how if I can) change udprobe to get rid of the uh_lastiv
>    reference safely?

If you have exactly one UDA50, no DMF32s, no DMZ32s, and so forth,
you can use

	br = 0x15;
	cvec = sc->sc_ivec = 0774;

but this creates a bug just waiting until the time is ripe to leap out
and strangle you.

>(3) If I can't get rid of the reference, how should I change the uba_hd
>    structure in /sys/h/ubavar.h so I too can use uh_lastiv ....

1) Add `uh_lastiv' to `struct uba_hd' in ubavar.h (at the end; that
   may be unnecessary, but is definitely safe).

2) In autoconf.c, find the routine named `unifind' or `UNIfind' or
   some variation thereof.  In there will be code resembling the
   following:

	if (numuba == 0)
		uhp->uh_vec = UNIvec;
	else
		uhp->uh_vec = (int(**)())calloc(512);
	for (i = 0; i < 128; i++)
		uhp->uh_vec[i] = scbentry(&catcher[i*2], SCB_ISTACK);

   After this, add:

	/*
	 * Set last free interrupt vector for devices with
	 * programmable interrupt vectors.  Use is to decrement
	 * this number and use result as interrupt vector.
	 */
	uhp->uh_lastiv = 0x200;


Unfortunately, that uda.c is fairly buggy.  If I had to run RA81s
on a 4.1 system, I would reconvert my new driver to 4.1 code.  But
if you must run that driver on a 780, use it on a Unibus all by
itself, or at least with nothing else that uses BDPs.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list