- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: System Service Interception on OpenVMS
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2012 09:33 AM
05-21-2012 09:33 AM
System Service Interception on OpenVMS
Hi,
Does anyone know if DEC/Compaq/HP produced any documentation about the System Service Interception API on OpenVMS Alpha?
If so, where or how I can get a copy of the document(s)?
Thanks
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2012 04:02 PM
05-21-2012 04:02 PM
Re: System Service Interception on OpenVMS
I'm sure that John Gillings will give you the details but conceptually it's pretty simple - just provide a new function with the same name as the system service function, and within that new function do a LIB$FIND_IMAGE_SYMBOL to activate the image and locate the sys service function, then call it.
In your own function you can add whatever diagnostics or monitoring that you want to add. Also you can step into your own function from the debugger and get full access whereas with the system service images it's not so easy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2012 08:46 PM - edited 05-21-2012 08:49 PM
05-21-2012 08:46 PM - edited 05-21-2012 08:49 PM
Re: System Service Interception on OpenVMS
Hmm,
What problem are you trying to solve, or just curios?
Ever heard about Google? Wonderful invention! Try it some day?!
it leads me to: http://h71000.www7.hp.com/openvms/journal/v8/ssi.pdf
Of course it helps knowing that that existed, having talked to Ruth about it :-)
And what about $ HELP SET PROC /SSLOG and $ HELP **bleep**/SSLOG.
[edit: stupid computers (programmers).... I'll let you analyze as to why it bleeb my perfectly honorable reply ]
Now if you experiemnt with that, I recommend to SPAWN first, then try.
When I last used it it was not entirely stable.
I also received the following text and code from Harmut B, some 5 years ago.
See below.
Hope this helps,
Hein.
----------------------- Hartmut --------------------------------------------------------
If you want to use just ssi$declare_intercept.
I append a small example, which I tested on I64/V8.3-1H1.
The SSI_BLOCK is filled like
static SSI_BLOCK ssi_block = {
0, 0,
SSI$C_LENGTH, DYN$C_MISC, DYN$C_SSI_BLOCK,
SSI$K_VERSION_QUAD_LIST, 0,
pre, post};
So you will get into your pre() and post() for all system services, once you successfully called the declare routine.
To do processing just for one system service, you need to check against its declared address, as in starlet.h or for example with a "extern int sys$asctim();". Once in your pre() or post() this system service address is in ps_ssadr.
You can make the call to ssi$declare_intercept from your main image. If you don't have control over main, you can place the call in an init routine in a shareable image and let it call during the image initialization via the lib$initialize mechanism.
On Alpha, if your shareable image is not activated with main, that is SYS$SSISHR is not activated with main, then you can't intercept system service calls from main (and all the shareable images it depends on).
Yes, you should be able to do the same with replacing a few system services. You should also be able to use a single generic replacement routine. There you check the passed ps_ssadr against you list and call the original system service as passed in ss_ssadr. I didn't try that, so far, and therefore don't have an example.
You just link against the SYS$SSISHR, that's all.
That's my understanding, it may be incomplete or not 100% correct, but I hope it helps to get you started or even going.
#include <pdscdef.h> #include <ssdef.h> #include <ssidef.h> #include <starlet.h> #include <stdio.h> #include <dyndef.h> #include <descrip.h> static char timbuf[32] ; static $DESCRIPTOR (timbuf_d, timbuf) ; static short int timlen ; static int preasctim; static int postss; static void pre(int *arg_list, int (*ss_ssadr)(), SSI_PDSC *ps_ssadr, int retadr, SSI_BLOCK *ssi_block_ptr) { if ((int(*)())ps_ssadr==sys$asctim) preasctim++;} static void post() {postss++;} static SSI_BLOCK ssi_block = { 0, 0, SSI$C_LENGTH, DYN$C_MISC, DYN$C_SSI_BLOCK, SSI$K_VERSION_QUAD_LIST, 0, pre, post}; main() { int status; printf ("preasctim: %d, postss: %d\n", preasctim, postss); status= ssi$declare_intercept (&ssi_block); if (status!=SS$_NORMAL) printf ("status: 0x%x\n", status); else { printf ("hello ssi\n"); sys$asctim (&timlen,&timbuf_d,0,0); printf ("time: %.*s\n", timlen, timbuf) ; fsync (fileno (stdout)); printf ("preasctim: %d, postss: %d\n", preasctim, postss); } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2012 10:43 AM
05-22-2012 10:43 AM
Re: System Service Interception on OpenVMS
Thanks for the responses.
I am experimenting with SSI in order to capture the system calls issued by an old application.
I had already found using Google the journals on the subject written by John Gillings and Ruth Goldenberg. Though they are extremely interesting, they did not provide enough practical information since I am not an OpenVMS internals guru.
Ruth did mention at the end of her journal "For information on the use of SSI, please check HP OpenVMS System Documentation home page for forthcoming documentation", but I have not yet been successful in finding this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2012 02:42 PM
05-22-2012 02:42 PM
Re: System Service Interception on OpenVMS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2012 02:43 PM
05-24-2012 02:43 PM
Re: System Service Interception on OpenVMS
I've been able to intercept system services using ssi$declare_interrupt.
On Alpha V8.3, I was only able to get the intercepts to work with RUN/DEBUG (something to do with getting SYS$SSISHR activated).
A few things to look out for. You need to be very careful of recursion. Anything that directly or indirectly invokes a system service from inside the pre or post routine could put you into a recursion loop. You can use a simple static flag in both pre and post routines so they only act on first level calls.
pre(args...) static busy if not busy then busy=true do stuff here... busy=false endif end
I was able to do I/O from the protected code. Counters showed thousands of other invokations even for trivially simple programs (there appears to be some kind of polling from DEBUG)
You can detect specific system services by looking at the PDSC address and comparing with the global symbol (as shown in Hein/Hartmut's the C example). However, I couldn't find a simple way to identify an arbitrary incoming service call. There are obvious brute force mechanisms, but for the huge volume of calls you're likely to get, the lookup needs to be fast.
I was trying to create a generic routine to dump the name and argument list of all system services called. The simplest mechanism I can think of is to dump name/PDSC pairs, based on a shareable image /NAMES list from SYS$PUBLIC_VECTORS, then dump the PDSC of each call, along with the argument list, then post process the listings to resolve the addresses into names.
Use SSI$DECLARE_REPACEMENT PDSC_Of_Target,YourRoutine
to substitute routines (but beware, this is non-trivial!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2012 03:29 PM
05-24-2012 03:29 PM
Re: System Service Interception on OpenVMS
>>> On Alpha V8.3, I was only able to get the intercepts to work with RUN/DEBUG (something to do with getting SYS$SSISHR activated).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2012 07:18 PM
05-24-2012 07:18 PM
Re: System Service Interception on OpenVMS
No errors, status is normal, just no execution of the pre and post routines. Example:
$ run/nodebug ssi ELAPSED: 0 00:00:00.00 CPU: 0:00:00.00 BUFIO: 0 DIRIO: 0 FAULTS: 0 Declare: 00000001 Pre: In 00000000 Act 00000000 Post Out 00000000 act 00000000 $ run/debug ssi OpenVMS Alpha Debug64 Version V8.3-016 %DEBUG-I-INITIAL, Language: AMACRO, Module: SYS$MISCDEF DBG> go SSI_PRE 25-MAY-2012 11:53:39.35 SS: 820EBC60 PDSC: 001A08C0 From: 810CC14C Args: 7 00000000 00000080 00000000 00000000 00000000 00000000 00000000 SSI_PRE 25-MAY-2012 11:53:39.35 SS: 82101290 PDSC: 0019F540 From: 810CC184 Args: 1 00000000 SSI_PRE 25-MAY-2012 11:53:39.35 SS: 820EBC60 PDSC: 001A08C0 From: 810CC14C Args: 7 00000000 00000080 00000000 00000000 00000000 00000000 00000000 SSI_PRE 25-MAY-2012 11:53:39.35 SS: 82101290 PDSC: 0019F540 From: 810CC184 Args: 1 00000000 SSI_PRE 25-MAY-2012 11:53:39.35 SS: 82100EF0 PDSC: 0019F420 From: 810CBBD4 Args: 11 00000000 7AD639C0 00000000 7AD639B8 00000000 7AD639B8 00000000 7AD639E8 00000000 00000000 00000000 SSI_PRE 25-MAY-2012 11:53:39.35 SS: 82131AB0 PDSC: 001A0110 From: 810C20C4 Args: 1 00000000 ELAPSED: 0 00:00:00.00 CPU: 0:00:00.00 BUFIO: 2 DIRIO: 0 FAULTS: 0 Declare: 00000001 Pre: In 00000033 Act 00000006 Post Out 00000033 act 00000006 %DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion' DBG>
Here are the routines (hopefully my macros are self evident)
Main routine .ENTRY Start,^M<> CALL SSI_START MOVL R0,DeclareStat CALL LIB$INIT_TIMER CALL LIB$SHOW_TIMER CALL SSI_STOP MessageOut <<Declare: !XL Pre: In !XL Act !XL Post Out !XL act !XL> #DeclareStat #In #ActIn #Out #ActOut> RET PRE routine .ENTRY SSI_PRE,^M<R2,R3> arglist args ssadr dsc retadr blk INCL In BLBS Recur,PRESkip MOVL #1,Recur INCL ActIn CALL FormatArgs AllArgs @args_arg(AP) MessageOut <<SSI_PRE !%D SS: !XL PDSC: !XL From: !XL Args: !3UL !AS> - ##0 #ssadr_arg(AP) #dsc_arg(AP) #retadr_arg(AP) #@args_arg(AP) AllArgs> CLRL Recur PRESkip: RET
This obviously has something to do with activation of SYS$SSISHR, but I don't understand the mechanism. I'd guess that most of the time this would be a diagnostic tool, so running under DEBUG would be fairly normal.
Not sure what XPD is, here's what IMAGETREE has to say about the image
$ @imagetree []ssi.exe SSI, executable V1 RWD,RWD,R, SYS$SSISHR, shareable(%X'01',%X'0003E8',MATEQU) X-20 build:XBCA-0080070058 RWED,RWED,RE,RE Installed Open Hdr Shared Prot Lnkbl SYS$BASE_IMAGE, shareable(%X'56',%X'703EFE',MATEQU) ALPHA XBCA-N2O build:XBCA-0080070099 RWED,RWED,RE,RE SYS$SSISHR references 1 image LIBRTL, shareable(%X'01',%X'000001',MATLEQ) X01-001 build:XBCA-0080070005 RWED,RWED,RE,RE Installed Open Hdr SharAddr Lnkbl Resid SYS$PUBLIC_VECTORS, shareable(%X'13',%X'0064E6',MATEQU) X-123 build:XBCA-0080070058 RWED,RWED,RE,RE Installed LIBRTL references 1 image LIBOTS, shareable(%X'01',%X'000003',MATLEQ) LIBOTS V1.5-00 build:XBC4-0080060000 RWED,RWED,RE,RE Installed Open Hdr SharAddr Lnkbl Resid SYS$PUBLIC_VECTORS (repeat) LIBOTS references 1 image SSI references 3 images
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2012 03:54 AM
05-25-2012 03:54 AM
Re: System Service Interception on OpenVMS
XPD is part of the VMS Objects and Image Tool set. For an image, it lists external procedures and data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2012 08:43 AM
05-28-2012 08:43 AM
Re: System Service Interception on OpenVMS
I have created a shareable executable linked with SYS$SSISHR, and have managed to intercept system services such as SYS$ASCTIM issued from COBOL, but I have found that the RMS system services such as SYS$CONNECT and SYS$RMS_CONNECT are not being intercepted.
Is it not possible to intercept the RMS system services?
By the way, I am currently restricted and struggling with an Alpha running V7.3-2.