| No problem, I was just curious to whether one could call any useful DCL
features from a program, so I looked for them, knowing they'd probably use
CHMS. Since I didn't find anything besides a few system services and rtl
routines, none of which seemed to use CHMS, I wondered what CHMS did.
Since it seemed to be undocumented, it was a candidate for playing with (after
all, this is the HACKERS conference), and I was simply curious to whether anyone
else played with this or could do nifty DCL tricks from a program by using an
undocumented call.
-Mike
|
| The CHMS instruction is used for requesting certain services from the command
language interpreter running in supervisor mode. The functions that I know
it can perform for you are defining a supervisor-mode logical name, defining
a DCL symbol, reading a DCL symbol, deleting a supervisor-mode logical name,
deleting a DCL symbol, SPAWN, ATTACH, PAUSE, CHAIN to another program, CHAIN
to a DCL command. For each of these functions, there is a supported,
documented RTL routine, e.g., LIB$SET_LOGICAL, LIB$SET_SYMBOL, LIB$GET_SYMBOL,
LIB$DELETE_LOGICAL, LIB$DELETE_SYMBOL, LIB$SPAWN, LIB$ATTACH, LIB$PAUSE,
LIB$RUN_PROGRAM, LIB$DO_COMMAND.
The internal, undocumented interface to these functions is very baroque and
has been known to change from release to release. It's not worth playing with
it, given that there are documented, supported interfaces to the same functions.
--PSW
|
| re .3:
I previously traced several of those routines, and they all seem to call CHMK
(SYS$foo) rather than CHMS. In fact that's what started my query, I accidently
started tracing one of the LIB$ routines with the debugger (set step into) that
I would have guessed would use a CHMS, yet it did a CHMK instead. I wondered
what CHMS was used for,...
re .4:
I got one of the CHMS calls to return a bunch of stuff, including the prompt.
Don't remember which one it was at the moment. Someday I'll convince someone
to let me look at the sources and find out what the calls do.
-Mike
|
| RE: .5
Last time I looked, they all wind up calling SYS$CLI. This routine in turn
twiddles a bunch of stuff and then does a CHMS with a particular code. I
just stepped all the way through the BLISS statement:
lib$set_symbol(%ASCID'FOO', %ASCID'1', %REF(1))
and under VMS V4.7, at least, it eventually winds up doing a:
CHMS B^01(R9)
instruction at address 7FF1C25B in P1 space.
Note that not all of the SYS$xxx routines wind up invoking CHMK. SYS$OPEN,
SYS$CLOSE, and all the other RMS services, for example, do a CHME. Several
of the system services (most notably SYS$GETMSG, I think) operate mode-of-the-
caller and don't issue a CHMx instruction at all. SYS$CLI does a CHMS.
--PSW
|