From: SMTP%"ALPHA-IDS@WKUVX1.WKU.EDU" 25-JUN-1995 18:36:39.23 To: EVERHART CC: Subj: RE: Locating addresses in system space X-ListName: OpenVMS AXP (Alpha) Internals Warnings-To: <> Errors-To: owner-alpha-ids@WKUVX1.WKU.EDU Sender: owner-alpha-ids@WKUVX1.WKU.EDU Date: Tue, 20 Jun 1995 14:34:23 EST From: "Brian Schenkenberger, VAXman-" Reply-To: ALPHA-IDS@WKUVX1.WKU.EDU To: ALPHA-IDS@WKUVX1.WKU.EDU Message-ID: <009922A3.66D9E520.5@AdvSysCon.COM> Subject: RE: Locating addresses in system space In message <9506201552.AA07905@esds01.es.dupont.com>, "Martin Pensak, CR&D-SCD-Operations, 302-695-1853, E320/123" writes: >I need a little advice about finding addresses in system space on Alpha. > >We have a DCL procedure which accumulates various information >about system load, and records it, and makes it easy for users to display >the most recent info. It started life as an aid to cluster load-balancing >before LAT was capable of such, but the data is still handy. > >On VAX/VMS, it retrieves information by using the $ EXAMINE command, >for example, > $ SYS$GW_IJOBCNT = %X800044C0 > $ examine/word/decimal SYS$GW_IJOBCNT >and appropriately parsing the output. >Similar tricks are done to get the idle CPU time. > >So now I have an Alpha. Reading SYS$BASE_IMAGE.MAP, it says > 0000C910 RU-SYS$GL_IJOBCNT >Well, clearly, 0000C910 is not what I'm looking for. > >Using SDA on a running system > SDA> eval sys$gl_ijobcnt > Hex = 80804B10 Decimal = -2139075824 SYS$GL_IJOBCNT > SDA> show exec > SYS$BASE_IMAGE 80810310 > Nonpaged read only 80002000 8000C400 0000A400 > Nonpaged read/write 80804200 8081F200 0001B000 > >Hmmmm. 80804200 + 0910 = 80804b10, so we're getting closer, but: >(1) what happened to the "c000" part of %xc910 >(2) the base of nonpaged read/write (80804200) is different on every system, >how can it be determined without doing an SDA command ? >E.g. what data cell am I looking for, hopefully at a fixed address, >which will point me to the start of the right area to which to apply the >(constant) offset ? The symbols you are looking for in system space are resolved in a different fashion on the Alpha; there is no absolute system address for these cells. These locations are resolved much like those in a shareable image vector. To locate the location in system space for SYS$GL_IJOBCNT, you'll need to know its symbol value which can be found using the image analyzer. 7) Double Valued Global Symbol/Version Mask Specification (EGSD$C_SYMM) data type: DSC$K_DTYPE_Z (0) symbol flags: (0) EGSY$V_WEAK 0 (1) EGSY$V_DEF 1 (2) EGSY$V_UNI 1 (3) EGSY$V_REL 1 (4) EGSY$V_COMM 0 (5) EGSY$V_VECEP 0 (6) EGSY$V_NORM 0 psect: 0 value: 32848 (%X'00008050') version mask value: 8192 (%X'00002000') symbol: "SYS$GL_IJOBCNT" Then, in SDA, you can find the address of this cell in system space by applying this value to the address of the base image symbol vector. SDA> EXAM EXE$GL_SYS_SYMVEC EXE$GL_SYS_SYMVEC: 00000000 80810310 "........" SDA> EXAM @EXE$GL_SYS_SYMVEC+8050 SYS$BASE_IMAGE_NPRW+14160: 00000000 00000000 "........" SDA> EXAM @EXE$GL_SYS_SYMVEC+8050+8 SYS$BASE_IMAGE_NPRW+14168: FFFFFFFF 80804B10 ".K......" SDA> EVAL SYS$GL_IJOBCNT Hex = 80804B10 Decimal = -2139075824 SYS$GL_IJOBCNT If the symbol were a system routine, you would have a system address in the first quadword as well. The first quadword would be the code address and the second would be the procedure value (PDSC). For example: 9) Double Valued Global Symbol/Version Mask Specification (EGSD$C_SYMM) data type: DSC$K_DTYPE_Z (0) symbol flags: (0) EGSY$V_WEAK 0 (1) EGSY$V_DEF 1 (2) EGSY$V_UNI 1 (3) EGSY$V_REL 1 (4) EGSY$V_COMM 0 (5) EGSY$V_VECEP 0 (6) EGSY$V_NORM 1 psect: 0 value: 10848 (%X'00002A60') version mask value: 16 (%X'00000010') symbol: "EXE$CVT_EPID_TO_IPID" SDA> EXAM EXE$GL_SYS_SYMVEC EXE$GL_SYS_SYMVEC: 00000000 80810310 "........" SDA> EXAM @EXE$GL_SYS_SYMVEC+2A60 SYS$BASE_IMAGE_NPRW+0EB70: FFFFFFFF 8007B3F0 "Z3......" SDA> EXAM @EXE$GL_SYS_SYMVEC+2A60+8 SYS$BASE_IMAGE_NPRW+0EB78: FFFFFFFF 80839570 "p......." SDA> EVAL/SYM 8007B3F0 Hex = 8007B3F0 Decimal = -2146978832 EXE$CVT_EPID_TO_IPID_C SDA> EVAL/SYM 80839570 Hex = 80839570 Decimal = -2138860176 EXE$CVT_EPID_TO_IPID >I realize all this is highly unsupported. >It is also not terribly critical; >but it would be nice, and I think I'm going to learn something from it. >Clearly, internals is not my area of expertise. >Thanks. I can explain how to locate these symbols but I don't think this is the sort of thing you'd want to do entirely within DCL. You might consider writing a program which can get the symbol values and then move them into DCL symbols which you can reference in your DCL procedure. ------- VAXman-