From: MERC::"uunet!WKUVX1.BITNET!MacroMan" 18-MAR-1993 19:03:42.41 To: TGV.COM!MACRO32@WKUVX1.BITNET CC: Subj: FTS 1.2 Well, with everyone posting code, I thought I'd post some as well. I've been playing around with a program I wrote called FTS and I decided to make the latest version available to anyone who wants it. FTS is a collection of hacks that do thing that the VMS utilities won't, like intercepting device entry points and monitoring a processes system service calls (by patching the DDT and P1 SS vectors respectively). I've made the code available via anonymous FTP on PUBLIC.TGV.COM for anyone on the Inetnet. Perhaps someone here could replace the old version in the MACRO32 archives. This version is much better behaved. The latest version is 1.2 and the main improvement is that you can add a /STYLE flag to the WATCH DEVICE command. For instance: WHATNO$ FTS WATCH DEV DKA0: /fdt/iopost /style=F11 13:49:42.42 IOPOST: pid 1002f IRP 81637c00, IOSB (2000001,7ffe0000) 13:49:42.42 IOPOST: pid 1002f IRP 8164ea00, IOSB (2000001,7ffe0000) 13:49:42.42 IOPOST: pid 1002f IRP 81685a40, IOSB (8000001,7fe30000) 13:49:42.42 IOPOST: pid 1002f IRP 8164cd80, IOSB (4000001,7fe30000) 13:49:42.45 FDT: pid 1002f IRP 81654940 UCB 8111b0f8 Func 72(ACCESS) (7fedf010,0,0,0,7fedfe00,0) => 1 FIB: FID=(5085,2,0) DID=(0,0,0) 13:49:42.45 FDT: pid 1002f IRP 8163e800 UCB 8111b0f8 Func 21(READLBLK) (812a1200,200,cc796,0,0,0) => 1 13:49:42.47 IOPOST: pid 1002f IRP 8163e800, IOSB (2000001,0) 13:49:42.48 FDT: pid 1002f IRP 816cb340 UCB 8111b0f8 Func 31(READVBLK) (7fee0200,1400,1,0,0,0) => 1 13:49:42.51 IOPOST: pid 1002f IRP 816cb340, IOSB (14000001,0) 13:49:42.51 FDT: pid 1002f IRP 816427c0 UCB 8111b0f8 Func 34(DEACCESS) (0,0,0,0,0,0) => 1 13:49:44.40 IOPOST: pid 1002f IRP 81650e00, IOSB (61616161,61616161) 13:49:44.43 FDT: pid 1002f IRP 81650e00 UCB 8111b0f8 Func 34(DEACCESS) (0,0,0,0,0,0) => 26c 13:49:44.49 IOPOST: pid 1002f IRP 8164ea00, IOSB (1,0) 13:49:44.53 FDT: pid 1002f IRP 8164ea00 UCB 8111b0f8 Func 34(DEACCESS) (0,0,0,0,0,0) => 1 Right now the F11 style only prints the FID and DID on certain calls, but you can change the code to print out whatever FIB info you like. One other change that I use a lot is the SHO DEVICE command: WHATNO$ fts sho dev bg DEVICE BG: ddb=816346c0, ddt=8168c164, ucb=81649fc0, template=81649fc0 FDT size = 148 bytes FDT legal functions: RELEASE WRITEPBLK READPBLK SETCHAR SENSECHAR WRITELBLK READLBLK SETMODE SENSEMODE WRITEOF WRITEVBLK READVBLK ACCESS DEACCESS READPROMPT ACPCONTROL FDT buffered functions: ACCESS FDT 8168c546 = WRITEPBLK READPBLK SETCHAR SENSECHAR WRITELBLK READLBLK SETMODE SENSEMODE WRITEVBLK READVBLK ACCESS DEACCESS READPROMPT ACPCONTROL FDT 8168c7de = WRITEPBLK WRITELBLK WRITEVBLK FDT 8168c56d = READPBLK READLBLK READVBLK FDT 8168d6ad = READPROMPT FDT 8168cd24 = SENSECHAR SENSEMODE FDT 8168d19c = SETCHAR SETMODE FDT 8168ddc2 = ACPCONTROL FDT 8168c9de = ACCESS FDT 8168cc64 = DEACCESS FDT 8168cd1e = WRITEOF FDT 8168dc6e = RELEASE WHATNO$ Here are the hastily assembled release notes: FTS Release Notes ===================== Overview: --------- The Functional Testing Suite (FTS) is a do-everything utility for monitoring and controlling a VMS system. The philosophy here is that everytime I want to do something under VMS, and there's no command to do it, I'll write it myself and add it to FTS. It started out as a monitor for images which I didn't have source code for (like UCX applications) and grew into a sort of grab-bag of hacks. FTS is generally distributed in VMS_SHARE format. To unpack the source code, execute (via DCL) the distribution file (eg. $ @FTS012.SHAR). To build the FTS executable, us the command "$ @MAKE". The only file required to actually use FTS is FTS.EXE which should be installed as a foreign command (ie. "$ FTS :== $disk:[dir]FTS.EXE"). If anyone out there wants to put together a VMS help file, god bless them. The currently supported help system is the source code, especially the file FTS_PARSE.CLD. I have compiled FTS 1.2 under VMS versions V5.1-1, V5.5-2, and FT6.0. (Without problems) WARNING!!! FTS is an rather brutish program which may very well do nasty things to your system, least of all crash it. Don't use this program unless you think you know what you're doing! Consider yourself warned. Comments and additions are cheerfully accepted: Bruce R. Miller TGV, Inc. 603 Mission St. Santa Cruz, CA 95060 (403) 427-4366 Internet: MILLER@TGV.COM Wish List: ---------- A cancel command which can remove channels from other processes. Write a generic message queueing/printing system and use it for both JASMON and DEVWATCH. Write a better SHOW PAGE command (ie. one that doesn't crash the VAX) Write a command to control the locking/unlocking of pages FTS 1.2 Release Notes ===================== In 1.2, a lot of code has been converted to C. This was done because the mind-boggling attention to detail required for managing stack variables and registers in non-kernel code was driving me nuts. The is now a SHOW DEVICE command which will display a device's FDT. I'm open to suggestions about other things to display. The WATCH DEVICE command will now accept the /STYLE qualifier. Currently accepted styles are: DEFAULT, NULL, TGV, UCX, PSI, and F11. The TGV style is good for watching TGV's INET: device. UCX style works for Digital's BG: device. PSI doesn't do much of anything. F11 is intended for watching Files-11 devices. LOAD XDT (Load XDelta) now signal it's errors, instead of failing silently. A number of spelling and grammatical errors have been corrected. Added a SHOW LOGICAL /PID command to evaluate logical names in other processes. Fixed problem where DEVWATCH would try to modify an instruction in IOC$IOPOST that could straddle a page boundary. Changed code to unprotect *both* pages before modifying them. Boy, is my face red. Added code to handle the fact that the IOC$IOPOST interrupt handler changed slightly in a recent version of VMS (5.5?). Added an improved MAKE.COM procedure for building FTS. Made a whole lot of minor fixes that I can't remember. Unresolved Problems: -------------------- If we are monitoring the device we are sending the monitor data to, we get feed back and blow up. JASMON doesn't monitor SS calls from kernel mode. -b. FTS 1.1 Release Notes ===================== I have no idea what happened to FTS 1.1 or even if there ever was one. For some reason I jumped to version 1.2. Send me mail if you have any information about this. -b. FTS 1.0 Release Notes ===================== New and Changed Features: ------------------------- ALONONPAGED [/size=n] Allocate some nonpaged pool. If no size given, 512 is assumed. A 12-byte system header including allocated size is presumed. DEANONPAGED S0addr [/size=n] Deallocate some nonpaged pool. If no size explicitely given, The size in the system header is used. CRASH [/PID=pid] Crash the system. The /PID qualifier specifies the ID of the process to blame, but is not currently implemented. The command crashes the system by placing a -1 in the PC. HALT Execute a HALT instruction in KRNL mode. Sometimes quicker than reaching back behind the machine for the HALT button. DEPOSIT location value [/PID=pid] Write a value to a location in memory. Runs in kernel mode but does a kmode PROBER/W first. /PID option not implemented, yet. EXAMINE location [/PID=pid] Fetch a value from memory. Fetches from kernel mode but executes a PROBER instruction first. /PID option not implemented, yet. EXIT/QUIT/^Z Leave the FTS utility. FORCEX [pid] [/rcode=x] Forces image exit of a given process with the given status. SS$_NORMAL assumed if /RCODE not specified. HELP Currently prints a simple help message. Needs to be improved. Can't use standard VMS help facility since that would require another file and I want to limit things to FTS.EXE. LOAD JASMON Installs the JASMON code in P1 space and takes over the P1 system service vector. Jasmon resides in P1 space and comtinues to operate across image activations. Use WATCH to monitor service, UNWATCH to stop monitoring them, and UNLOAD JASMON to restore the process to normal. WATCH SS service Intercepts calls to a particular system service. For example, "WATCH SS TRNLNM" monitors logical name translation. WATCH SS QIO[W] device [/STYLE=NULL|DEFAULT|TGV|UCX] Intercepts $QIO[W]s to a particular device (ie. DK: or INET:). The /STYLE switch controls the formatting of P1 though P6. WATCH RMS service Intercepts calls to a particular RMS service. For example, "WATCH SS OPEN" monitors RMS file opens. UNWATCH SS service Disable monitoring of a system service and restore P1 dispatch vector. UNWATCH RMS service Disable monitoring of an RMS service and restore P1 dispatch vector. UNLOAD JASMON Uninstalls the JASMON code from P1 space and restores the P1 system service vector to it's previous state. Currently supported system services: ASSIGN,CANCEL,CANEXH,CANTIM,CANWAK,CHKPRO,CRETVA,DASSGN,DEQ, ENQ,ENQW,GETLKI,GETLKIW,LKWSET?,QIO,QIOW,SETIME,SETPRT,TRNLNM Currently supported RMS services: CLOSE,CONNECT,CREATE,DELETE,FLUSH,GET,OPEN,PUT LOAD XDT Install XDelta and invoke it. Works even if system was not booted with XDelta. Caution: XDelta will cause LAVC nodes to crash with CLUEXIT run for more than 20 seconds. You can use the EXAMINE and DEPOSIT commands to modify memory in a cluster. NOOP Does nothing. Doesn't even execute a NOOP command. SET PAGE addr [size] /PROTECTION=prot {[/PID] [/REFCOUNT]} Modify a memory page in some way. /PROT sets the page protection bits in the PTE to the value specified by the given string (eg. "URKW"). /PID and /REFCOUNT not yet implemented. Size only used for process pages. SHOW DEFAULT [pid] Print the Default Directory string for the given process SHOW ERROR hex_code Print the text of an error signal. SHOW ETHER List protocols assigned to the EtherNet card. Not Yet Implemented. SPAWN [command-line] Spawn a CLI process and optionall execute a command. Currently broken, but not interesting enough to fix. VERSION Display information about this FTS version, including authors. WAKE [pid] Wakes up a given process. WATCH DEVICE device [/FDT] [/START] [/ALTSTART] [/CANCEL] [/IOPOST] Monitors the given device by patching it's DDT. Interactive utility; type any key to exit. /FDT prints calls passing through the Function Decision Table. /START intercepts the device's StartIO routine. /ALTSTART intercepts the device's alternate StartIO routine. /CANCEL monitors device request cancellations. /IOPOST plugs the IOC$IOPOST interrupt vector and watches it for completion of requests for this device. Take care in monitoring disk and terminal devices with this comand. Unresolved Problems: -------------------- If we are monitoring the device we are sending the monitor data to, we get feed back and blow up. When doing WATCH DEV , things can get "screwed up". JASMON doesn't monitor SS calls from kernel mode. I don't trust WATCH DEV /CANCEL. Wish List: ---------- A cancel command which can remove channels from other processes. Write a generic message queueing/printing system and use it for both JASMON and DEVWATCH. Write a better SHOW PAGE command (ie. one that doesn't crash the VAX) Write a command to control the locking/unlocking of pages -b.