From: hoffman@xdelta.enet.dec.com (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: Configuring Device Drivers
Keywords: SYSGEN, DEVICES, CSR, VECTOR
Date: 30 Jul 92 18:14:56 GMT
Reply-To: hoffman@xdelta.enet.dec.com ()
Organization: Digital Equipment Corporation


In article <1992Jul30.160600.25038@natinst.com>, dp@natinst.com (Debapriya Ray)
 writes:
|>Newsgroups: comp.os.vms
|>Path: nntpd.lkg.dec.com!news.crl.dec.com!deccrl!decwrl!sun-barr!cs.utexas.edu
    !natinst.com!dp
|>From: dp@natinst.com (Debapriya Ray)
|>Subject: Configuring Device Drivers
|>Message-ID: <1992Jul30.160600.25038@natinst.com>
|>Sender: news@natinst.com
|>Nntp-Posting-Host: falcon.natinst.com
|>Organization: National Instruments, Austin, TX
|>Date: Thu, 30 Jul 1992 16:06:00 GMT
|>Lines: 28
|>
|>Hi folks !
|>
|>	I am writing a device driver in VMS for one of our boards. Usually
|>we have a couple of boards and a bunch of devices connected to them. In case
|>of our UNIX drivers for similar boards, we have a program to configure the
|>driver dynamically, i.e, we can change board/device addresses, change
|>interrupt levels, and some other parameters on the fly. The way this is
|>done is by opening the executable driver-file and writing into the .exe
|>code.

	I assume you are talking about the UNIBUS and/or the Q-bus.
	If so, patching the drivers is not necessary on VMS.  (You
	will likely find VMS device drivers to be quite different,
	probably more complex, and more dynamic than those on ULTRIX.
	The two operating systems have entirely different philosophies
	in this area -- and it really shows.  And I am not sure which
	approach I prefer.)

|>	My question is: How are VMS drivers configured ? Is there any way at
|>all of configuring VMS drivers ? Or, everything has to be hard-wired into the
|>driver code itself before assembly (which is not what we want) ?...

	Most device drivers might fork to a lower IPL, but they tend to
	treat the device IPL itself as a static value -- as most devices
	only include the hardware necessary to support an interrupt at a
	single device interrupt IPL.  (Devices can request an interrupt
	at IPL 20 through IPL 23 via BIRQ4 through BIRQ7 signals, with
	the interrupt granted via UNIBUS BG4 through BG7 signals.)  In
	the case of Q-bus VAX Systems, there is only one grant signal,
	BIAK, and thus typically only one device interrupt IPL, IPL 23. 
	(VMS does include the capability to enable multilevel interrupts
	on the Q-bus -- effectively simulating the UNIBUS BG4 through BG7
	signals -- via the VMS SYSGEN parameter QBUS_MULT_INTR.  The Q-bus
	must be correctly configured and all drivers must be designed and
	implemented with QBUS_MULT_INTR support in order for the Q-bus
	multilevel interrupts to operate correctly.

	The device CSR and interrupt vector can determined by qualifiers
	on the SYSGEN CONNECT command -- the driver can easily read this
	configuration information out of the Interrupt Dispatch Block.
	(The driver can pull these values out of the IDB, specifically
	looking in fields IDB$L_CSR and IDB$B_VECTOR.)  (This assumes
	the particular device does not emulate a Digital-provided device,
	specifically a device that is known to SYSGEN AUTOCONFIG.)