Article 4996 of vmsnet.internals: (Apologies if you've seen this before - trouble posting) Dear VMS people, I am a VMS systems programmer with a medium level of experience. I have been given the job of converting a privileged shareable image from VAX to Alpha. I have read chapter 18 of "OpenVMS Programming Concepts Manual", "Creating a User-Written System Service". But I need some help. I have got an Alpha privileged shareable image working in basic form. The 11 longword PLV data structure is fine, but I need to reproduce the features of the VAX privileged shareable image, which are all implemented in the dispatch code of the shareable image, before the actual routine is called. Alpha does not implement dispatch code - the routine is called directly after looking up the table (either exec or kernel mode) pointed to by the PLV. Specifically, each routine has its own privilege requirements. I also don't want to have to check the parameters in each routine. The centralised dispatch code that VAX uses, before my code calls the service routine, seems a better solution to me. I wonder why this wasn't implemented for Alpha ? Can anyone help ? I thought that if the service routines were called with some sort of unique parameter, I could specify a central address for all service routines, and then after I've done the processing I refer to above, I could call the service routine myself based on the value of the parameter (so that I know which routine was called). However, the simple test routine I created (written in Macro) doesn't seem to be passed any parameters (ie. (AP) contains 0). Also, I'm aware of the fact that Alpha performance can be compromised by poor programming style, so can anyone advise if I have made some bad decisions when writing this image ? For example, in the "kernel routine list" pointed to by the PLV, I have used lots of .ADDRESS . Is this bad ? Also, there doesn't seem to be an easy way to call a routine that doesn't need privilege, in user mode. On VAX, instead of issuing CHMK or CHME instructions, for user mode we just do JMP +2. Because, again, we have no dispatch code to execute, how can we execute user mode code in this image ? PSECTS in the final image (according to the map file) seem to be alphabetically ordered. If I want the PLV to appear at the very beginning of the image, do I have to change the name of the PSECT it appears in ? If so, how bizarre ! Finally, the VAX version of this privileged shareable images executes all of its privileged routines in supervisor mode. The rationale behind this was that while privileges are enabled, we need to execute at a mode more inner than user, but preferably as low as possible, so supervisor was chosen as opposed to exec. This was implemented using the old trick on VAX while in exec mode : push a PSL (with supervisor as current mode) and PC on the stack and then issue an REI. This doesn't seem to work on Alpha. Is it possible to execute service routines in supervisor mode on Alpha ? Can I return to exec mode after the service routine to tidy up ? My sample Alpha code is in the next post (I hope it gets in - it's biggish). Also included is the VAX code (which has been in use at our site for some years). Yes I know that Macro is a compiler on Alpha and maybe I should write this in something else. C is not an option here (no license, no experience). Pascal would be the only choice, but we can't even begin to re-write the many service routines that this image will need to have (which, incidentally, are mostly Cobol - yuck !!). I apologise for the long post. I don't have anywhere else I could put my sample code. Craig McGill. Airservices Australia. craig.mcgill@airservices.gov.au