[Info-vax] C History on VMS (was Re: C... the only winning move is not to play...)
JohnF
john at please.see.sig.for.email.com
Thu Feb 13 05:06:56 EST 2014
Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:
> On 2014-02-12 15:34:35 +0000, JohnF said:
Thanks for the "history and discussion" below
(you should maybe write a book, if there isn't already one)...
>> ...I think dcl is what all those str$functions we discussed were really
>> written for. That is, but for digital's desire to provide string
>> manipulation in dcl, they never would have bothered with that
>> str$library. The C headers and stuff were more of an afterthought,
>> i.e., as long as the library's there, might as well let C link it. But
>> all other things equal, when writing C you're better advised to use
>> standard C stuff if possible.
>
> Some history and discssions of general and related structures...
>
> DCL has its own supervisor-mode world; getting stuff compiled and
> linked into that environment is a little odd. (It and the XQP are
> probably two of the weirder parts of VMS, in terms of its general
> run-time environment, and around debugging it.)
>
> FWIW, none of the VMS and none of the (user-mode) language RTLs are
> intended to be callable from any inner-mode code. (There were (are)
> some security-clobbering hacks latent in the RTL calls that allowed
> inner-mode to sort-of kind-of work, for those folks that were inclined
> to open up leaks across the per-mode memory management protections.
> Not recommended.)
>
> I don't have the OpenVMS source listings handy to confirm it, but I'd
> be surprised if there were RTL calls around.
>
> As for the include files, the VMS-provided header files are common
> source. The same SDL source file generates C, BASIC, Fortran and
> others, and ? with the most recent versions of SDL ? also now DCL
> symbolic constants. C was added to this list over time, and
> particularly around the addition of the SYS$STARLET_C and SYS$LIB_C
> libraries into OpenVMS. STARLETSD.TLB was also used by various
> languages.
>
> In terms of the per-language support within OpenVMS, C was effectively
> an afterthought for most of the environments, as the first C compiler
> and VAXCRTL library support only arrived somewhere around V4.4 IIRC.
> That was well after the other languages. C is also somewhat weird on
> OpenVMS in that it now has two libraries; the traditional user-mode
> library that most languages have, and also its own kernel-mode library
> that was implemented as part of the C system programming support that
> arrived around OpenVMS V6.1 IIRC.
>
> The STR$ and LIB$ calls are generally old. Many of the core routines
> are older than V4.4. It wouldn't surprise me to learn that the history
> of this stuff goes back further than VAX-11/VMS too, as here's the
> XPORT library for TOPS
> <http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp10/TOPS10_softwareNotebooks/vol08/AA-J201A-TK_XPORT_Programmers_Guide_Apr81.pdf>
>
> The STR$ and LIB$ calls are useful in Macro, Bliss, Fortran and various
> other languages. (Various Fortran code was is still fond of using
> space-padded fixed-length strings, too.) The OTS$ calls was largely
> for the compilers, but was and is available for other use.
>
> More to make it a little easier for me to find these details for some
> hypothetical next time a discussion of ancient VMS calls and ancient
> run-time libraries (RTLs) arises, there are all sorts of related
> shenanigans around the break-up of the VMSRTL run-time library are in
> play here, too. The ancient VMSRTL omnibus library has a long and
> checkered career:
> <http://archive.org/stream/bitsavers_decvaxvms2ReleaseNotesMar80_3242450/AA-D015C-TE_VMS_2.0_Release_Notes_Mar80_djvu.txt>
> <http://archive.org/stream/bitsavers_decvaxvms3leaseNotesV3.0May82_5458871/AA-D015D-TE_VAX-VMS_Release_Notes_V3.0_May82_djvu.txt>
> <http://www.ibiblio.org/pub/academic/computer-science/history/pdp-11/hardware/micronotes/numerical/micronote36.txt>.
> This VMSRTL stuff was in common use prior to VAX/VMS V4.0, when that
> RTL was broken up into hunks; into separate RTLs. For completeness,
> this was all before C existed on VMS, too.
--
John Forkosh ( mailto: j at f.com where j=john and f=forkosh )
More information about the Info-vax
mailing list