This driver is designed to support a DR-11W under RSX-11M+ version 3.0 and later interfaced to an ACROAMATICS 2110 Telemetry data processor (TDP) system. The design of this driver follows the VAX/VMS XA driver in direct memory access (DMA) mode as closely as possible. This was done to ease compatibility of software access to the telemetry sys- tem, and its always nice to have a structure to follow. The driver accepts 4 general functions, read logical block, write logical block, set characteristics, and sense characteristics. In addition, the read and write accept subfunction codes reset, set function bits, and set time out. The device is flagged as a record structured sequen- tial device in the driver unit control block (UCB). This has the side effect of allowing use of read/write virtual, but the operating system will convert this to read/write logical and strip off all subfunction bits. The read and write logical functions are used to transfer data via a dma channel between the external device and the host PDP-11. The transfers can have either a reset or set function subfunction as required, and a new time out set if required. The processing of the subfunctions is per- formed prior to setting up the DMA channel, which would al- low for most hardware handshake protocols to be fulfilled. The time out processing is performed just before setting the go bit to start the transfer. The transfer complete is sig- nalled by an interrupt, which can come from either a word count register overflow or any of the exception interrupts. The transfer complete is signalled by placing the number of bytes transferred in the second word of the input output status block (IOSB) and success (is.suc) in the first word of the IOSB. A device time out will place a time out error code (ie.tmo) in the frist word of the IOSB and the CSR in the second word. The driver allocates and releases unibus mapping regis- ters (UMR's) for each data transfer. If a higher speed transfer is required, the driver could be modified to accept device allocation and permanently allocate UMR's at that time. The interface to the TDP has a 4K word first in first out (FIFO) buffer which allows extra processing time between transfers before a data overrun will occur. Since is is possible for rogue devices to generate spurious interrupts, or as in this device's case, to generate a DMA done interrupt coincident with a frame done interrupt when the requested transfer count exactly equals a telemetry frame. In this case, a hardware race will occur in which the ATTENTION interrupt and the DMA done interrupt will both be pending. To assure correct handling of all in- terrupts, all transfers are flagged with an interrupt ex- pected in the UCB and the interrupt handler clears the flag. If an interrupt occurs when the flag is clear, the interrupt is dismissed. All access to the interrupt expected flag is done at hardware priority (PR5) to assure proper synchroni- zation. All setting of the CSR is also done at device priority to assure stability. DR-11W DRIVER FOR RSX-11M+ version 3.0 OR LATER Page 2 For non-DMA operations, the sense and set characteris- tics functions are available. For a Set characteristic (io.stc) function, the user parameter (first word of the I/O parameter block) has all but the lower three bits cleared, and these bits are then left shifted to the control bit positions and or'ed into the CSR. For a sense characteris- tics, the CSR is merely read. In both cases the entire CSR is returned in the second word of the IOSB. No interrupt processing is expected with these functions, and should one occur, it would be dismissed as an unexpected interrupt. The following code fragments shows a typical MACRO-11 interface to the QA driver. The setting up of the subfunc- tion codes is as follows: 1. IO.SFT=2 ;set function subfunction 2. IO.RES=4 ;reset subfunction 3. IO.STO=10 ;set time out subfunction The access to the driver is shown as follows: 1. Assign logical unit: alun$s #tdplun,#"QA,0 ; bcc setasn ;ok ? mov $dsw,r0 ;get status return return 2. Sense characteristics qiow$s #io.sec,#tdplun,#tdpflg,,#driosb,, bcc 15$ ;ok? mov $dsw,r0 return 15$: tstb driosb+1 ;check i/o bpl 20$ ;if plus, no error mov driosb,r0 ;and io status return 3. Write logical block, set function: wrset: mov r2,incnt ;set character count qiow$s #io.wlb!io.sft,#tdplun,#tdpflg,,#driosb,,<#inbuf,in cnt,#wrsetup> bcc 10$ ;ok ? mov $dsw,ro return 10$: tstb driosb+1 ;transfer ok? bmi 20$ ;minus, no cmp driosb+2,incnt ;how many bytes DR-11W DRIVER FOR RSX-11M+ version 3.0 OR LATER Page 3 The read logical and set characteristics are are very similar to the write logical and sense characteristic exam- ples. The use of a new time out would be similar to the set function subfunction, being or'ed into the function code, and the new time out (in seconds) as the fourth element of the device dependant parameters. Two command files (asm.cmd and bld.cmd) are used to as- semble and build the driver. These files assume the source code is in the named directory [qadrv]. The driver map is placed in UIC [1,34] and the driver and symbol table in UIC [1,54]. The command file QA.CMD will load the driver at the top of the GEN partition and configure online the controller (QAA) and the unit (QA0).