<<< EISNER::DUA3:[NOTES$LIBRARY]PDP-11.NOTE;1 >>> -< PDP-11 >- ================================================================================ Note 272.0 [RT11]Device Handler: Logical Device Name Access No replies EISNER::CAMPBELL "Milton Campbell" 60 lines 16-AUG-1989 10:51 -------------------------------------------------------------------------------- At a session at the spring 1989 Symposium in Atlanta I learned about an interesting "trick" having to do with RT-11 "special directory" device handlers. Special directory devices are those that do not contain an RT-11 file structure, the classic example being mag-tape. For such devices, the RT-11 USR does not process the various file processing requests such as .LOOKUP, .ENTER and .CLOSE. Instead, the requests are passed to the handler for any special processing. The "trick" has to do with the file name that the handler sees on a .ENTER or .LOOKUP request. RT-11 passes the name to the handler as a four word RAD50 block, with the device name in the first word, the file name in the second and third words, and the file type in the fourth word. Normally, a special directory handler does not use the device name word because the handler "knows" who it is. However, it turns out that the device name word contains the original device name requested by the user, not the name of the handler that actually processes the request. This means that if the request uses a logical device name (associated with the real device by the ASSIGN command) the handler sees the logical name in the device word. This is useful because special directory handlers can be used to extend RT-11 in a number of ways. One example is the networking product described in the Symposium session. With the logical name available, special directory handlers have additional information about the request. Because the "buffer address" passed to the handler by the operating system points to the start of the file name, extra code is needed to actually get at the device name. The buffer address must be backed up a word, which in turn may cross a PAR boundary. Below is a code fragment to do the backup. I have extended it for TSX-Plus from a fragment by John Crowell for RT-11 XM. mov XXcqe,r4 ; Point to queue element sub #2,Q$BUFF(r4) ; Back up to device name .if ne mmg$t .if eq tsx$p ; Check for TSX ;code for RT-11 XM cmp Q$BUFF(r4),#2000 ; Cross PAR1 boundary? .iff ;code for TSX-Plus cmp Q$BUFF(r4),#140000 ; Cross PAR6 boundary? .endc bhis 5$ ; If still in PAR region add #20000,Q$BUFF(r4) ; Adjust offset sub #200,Q$PAR(r4) ; and PAR bias 5$: .endc