B From:	MERC::"uunet!WKUVX1.BITNET!MacroMan" 18-MAR-1993 19:03:42.41! To:	TGV.COM!MACRO32@WKUVX1.BITNET  CC:	
 Subj:	FTS 1.2       B 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 youA can add a /STYLE flag to the WATCH DEVICE command.  For instance:   2 WHATNO$ FTS WATCH DEV DKA0: /fdt/iopost /style=F11C 13:49:42.42 IOPOST: pid 1002f IRP 81637c00, IOSB (2000001,7ffe0000) C 13:49:42.42 IOPOST: pid 1002f IRP 8164ea00, IOSB (2000001,7ffe0000) C 13:49:42.42 IOPOST: pid 1002f IRP 81685a40, IOSB (8000001,7fe30000) C 13:49:42.42 IOPOST: pid 1002f IRP 8164cd80, IOSB (4000001,7fe30000) D 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) F 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)F 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) F 13:49:42.51 FDT: pid 1002f IRP 816427c0 UCB 8111b0f8 Func 34(DEACCESS)         (0,0,0,0,0,0) =>    1 D 13:49:44.40 IOPOST: pid 1002f IRP 81650e00, IOSB (61616161,61616161)F 13:49:44.43 FDT: pid 1002f IRP 81650e00 UCB 8111b0f8 Func 34(DEACCESS)         (0,0,0,0,0,0) =>  26c 6 13:49:44.49 IOPOST: pid 1002f IRP 8164ea00, IOSB (1,0)F 13:49:44.53 FDT: pid 1002f IRP 8164ea00 UCB 8111b0f8 Func 34(DEACCESS)         (0,0,0,0,0,0) =>    1     E Right now the F11 style only prints the FID and DID on certain calls, D 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 bgF DEVICE BG: ddb=816346c0, ddt=8168c164, ucb=81649fc0, template=81649fc0 FDT size = 148 bytesO FDT legal functions:     RELEASE WRITEPBLK READPBLK SETCHAR SENSECHAR WRITELBLK P READLBLK SETMODE SENSEMODE WRITEOF WRITEVBLK READVBLK ACCESS DEACCESS READPROMPT  ACPCONTROL  FDT buffered functions:  ACCESS O FDT 8168c546 =  WRITEPBLK READPBLK SETCHAR SENSECHAR WRITELBLK READLBLK SETMODE B 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: 	 --------- A The Functional Testing Suite (FTS) is a do-everything utility for E monitoring and controlling a VMS system.  The philosophy here is that B everytime I want to do something under VMS, and there's no commandD to do it, I'll write it myself and add it to FTS.  It started out asB a monitor for images which I didn't have source code for (like UCX8 applications) and grew into a sort of grab-bag of hacks.  G FTS is generally distributed in VMS_SHARE format.  To unpack the source C code, execute (via DCL) the distribution file (eg. $ @FTS012.SHAR). @ To build the FTS executable, us the command "$ @MAKE".  The onlyF file required to actually use FTS is FTS.EXE which should be installedE 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.B The currently supported help system is the source code, especially the file FTS_PARSE.CLD.   E I have compiled FTS 1.2 under VMS versions V5.1-1, V5.5-2, and FT6.0.  (Without problems)  I WARNING!!!  FTS is an rather brutish program which may very well do nasty E things to your system, least of all crash it.  Don't use this program G 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:
 ----------H         A cancel command which can remove channels from other processes.  G         Write a generic message queueing/printing system and use it for !         both JASMON and DEVWATCH.   M         Write a better SHOW PAGE command (ie. one that doesn't crash the VAX)   A         Write a command to control the locking/unlocking of pages        FTS 1.2 Release Notes  =====================   I In 1.2, a lot of code has been converted to C.  This was done because the G mind-boggling attention to detail required for managing stack variables 5 and registers in non-kernel code was driving me nuts.   C The is now a SHOW DEVICE command which will display a device's FDT. 6 I'm open to suggestions about other things to display.  > The WATCH DEVICE command will now accept the /STYLE qualifier.E Currently accepted styles are: DEFAULT, NULL, TGV, UCX, PSI, and F11. A The TGV style is good for watching TGV's INET: device.  UCX style A works for Digital's BG: device.  PSI doesn't do much of anything. . F11 is intended for watching Files-11 devices.  K 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.  B Fixed problem where DEVWATCH would try to modify an instruction in@ IOC$IOPOST that could straddle a page boundary.  Changed code toC unprotect *both* pages before modifying them.  Boy, is my face red.   C Added code to handle the fact that the IOC$IOPOST interrupt handler 3 changed slightly in a recent version of VMS (5.5?).   6 Added an improved MAKE.COM procedure for building FTS.  6 Made a whole lot of minor fixes that I can't remember.     Unresolved Problems: --------------------B         If we are monitoring the device we are sending the monitor.         data to, we get feed back and blow up.  9         JASMON doesn't monitor SS calls from kernel mode.    -b.      FTS 1.1 Release Notes  =====================   F I have no idea what happened to FTS 1.1 or even if there ever was one.B 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] G         Allocate some nonpaged pool.  If no size given, 512 is assumed. E         A 12-byte system header including allocated size is presumed.  DEANONPAGED S0addr [/size=n]E         Deallocate some nonpaged pool.  If no size explicitely given, .         The size in the system header is used.   CRASH [/PID=pid]E         Crash the system.  The /PID qualifier specifies the ID of the H         process to blame, but is not currently implemented.  The command5         crashes the system by placing a -1 in the PC.  HALTC         Execute a HALT instruction in KRNL mode.  Sometimes quicker B         than reaching back behind the machine for the HALT button.  ! DEPOSIT location value [/PID=pid] G         Write a value to a location in memory.  Runs in kernel mode but G         does a kmode PROBER/W first.  /PID option not implemented, yet.  EXAMINE location [/PID=pid] I         Fetch a value from memory.  Fetches from kernel mode but executes F         a PROBER instruction first.  /PID option not implemented, yet.   EXIT/QUIT/^Z         Leave the FTS utility.   FORCEX [pid] [/rcode=x]3C         Forces image exit of a given process with the given status. 3         SS$_NORMAL assumed if /RCODE not specified.t   HELPF         Currently prints a simple help message.  Needs to be improved.E         Can't use standard VMS help facility since that would require ;         another file and I want to limit things to FTS.EXE.l   LOAD JASMONk?         Installs the JASMON code in P1 space and takes over thesK         P1 system service vector.  Jasmon resides in P1 space and comtinues'B         to operate across image activations.  Use WATCH to monitorC         service, UNWATCH to stop monitoring them, and UNLOAD JASMONe)         to restore the process to normal.n WATCH SS service8         Intercepts calls to a particular system service.I         For example, "WATCH SS TRNLNM" monitors logical name translation.n4 WATCH SS QIO[W] device [/STYLE=NULL|DEFAULT|TGV|UCX]G         Intercepts $QIO[W]s to a  particular device (ie. DK: or INET:).0B         The /STYLE switch controls the formatting of P1 though P6. WATCH RMS service 5         Intercepts calls to a particular RMS service. =         For example, "WATCH SS OPEN" monitors RMS file opens.3 UNWATCH SS serviceN         Disable monitoring of a system service and restore P1 dispatch vector. UNWATCH RMS service L         Disable monitoring of an RMS service and restore P1 dispatch vector.
 UNLOAD JASMON1A         Uninstalls the JASMON code from P1 space and restores the 8         P1 system service vector to it's previous state.$ Currently supported system services:D         ASSIGN,CANCEL,CANEXH,CANTIM,CANWAK,CHKPRO,CRETVA,DASSGN,DEQ,E         ENQ,ENQW,GETLKI,GETLKIW,LKWSET?,QIO,QIOW,SETIME,SETPRT,TRNLNM ! Currently supported RMS services:66         CLOSE,CONNECT,CREATE,DELETE,FLUSH,GET,OPEN,PUT   LOAD XDTC         Install XDelta and invoke it.  Works even if system was not)B         booted with XDelta.  Caution: XDelta will cause LAVC nodesD         to crash with CLUEXIT run for more than 20 seconds.  You canK         use the EXAMINE and DEPOSIT commands to modify memory in a cluster.F   NOOP;         Does nothing.  Doesn't even execute a NOOP command.1  : 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 yet7         implemented.  Size only used for process pages.    SHOW DEFAULT [pid]@         Print the Default Directory string for the given process SHOW ERROR hex_codeE*         Print the text of an error signal.
 SHOW ETHERK         List protocols assigned to the EtherNet card.  Not Yet Implemented.S   SPAWN [command-line]<         Spawn a CLI process and optionall execute a command.<         Currently broken, but not interesting enough to fix.   VERSION F         Display information about this FTS version, including authors.  
 WAKE [pid]!         Wakes up a given process.1  C WATCH DEVICE device [/FDT] [/START] [/ALTSTART] [/CANCEL] [/IOPOST]ED         Monitors the given device by patching it's DDT.  Interactive&         utility; type any key to exit.F         /FDT prints calls passing through the Function Decision Table.7         /START intercepts the device's StartIO routine.iD         /ALTSTART intercepts the device's alternate StartIO routine.6         /CANCEL monitors device request cancellations.D         /IOPOST plugs the IOC$IOPOST interrupt vector and watches it;                 for completion of requests for this device. K         Take care in monitoring disk and terminal devices with this comand.o   Unresolved Problems: --------------------B         If we are monitoring the device we are sending the monitor.         data to, we get feed back and blow up.  A         When doing WATCH DEV <disk>, things can get "screwed up".o  9         JASMON doesn't monitor SS calls from kernel mode.   (         I don't trust WATCH DEV /CANCEL.  
 Wish List:
 ----------H         A cancel command which can remove channels from other processes.  G         Write a generic message queueing/printing system and use it fors!         both JASMON and DEVWATCH.S  M         Write a better SHOW PAGE command (ie. one that doesn't crash the VAX)6  A         Write a command to control the locking/unlocking of pagesr   -b.h  