.TITLE NULDRIVER - VAX/VMS Null Printer Device Driver ; ; AUTHOR: ; ; JY Collot ; ; REMARQUES : ; ; Cette chose se compile : ; $ MACRO NULDRIVER ; se linke : ; $ LINK /NOTRACE NULDRIVER,SYS$INPUT:/OPT ; BASE=0 ; se copie sur SYS$LOADABLE_IMAGES: ; enfin, se charge : ; $ RUN SYS$SYSTEM:SYSGEN ; CONNECT NULA0/NOADAPTER/DRIVER=NULDRIVER ; EXIT .SBTTL External and local symbol definitions ; ; External symbols ; .LIBRARY 'SYS$LIBRARY:LIB' .LINK 'SYS$SYSTEM:SYS.STB'/SE $DCDEF ; Device classes and types $DDBDEF $DEVDEF ; Device characteristics $DYNDEF $IODEF ; I/O function codes $SSDEF ; System status codes $UCBDEF ; Unit control block ; definitions. .SBTTL Standard tables ; ; Driver prologue table ; DPTAB - ; DPT-creation macro END=NUL_END,- ; End of driver label ADAPTER=NULL,- ; Adapter type UCBSIZE=, - ; Length of UCB FLAGS=,- ; Driver runs SMP NAME=NULDRIVER ; Driver name DPT_STORE INIT ; Start of load ; initialization table DPT_STORE UCB,UCB$B_FLCK,B,SPL$C_IOLOCK8 ; Device FORK LOCK DPT_STORE UCB,UCB$B_DIPL,B,22 ; Device interrupt IPL DPT_STORE UCB,UCB$W_DEVBUFSIZ,W,- ; Default buffer size 512 DPT_STORE REINIT ; Start of reload ; initialization table DPT_STORE UCB,UCB$B_DEVCLASS,B,DC$_LP ; Emulates a printer DPT_STORE UCB,UCB$B_DEVTYPE,B,DT$_NULL ; DPT_STORE DDB,DDB$L_DDT,D,NUL$DDT ; Address of DDT DPT_STORE UCB,UCB$L_DEVCHAR,L,<- ; Device characteristics DEV$M_SHR!- DEV$M_IDV!- ; input device DEV$M_REC!- DEV$M_AVL!- ; Available DEV$M_ODV> ; output device DPT_STORE UCB,UCB$W_STS,W,- DPT_STORE END ; End of initialization ; tables ; ; Driver dispatch table ; DDTAB - ; DDT-creation macro DEVNAM=NUL,- ; Name of device FUNCTB=NUL_FUNCTABLE ; FDT address ; ; Function decision table ; NUL_FUNCTABLE: ; FDT for driver FUNCTAB ,- ; Valid I/O functions ; Set device chars. FUNCTAB , ; No buffered functions FUNCTAB FDT_READ,- ; FDT read routine for FUNCTAB FDT_SET,- ; and read physical. FUNCTAB FDT_WRITE,- ; FDT write routine for ; and write physical. ;++ ; FDT_READ ; ;-- FDT_READ: ; Sample FDT routine Movl #SS$_ENDOFFILE,R0 CLRL R1 JMP G^EXE$ABORTIO FDT_SET: ; Sample FDT routine Movl #SS$_NORMAL,R0 CLRL R1 JMP G^EXE$FINISHIO FDT_WRITE: ; Sample FDT routine Movl #SS$_NORMAL,R0 INSV 8(ap),#15,#16,R0 CLRL R1 JMP G^EXE$FINISHIO ;++ ; Label that marks the end of the driver ;-- NUL_END: ; Last location in driver .END FUNCTB=NUL_FUNCTABLE ; FDT address ; ; Function decision table ; NUL_FUNCTABLE: ; FDT for driver FUNCTAB ,- ; Valid I/O functions ; Set device chars. FUNCTAB , ; No buffered functions FUNCTAB FDT_READ,- ; FDT read routine for FUNCTAB FDT_SET,- ; and read physical. FUNCTAB FDT_WRITE,- ; FDT write routine for ; and write physical. ;++ ; FDT_READ ; ;-- FDT_READ: ; Sample FDT routine Movl #SS$_ENDOFFILE,R0 CLRL R1 JMP G^EXE$ABORTIO FDT_SET: ; Sample FDT routine Movl #SS$_NORMAL,R0 CLRL R1 JMP G^EXE$FINISHIO FDT_WRITE: ; Sample FDT routine Movl #SS$_NORMAL,R0 INSV 8(ap),#15,#16,R0 CLRL R1 JMP G^EXE$FINISHIO ;++ ; Label that marks the end of the driver ;-- NUL_END: ; Last location in driver .END