[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

514.0. "SHOW DEV Information" by VICKI::CAMPANELLA (Michael Campanella, DTN 261-2595) Tue Jul 21 1987 15:12

    Does anyone know how the SHOW DEV command of VMS gets its list of
    devices?  If you know the device name, you can get the info with
    GETDVI, but what if you want the info for all devices?  I think
    the program WHAT also does this.  Any ideas?
    
    						Michael Campanella
    						Cluster Qualification
T.RTitleUserPersonal
Name
DateLines
514.1SB --> DDB --> UCBCXCAD::VENNERMissed it by that much ...Tue Jul 21 1987 17:5613
re: 514.0

	i think the SHOW DEV command of VMS runs in executive mode
	and starts at SCS$GQ_CONFIG.  it then scans through a linked
	list of system blocks which each have a linked list of device
	data blocks which each have a linked list of unit control blocks.

	this should find you every type of device attached to a cluster
	i believe.

	- marty

514.2More info on I/O databaseVICKI::CAMPANELLAMichael Campanella, DTN 261-2595Mon Aug 10 1987 14:388
    Where would I find the offsets for the fields in UCB's and DDB's?
    These are things such as DDB$L_LINK, DDB$L_UCB, ...
    
    PASTOOLS suggests getting them from LIB.MLB (in text form) and writing
    a program to interpret the output.  I'd rather not do this if there
    is another way.
    
    							Michael
514.3$xxxDEFMADMAC::BONGARTZHappy HackerWed Aug 12 1987 04:4116
re: .2

	You can easily get these symbols defined by inserting the
	following in your (macro) program:

		.library	/sys$library:lib/

		$UCBDEF		; define all UCB$... symbols
		$DDBDEF		; same for DDB$...

	If you want to see the actual macro text to these macros,
	do a    $ libr/extr=$xxxDEF/macro/out=TT: sys$library:lib

		Hope that helps...

			Marc.
514.4a picture is worth...SQM::RICOThu Aug 13 1987 22:329
    There is also a tool (called PICTURE maybe?) that will take
    the output of a $xyzDEF and draw you a pictue of the associated
    data structure(s).  Also sometimes the $xyzDEF macros are in
    STARLET.  I have a simple com file that checks STARLET, then LIB,
    for a particular macro.

    Check out the toolshed, METOO::SW_TOOLS_CATALOG I believe.

            Rico
514.5SHOW DEV on a cluster!!!VICKI::CAMPANELLAMichael Campanella, DTN 261-2595Thu Aug 20 1987 17:179
    I wrote a program to go thru the I/O database (WHAT's SHOW DEV command
    does the same thing too), however I am not finding all the devices
    that SHOW DEV of VMS finds (and neither does WHAT).  The I/O database
    has devices like MBA1:, PEA0:, DUA1:... while SHOW DEV (on a LAVC)
    reports MBA1:, PEA0:, SPENDR$DUA1:, JAWA$DUA1:...
    
    Where is this info, in a cluster data structure somewhere?
    
    						Michael Campanella
514.6Scs$gq_config ?IOSG::BAILEYDO: $CMKRNL_S Routin=Hack...Thu Aug 20 1987 18:1811
I th��ink the problem is that you are not finding
cluster wide devices, Do you start to scan the IO database
at IOC$GL_DEVLIST ? is so you should start at SCS$GQ_CONFIG,
this is the cluster block, which in turn points at a block
(CLU ?) for each node, that in turn points at a IOC$GL_DEVLIST
for e��ach node, there is an example of this in the code
in the note about what files has a user opened (the 'what'lock
program


Peter Bailey
514.7Sorry but I had to askSTKEIS::LJONSSONWed Nov 25 1987 13:498
     I hate to join in a high level intellectual discussion like this with
   a question that will bring it down to a rather more elementary level,
   but that is exactly what I am about to attempt to do.

     How does one go about scaning the I/O database in the first place?


                                       /Lars Jonsson
514.8I/O scanning exampleCXCAD::VENNERYou're joking ... right?!Wed Nov 25 1987 15:3553

	as a sample of a bliss program that does some scanning of the
	I/O data base you can look at the following routine.  for this
	routine to work it should be run in executive mode ($CMEXEC).
	it finds all the disks in a cluster.

	- marty
--------------------------------------------------------------------------

ROUTINE foo =
BEGIN

EXTERNAL SCS$GQ_CONFIG;

OWN
sb_addr,
ddb_addr,
ucb_addr;

sb_addr = .SCS$GQ_CONFIG;
while (.sb_addr NEQ SCS$GQ_CONFIG) do
    BEGIN
    BIND sb_blk = .sb_addr : block[SB$C_LENGTH, byte];

    ddb_addr = .sb_blk[SB$L_DDB];
    while (.ddb_addr NEQ 0) do
	BEGIN
	BIND ddb_blk = .ddb_addr : block[DDB$C_LENGTH, byte];

	ucb_addr = .ddb_blk[DDB$L_UCB];
	while (.ucb_addr NEQ 0) do
	    BEGIN
	    BIND ucb_blk = .ucb_addr : block[UCB$C_LCL_DISK_LENGTH, byte];

	    if (.ucb_blk[UCB$B_DEVCLASS] EQL DC$_DISK) then
		BEGIN

		! PUT SOME USEFUL CODE HERE

		END;

	    ucb_addr = .ucb_blk[UCB$L_LINK];
	    END;

	ddb_addr = .ddb_blk[DDB$L_LINK];
	END;

    sb_addr = .sb_blk[SB$L_FLINK];
    END;

RETURN 1;
END;
514.9BLISS?!?!?STKEIS::LJONSSONThu Nov 26 1987 12:038
     Thank for the BLISS program! Unfortunately I don't know the first
   thing about BLISS. I was wondering if you could either show me a MACRO
   version of the same program or just simply explain (in broad terms) what
   your routine actually does.


                                       /Lars Jonsson
514.10MARVIN::WARWICKDNA puts life into your networkThu Nov 26 1987 13:0210
    
    Try reading the "Guide to writing a Device Driver for VAX/VMS" (one
    of those orange manuals on your shelf) to get some details about
    what data structures are in the "I/O database".
    
    What this program does is to look through the database looking for
    Unit Control Blocks with a device class of "Disk".
    
    Trev
    
514.11CSSAUS::HUNTERMonkey with a diagnostic trackThu Nov 26 1987 16:111
    If you want assembler from Bliss then compile it.
514.12linked listsCXCAD::VENNERYou're joking ... right?!Mon Nov 30 1987 12:3311
	i'd hoped that the routine wouldn't necessarily require a
	BLISS programmer to decipher.  it just shows the linked
	list structures that you have to go through in order to
	obtain information on disks.

	the program would probably look very similar in PASCAL or C
	or FORTRAN ...

	- marty

514.13what a bunch of wimpsPSW::WINALSKIPaul S. WinalskiSun Dec 06 1987 19:114
And you guys call yourselves hackers?  Quit whining about what language the
program is written in and go decipher it.

--PSW