Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

backups: always in season, never out of style.


computers / comp.os.vms / Re: VMS device drivers

SubjectAuthor
* VMS device driversSimon Clubley
+* Re: VMS device driversDavid Jones
|`- Re: VMS device driversBob Eager
+- Re: VMS device driversSingle Stage to Orbit
+- Re: VMS device driversJohnny Billquist
`* Re: VMS device driversJake Hamby (Solid State Jake)
 `- Re: VMS device driversJake Hamby (Solid State Jake)

1
VMS device drivers

<uecmdq$2f3ll$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30022&group=comp.os.vms#30022

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: VMS device drivers
Date: Tue, 19 Sep 2023 17:40:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <uecmdq$2f3ll$1@dont-email.me>
Injection-Date: Tue, 19 Sep 2023 17:40:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1777fa4bd1bb10ddbd7ad45966865200";
logging-data="2592437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jZF1ctZ8RunhUM0Z3ZJWD5ZAE8b9Qpqk="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:IOGyu/UPoimz1LOFs7rAYg0RvDQ=
 by: Simon Clubley - Tue, 19 Sep 2023 17:40 UTC

On 2023-09-18, Single Stage to Orbit <alex.buell@munted.eu> wrote:
> On Mon, 2023-09-18 at 17:04 +0200, Johnny Billquist wrote:
>> > It should be straightforward to port the existing X11 driver for
>> > Virtualbox or VMware to OpenVMS. The x86 driver already exists for
>> > Linux.
>>
>> Uh? How did you come to the conclusion that some driver from Linux
>> would be straight forward to port to VMS? There aren't exactly much
>> commonality between the internals in Linux and VMS...
>
> The driver model in VMS may be very different to what is expected in
> Linux but the basics of controlling the device itself does't change.
> Likewise for X11.
>

Understanding how a device works is only one part of writing a successful
device driver, especially on VMS.

I wrote a VMS device driver once for VMS about 20 years ago just for fun,
and it was such a painful exercise compared to writing a device driver
for Linux, that I _never_ did it again. :-)

[It was back in the days of analogue TV, and I put a WinTV PCI card into
an AlphaStation and wrote a device driver to pull the teletext data stream
out of the video signal and display teletext pages on a VT emulator.
Like I said above, this was just for fun.]

For one thing, unlike Linux, there is absolutely _no_ kernel module
support in VMS. On VMS, when you need to reload your device driver
while trying to get things to work, you need to reboot your system
_every_ _single_ _time_ you want to load an updated device driver. :-( :-(

Also, unless things have changed in recent years, the only example
device driver provided is LRDRIVER, which doesn't even begin to address
a wide range of more advanced topics. On Linux, if you want to understand
some complex or subtle device driver concept, you can just pick a device
driver that uses this concept and study how that device driver did it.

Oh, and don't even _think_ about trying to write your own filesystem
driver for VMS unless you are willing to purchase the VMS source code kit,
as there's absolutely no public documentation on that.

On Linux however, the VFS infrastructure is beautifully elegant:

https://docs.kernel.org/filesystems/vfs.html

Wish you could do _that_ on VMS.

> Hopefully VSI has documentation on implementing drivers in x86_64 on
> their website, I would definitely take a look.

I doubt it.

When sanity prevailed, and DEC allowed you to write VMS device drivers
in C, it became its own book that you had to purchase. That was for Alpha,
and I never saw anything for Itanium, and IIRC, it's been mentioned that
there will not be a device driver book for x86-64 as well.

Simon.

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

Re: VMS device drivers

<981ec458-d37b-45cd-b16a-10848d0d88edn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30026&group=comp.os.vms#30026

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:7f47:0:b0:40b:2fd7:55a8 with SMTP id g7-20020ac87f47000000b0040b2fd755a8mr6945qtk.8.1695155869487;
Tue, 19 Sep 2023 13:37:49 -0700 (PDT)
X-Received: by 2002:a05:6870:d909:b0:1d6:6bfa:ce18 with SMTP id
gq9-20020a056870d90900b001d66bface18mr1501497oab.3.1695155869288; Tue, 19 Sep
2023 13:37:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Tue, 19 Sep 2023 13:37:48 -0700 (PDT)
In-Reply-To: <uecmdq$2f3ll$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=104.231.150.181; posting-account=CO-_tAoAAACjjs2KLAw3xVKCy6Z_J3VK
NNTP-Posting-Host: 104.231.150.181
References: <uecmdq$2f3ll$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <981ec458-d37b-45cd-b16a-10848d0d88edn@googlegroups.com>
Subject: Re: VMS device drivers
From: osuvma...@gmail.com (David Jones)
Injection-Date: Tue, 19 Sep 2023 20:37:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 12
 by: David Jones - Tue, 19 Sep 2023 20:37 UTC

On Tuesday, September 19, 2023 at 1:40:17 PM UTC-4, Simon Clubley wrote:
> For one thing, unlike Linux, there is absolutely _no_ kernel module
> support in VMS. On VMS, when you need to reload your device driver
> while trying to get things to work, you need to reboot your system
> _every_ _single_ _time_ you want to load an updated device driver. :-( :-(

The early versions of VAX/VMS let you reload drivers, it was quite convenient.

I never tried to write a device driver from scratch, but I have tweaked a couple.

Re: VMS device drivers

<kmuh1uFfs23U1@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30027&group=comp.os.vms#30027

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: news0...@eager.cx (Bob Eager)
Newsgroups: comp.os.vms
Subject: Re: VMS device drivers
Date: 19 Sep 2023 21:10:22 GMT
Lines: 21
Message-ID: <kmuh1uFfs23U1@mid.individual.net>
References: <uecmdq$2f3ll$1@dont-email.me>
<981ec458-d37b-45cd-b16a-10848d0d88edn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Q9XSYdEepZzdOwuNxtq1twjH68NxIy2Tkuy3ZL3smqlqTJz1D8
Cancel-Lock: sha1:/TFguirR98jR0ETyb57rVw2RUE4= sha256:bQyEfK4O7NDs66wUVpL48WXJjDGqzH6+83QvFEQMmUw=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
 by: Bob Eager - Tue, 19 Sep 2023 21:10 UTC

On Tue, 19 Sep 2023 13:37:48 -0700, David Jones wrote:

> On Tuesday, September 19, 2023 at 1:40:17 PM UTC-4, Simon Clubley wrote:
>> For one thing, unlike Linux, there is absolutely _no_ kernel module
>> support in VMS. On VMS, when you need to reload your device driver
>> while trying to get things to work, you need to reboot your system
>> _every_ _single_ _time_ you want to load an updated device driver. :-(
>> :-(
>
> The early versions of VAX/VMS let you reload drivers, it was quite
> convenient.

It very much depended on the driver, as I recall.

> I never tried to write a device driver from scratch, but I have tweaked
> a couple.

I wrote two or three, one being a terminal driver that used a cloned
interface and used our weird network. Another did file transfer and stuff.

What helped me a lot was going on the device driver course!

Re: VMS device drivers

<f93ed5a2a13058793b912d93094b86e3af794095.camel@munted.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30028&group=comp.os.vms#30028

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!palladium.buellnet!not-for-mail
From: alex.bu...@munted.eu (Single Stage to Orbit)
Newsgroups: comp.os.vms
Subject: Re: VMS device drivers
Date: Tue, 19 Sep 2023 22:15:24 +0100
Organization: One very high maintenance cat
Message-ID: <f93ed5a2a13058793b912d93094b86e3af794095.camel@munted.eu>
References: <uecmdq$2f3ll$1@dont-email.me>
Reply-To: alex.buell@munted.eu
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: solani.org;
logging-data="398365"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Evolution 3.48.4
Cancel-Lock: sha1:h0XzqKNJjoODwR4J8q6gNxfrgrE=
X-User-ID: eJwFwYEBwCAIA7CXcIVqz0GE/09YEuBibWfQY2K4o5mlD2dOAQ9xsXWUQNeCMOqRf1luT2lE6rLtgQHaD0Q3FOg=
In-Reply-To: <uecmdq$2f3ll$1@dont-email.me>
 by: Single Stage to Orbi - Tue, 19 Sep 2023 21:15 UTC

On Tue, 2023-09-19 at 17:40 +0000, Simon Clubley wrote:
> On 2023-09-18, Single Stage to Orbit <alex.buell@munted.eu> wrote:
>
>
> Understanding how a device works is only one part of writing a
> successful device driver, especially on VMS.
>
> I wrote a VMS device driver once for VMS about 20 years ago just for
> fun, and it was such a painful exercise compared to writing a device
> driver for Linux, that I _never_ did it again. :-)
>
> [It was back in the days of analogue TV, and I put a WinTV PCI card
> into an AlphaStation and wrote a device driver to pull the teletext
> data stream out of the video signal and display teletext pages on a
> VT emulator. Like I said above, this was just for fun.]
>
> For one thing, unlike Linux, there is absolutely _no_ kernel module
> support in VMS. On VMS, when you need to reload your device driver
> while trying to get things to work, you need to reboot your system
> _every_ _single_ _time_ you want to load an updated device driver. :-
> ( :-(
>
> Also, unless things have changed in recent years, the only example
> device driver provided is LRDRIVER, which doesn't even begin to
> address a wide range of more advanced topics. On Linux, if you want
> to understand some complex or subtle device driver concept, you can
> just pick a device driver that uses this concept and study how that
> device driver did it.
>
> Oh, and don't even _think_ about trying to write your own filesystem
> driver for VMS unless you are willing to purchase the VMS source code
> kit, as there's absolutely no public documentation on that.
>
> On Linux however, the VFS infrastructure is beautifully elegant:
>
> https://docs.kernel.org/filesystems/vfs.html
>
> Wish you could do _that_ on VMS.
>
> > Hopefully VSI has documentation on implementing drivers in x86_64
> > on their website, I would definitely take a look.
>
> I doubt it.
>
> When sanity prevailed, and DEC allowed you to write VMS device
> drivers in C, it became its own book that you had to purchase. That
> was for Alpha, and I never saw anything for Itanium, and IIRC, it's
> been mentioned that there will not be a device driver book for x86-64
> as well.

Thanks for that, that's good to know. Who knows, I might enjoy the
challenge. And anyway, it is much _easier_ nowadays running these
things inside a VM, for development.
--
Tactical Nuclear Kittens

Re: VMS device drivers

<ueemko$frg$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30043&group=comp.os.vms#30043

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.213.180.184.10!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: VMS device drivers
Date: Wed, 20 Sep 2023 13:56:08 +0200
Organization: MGT Consulting
Message-ID: <ueemko$frg$1@news.misty.com>
References: <uecmdq$2f3ll$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 20 Sep 2023 11:56:08 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="213.180.184.10";
logging-data="16240"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <uecmdq$2f3ll$1@dont-email.me>
 by: Johnny Billquist - Wed, 20 Sep 2023 11:56 UTC

On 2023-09-19 19:40, Simon Clubley wrote:
> For one thing, unlike Linux, there is absolutely _no_ kernel module
> support in VMS. On VMS, when you need to reload your device driver
> while trying to get things to work, you need to reboot your system
> _every_ _single_ _time_ you want to load an updated device driver. :-( :-(

Sometimes evolution goes backwards. Writing a device driver for RSX is
well documented, and fairly straight forward. And there are no problems
unloading and loading device drivers on a running system.

That said - it's still not something for people who don't understand a
lot of low level and kernel internal stuff.

Johnny

Re: VMS device drivers

<4468a424-ba83-4828-8639-0842e14dd5d2n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30460&group=comp.os.vms#30460

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:134a:b0:412:2dd3:e0ff with SMTP id w10-20020a05622a134a00b004122dd3e0ffmr299097qtk.1.1696993198034; Tue, 10 Oct 2023 19:59:58 -0700 (PDT)
X-Received: by 2002:a05:6808:2208:b0:3a7:5742:ce92 with SMTP id bd8-20020a056808220800b003a75742ce92mr10504828oib.0.1696993197774; Tue, 10 Oct 2023 19:59:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.18.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Tue, 10 Oct 2023 19:59:57 -0700 (PDT)
In-Reply-To: <uecmdq$2f3ll$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:31aa:2f79:3e99:1405; posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:31aa:2f79:3e99:1405
References: <uecmdq$2f3ll$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4468a424-ba83-4828-8639-0842e14dd5d2n@googlegroups.com>
Subject: Re: VMS device drivers
From: jake.ha...@gmail.com (Jake Hamby (Solid State Jake))
Injection-Date: Wed, 11 Oct 2023 02:59:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 41
 by: Jake Hamby (Solid St - Wed, 11 Oct 2023 02:59 UTC

On Tuesday, September 19, 2023 at 10:40:17 AM UTC-7, Simon Clubley wrote:
>
> I wrote a VMS device driver once for VMS about 20 years ago just for fun,
> and it was such a painful exercise compared to writing a device driver
> for Linux, that I _never_ did it again. :-)
>
> (snip)
>
> Also, unless things have changed in recent years, the only example
> device driver provided is LRDRIVER, which doesn't even begin to address
> a wide range of more advanced topics. On Linux, if you want to understand
> some complex or subtle device driver concept, you can just pick a device
> driver that uses this concept and study how that device driver did it.

As luck would have it, during a burst of hacking on OpenVMS and specifically GNV last year, I found a different device driver example, LAVDRIVER, which computes the system load average so that GNU coreutils programs that call getloadavg() will get useful info to print.

https://github.com/jhamby/vms-laxdriver

I didn't like that it was written in MACRO, and also I realized that I'd need to modify the calling interface to return IEEE FP values instead of VAX FP since that was what I was compiling GNU coreutils with. So I renamed it to LAXDRIVER (LAX0:) and ported the code to C, using LRDRIVER as an example of the C interface. The original LAVDRIVER was on a VMS Freeware CD, and MultiNet happened to install a binary of it. I found a link to my original post announcing my version, in which I was quite excited.

https://groups.google.com/g/comp.os.vms/c/02fLMYKM0TE/m/4iXSMQaHBAAJ

I'm very interested to revisit this code on OpenVMS x86 to see whether it builds and runs, and if it has the same issue with returning a higher load average than it should, like I saw on a dual-CPU Itanium.

Cheers,
Jake

Re: VMS device drivers

<5d8f3c4c-fe1e-4470-a263-37c35b07ff65n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30461&group=comp.os.vms#30461

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:4686:b0:775:76da:672d with SMTP id bq6-20020a05620a468600b0077576da672dmr343781qkb.3.1696994519986;
Tue, 10 Oct 2023 20:21:59 -0700 (PDT)
X-Received: by 2002:a05:6870:c7aa:b0:1dd:92a3:bbbc with SMTP id
dy42-20020a056870c7aa00b001dd92a3bbbcmr6876968oab.2.1696994519795; Tue, 10
Oct 2023 20:21:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Tue, 10 Oct 2023 20:21:59 -0700 (PDT)
In-Reply-To: <4468a424-ba83-4828-8639-0842e14dd5d2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:31aa:2f79:3e99:1405;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:31aa:2f79:3e99:1405
References: <uecmdq$2f3ll$1@dont-email.me> <4468a424-ba83-4828-8639-0842e14dd5d2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5d8f3c4c-fe1e-4470-a263-37c35b07ff65n@googlegroups.com>
Subject: Re: VMS device drivers
From: jake.ha...@gmail.com (Jake Hamby (Solid State Jake))
Injection-Date: Wed, 11 Oct 2023 03:21:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 28
 by: Jake Hamby (Solid St - Wed, 11 Oct 2023 03:21 UTC

On Tuesday, October 10, 2023 at 7:59:59 PM UTC-7, Jake Hamby (Solid State Jake) wrote:

> I didn't like that it was written in MACRO, and also I realized that I'd need to modify the calling interface to return IEEE FP values instead of VAX FP

Correction: I changed my C version of the driver to return 32-bit fixed-point values, not IEEE FP. It's normally not allowed to use the FPU in a device driver running in kernel mode, but I assume that it must have been allowed, since the original LAVDRIVER appears to work on Alpha and Itanium. I believe at least Linux and the BSDs implement the system call as returning fixed-point values and then the libc wrapper converts them to an array of three doubles.

I say the FPU "appears to work" in VMS device drivers because I have no idea if it's reliable or if it only happens to work in this case due to nobody else using the FPU while I was running tests. The reason the FPU is almost never allowed in kernel mode, at least in UNIX derivatives, is that it adds a large additional register bank (esp. with SSE and other SIMD extensions) that has to be saved/restored on thread context switches.

BTW, the GNV coreutils client code to read from the original LAVDRIVER is buggy because there's a mismatch of expectations between "float" and "double". It's interesting that nobody has really inspected some of this 1990s-era VMS code enough to notice when it isn't actually working.

Cheers,
Jake

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor