<<< VAXAXP::NOTES$:[NOTES$LIBRARY]VMSNOTES.NOTE;1 >>> -< VAX and Alpha VMS - Digital Internal Use Only >- ================================================================================ Note 514.0 Activating foreign images 2 replies HDLITE::SCHAFER "Mark Schafer, Alpha Developer's su" 94 lines 12-MAR-1996 09:59 -------------------------------------------------------------------------------- We assist ISVs that develop software applications on Alpha. After reading this request, I wonder if HACKERS will love this one. But we do want to fish for a supported solution on both VAX and Alpha, so please reply if you have any ideas. Mark Schafer Software Partner Engineering -------------------------------------------------------------------------- Company: Channel Islands Software, Inc. I really tried *not* to write this, but after 3 weeks of beating my head against a wall.... I know the request is a gray area. I even tried posting to the Internals newsgroup on the Internet, but no help. The information I am asking for in this e-mail is required for me to complete the port to Alpha of my product. A little background: My product is DFP, the DCL to Fortran Precompiler. One of the features of the VAX version is the ability of the completed Fortran program to activate images in P0 space where the Fortran program also resides. This is done using $IMGACT and associated items and by linking the completed Fortran executable with a base address higher than the size of the largest program to be activated. On the Alpha, I must use CLUSTER and COLLECT for each psect (when linking). This is no problem, and I have most of it working. There are a few shortcomings, and not *all* programs will activate in this manner, but my customers are very happy anyway. The completed (generated) Fortran program must allow for activating of all images, and I have everything working for the Alpha version but activation of FOREIGN images. On the VAX, I used a routine that was given to me by a colleague. This routine places the foreign data in the area where LIB$GET_FOREIGN can access it. It also replaces the internal stuff necessary (pointers, flags) to tell LIB$GET_FOREIGN that there is, indeed, foreign data. It works without fail, however I question the accuracy of the method used to point to the various components. I have a feeling that some of the (system) symbols used were chosen more for their value than actual symbol name. I also feel that, while it works, it was not really done correctly. Well, needless to say, it does not work on the Alpha. The symbols used for pointers and offsets are just wrong. I have found most of the correct stuff in P1 space, but have not figured out all of the symbols for offsets. I also have a problem under a specific circumstance. Anyway, is it possible to get instructions (or, even better, an example) on how to write a PUT_FOREIGN routine? I do have the VMS source, but tracing it without help is a disaster. This falls into the area of parsing DCL, which is not possible for a mere mortal to follow in the source listings. My product, obviously parses DCL, but I completely re-invented the parser. At the time I did not have the source, and I'm glad I didn't as I might have been tempted to look at how it was done by Digital.... this would have, for sure, discouraged me. As it turns out, my parsing method appears to be very similar, and because of this *does* support the undocumented syntax that DCL so nicely accepts. What I have discovered by tedious and persistent looking at P1 space: CTL$AG_CLIDATA points to the start of the CLI data area. PPD$L_PRC is the offset to the PRC base. PRC_L_BASEWRK is the offset for the work area WRK_B_VERBTYP is the offset for the verb type - FF is the type for foreign. WRK_L_EXPANDPTR holds the address of the end (+1) of the command buffer i.e. end of foreign data - a hex 00 is placed here. 7FF9C951 is the address of offset from the beginning of the command buffer for the beginning of the foreign data area. 7FF9C950 is the address of the length of the foreign data 7FF9C961 is the address of the length of the whole command (required by LIB$GET_FOREIGN). Placing the data in these addresses requires CMEXEC and I handle that by calling a User Written System Service. By hardcoding these addresses (which I *do not* want to do), will allow me to accomplish activating an image that requests foreign data. There is one little problem, however. While this would not normally be done, activating the controlling Fortran program by entering the command RUN PROGRAM /NODEBUG (i.e. using a qualifier), changes everything, and LIB$GET_FOREIGN no longer looks in (some of) the same places, so the data retrieved is not what it should be. Can I get some help here? I really need symbol names and what I am missing that throws everything off when a qualifier is used when running the controlling program. Thank you, Frank Noell ================== RFC 822 Headers ==================