[Info-vax] VAX Macro to C conversion

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Tue Jul 23 18:44:08 EDT 2019


On 2019-07-22 16:27:46 +0000, John Reagan said:

> The kernel-mode CRTL is:
> 
> - A very reduced subset of the CRTL's entry points (no malloc, fopen, 
> getenv, etc)
> - It is in object form and is linked directly into the kernel.
> - Is conditionalized to avoid things like "setting errno", locale 
> support, threading awareness, etc
> - Doesn't allocate memory

Yeah; the kernel C library is a mixed bag, and a subset of C support.  
And it's missing the newer and increasingly-preferred C calls too.  For 
some of the kernel app requirements, OpenVMS provides its own APIs for 
stuff that C code might call into the C library else-platform, 
particularly around networking.  But inner-mode code is only rarely 
portable across operating systems.  What's available with the OpenVMS 
kernel C library and kernel mode more generally will undoubtedly be 
changing, particularly given the increasing requirements of networking 
and encryption and authentication.  Whether the kernel C RTL also 
presents those hypothetical new APIs? For now, the kernel code either 
provides its own calls into VCI (and VCI 2.0, if/when) and other 
services, and/or doesn't implement some related tasks such as DTLS.

> ...to allocate heap memory for string operations.  As mentioned before, 
> you don't want to allocate heap from inner mode.  In the BEST case, 
> you'll end up with a krkw (kernel read/kernel write) page in the middle 
> of your LIB$GET_VM's lookaside lists which will give you a nice ACCVIO 
> if you get that address returned to you in user-mode by a future 
> LIB$GET_VM call.

IIRC from an earlier rummage, the LIBRTL VM services casted at least 
some parts of the allocation requests into user mode.  This instead of 
punting any inner-mode requests with an error.

The whole of the inner-mode programming requirements—outside of device 
drivers and a little on UWSS stuff and ilk—isn't particularly 
documented for customer nor ISV use. It's certainly not very well 
documented.

And before somebody points me at the IDSM TYVM, a whole lot of what 
those books discuss was long considered unsupported and undocumented 
and subject to change without notice.  Prolly still is, too.



-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list