[Info-vax] New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Mon Jun 20 08:59:02 EDT 2022


On 2022-06-17, Jake Hamby <jake.hamby at gmail.com> wrote:
> I'm not quite ready to announce a V1.0 release, but I'm pleased to share my first VMS device driver, not for a physical hardware device, but a replacement for the old LAVDRIVER load average driver written in MACRO. With the recent thread bemoaning the lack of good examples of how to write a device driver in C, I'm happy to add to the collection of open source examples.
>
> I'm in the process of upgrading the GNV packages with various bug fixes, although my branch is definitely not as stable as the release packages. However, there's a bug in coreutils in "uptime", "w", and other programs that show the load average.
>
> The getloadavg.c code in the original coreutils source actually has VMS support (and Eunice too, if you can believe that), but it's buggy: it thinks the values it's reading are doubles and not floats. But there's an even bigger issue: GNU coreutils is compiled with IEEE floating point (as it should be), while the LAVDRIVER returns VAX 32-bit floats.
>
> Long story short, I realized that the LAVDRIVER.EXE that MultiNet provides was likely going to be inefficient if it's still written in VAX assembly, and I can hardly believe they would be using floating-point at all in the kernel. The more I looked at the problem, I realized it wouldn't be advisable, and perhaps not even safe at all, to touch the FP registers. Much better to use and return fixed-point integers, so that's what I did. I rewrote my own LAXDRIVER in C and it seems to work fairly well, at least on Alpha and Itanium (after many crashes and false starts on the Alpha, which is easy to get crash info from).
>
> https://github.com/jhamby/vms-laxdriver
>

First off, thanks for posting this.

> I've put it under an MIT license: it's all my original work, except for the skeleton and some of the function comments that came from the sample LRDRIVER.C in sys$examples that I used as a template (I'm sure VSI won't mind since they put the code there as an example). There's a test app you can compile as test-lav-driver.exe to read from the original VAX FP LAVDRIVER, or with /float=ieee to build as test-lax-driver.exe and read fixed-point with 14-bit scaling factor from my new driver.
>

It may not be that simple. VSI are constrained by what the HPE contract says
and the copyrights on the original source code.

For example, just because the EVE source code is in sys$examples, it doesn't
mean that VSI or a VMS user can just post it on GitHub (for example).

That said, I do hope that you are right.

> I do have one apparent bug in the load average that I'm calculating, and
> without access to any internals docs newer than for V7.0, perhaps some
> changes have been made to the scheduler that I don't understand, so I'd be
> grateful for any insight into what's happening:
>

Have you considered asking Brian to look at your code ? He might have some
insights for you.

$ set response/mode=good_natured

Of course, if Brian says to rewrite it in Macro-32, then feel free to ignore
him. :-)

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list