Operating System - OpenVMS
1828362 Members
3150 Online
109976 Solutions
New Discussion

Re: Regarding disconnected Device identification in Open VMS

 
Nagendra Shastry K,C
Occasional Advisor

Regarding disconnected Device identification in Open VMS

Hi Friends,

Is there any way to identify the disconnected devices(GK/GG) in OpenVMS.
I am checking in device strctures -
DDB
DDT
SUD
CRB

There is a lot of fields is there in these structure. where i can get the definition of these fields.

Thanks in advance
Nagendra
2 REPLIES 2
Hoff
Honored Contributor

Re: Regarding disconnected Device identification in Open VMS

"Connected" and "Disconnected" have a habit of changing; it can be surprisingly slippery. Most folks don't look at this, and simply code to deal with I/O errors. One of many of which can be an indication the device is off-line, or has just gone off-line, or is not responding, or has just, well, whatever...

Preemptively checking the device state doesn't mean the device will remain online for the actual and important operation, too.

None of the kernel structures listed are involved with the on-line state as you've discovered, and it's odd that you're looking in the kernel here. That implies there is more here about the run-time environment (kernel mode?) that you're not indicating. Key here is usually the UCB, the Unit Control Block, but there are other state flags elsewhere such as the mount verification status.

I'm going to infer you are not familiar with kernel mode programming, and not looking to perform kernel-mode programming unless you need to. This because the details needed to create a device driver or other kernel-code are not going to fit into this text input box.

If you really need to know of the device is awake and aware and accessible, the usual approach is to toss an IO$_PACKACK at the DG or DK dis device, and see if the device state stays or changes to online status, or if it stays or changes to offline.

http://64.223.189.234/node/755

The GG and GK devices are (for lack of a better name) command and control interfaces, and you'll be looking at low-level SCSI command packets and IO$_DIAGNOSE commands if you want to probe those.

It is feasible (and documented) to use DCL lexical functions such as f$getdvi( device, "devchar") and f$getdvi( device, "sts") to get the device flags and status, but that can change and can be stale. Which is why I usually use a PACKACK, if I really need to know.

The ONLINE bit flag is bitmask %x10 in the STS return bitmask, and a correctly-written device driver should manage this bit for you.

http://mvb.saic.com/freeware/vax89a2/schaffrath/com/devchar.com

And if you want to become familiar with the OpenVMS kernel, get the Internals and Data Structures Manual (IDSM), and (if you're working on kernel-mode code) the Writing VMS Device Drivers in C book, and read through it/them. There are source code example device drivers around, including one in SYS$EXAMPLES: and various others in the various archives at:

http://mvb.saic.com/

And your use of the word "regarding" implies you've been reading a whole lot of email. :-)

Stephen Hoffman
HoffmanLabs LLC
Robert Brooks_1
Honored Contributor

Re: Regarding disconnected Device identification in Open VMS

There are far better and more efficient ways
to get this information if you contact your HP
colleagues within VMS Engineering


-- Rob