HP3000-L Archives

February 1997, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Mon, 24 Feb 1997 16:20:08 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (258 lines)
Jim writes:

> Um, seeing as how I wrote my own ONLINE program using HPDEVCONTROL,
> which we rely on in our production environment, could you disclose
> what the bugs are and what versions have these bugs?

Ok, you made me realize that my posting of these comments was
quite a while ago...much longer than I thought!  (Probably back
around MPE XL 4.0!)

So, revised & expanded comments below, after "----" line.

> Oh, and by the way, would you like to explain to the uninitiated (that's
> me) what waiting for the AVR does?  I checked my utility using SHOWDEV.
> With a tape loaded, but offline, SHOWDEV 7 gives:
...
> Immediatley after running my ONLINE utility:
>
> :SHOWDEV 7
>     7     UNAVAIL       SYS
>
> Repeated SHOWDEV's finally give:
>     7     AVAIL    (W)                    (Nolabel)     1600
>
> Is this what you mean by waiting for AVR?  Does your utility not
> return until the tape is ready to be written to/read from?

Yes.  This is fairly tricky, because we index into an old Compatibility
Mode table (the LDT (Logical Device Table)) and watch the "density"
field...when it becomes non-0, the tape is AVR'd.  (Code written by
Charlie Rand of Allegro ... we only hire intrinsics :)


----------------------------------------------------------------------


First, a <plug> CSEQ Tool </plug> look at HPDEVCONTROL:

   :cseq HPDEVCONTROL

   Procedure HPDEVCONTROL (
      status       : anyvar record  ;     {R26, @32 -> 32, align 32}
      ldev_ca      : anyvar record  ;     {R25, @32 -> 8208}
      itemnum      :        int32   ;     {R24}
      item         : anyvar int32   )     {R23}
      {                                                 }
      {NOTE: NOTE: NOTE:                                }
      {   *SERIOUS* problems can occur if the status    }
      {   parameter is not 4-byte aligned!              }
      {                                                 }
      {NOTE:                                            }
      {  The intrinsic definition of this procedure may }
      {  *not* match reality!  (As of early MPE/iX 4.0) }
      {                        (appears fixed by 5.0)   }
      {The "itemnum" parameter is actually by-value, and}
      {the NL.PUB.SYS entry is uppercase "HPDEVCONTROL".}
      {                                                 }
      {ldev_ca:  -###-   e.g.,:  x7x   or  "123"        }
      {itemnums:                                        }
      {   100 i32  Load Media  (tapes only?)            }
      {   101 i32  Online (DDS, some tapes)             }
      {                                                 }
      {Not supported on 7974, 7976 tape drives.         }
      {Item 101 not supported for 7978 tape drives.     }
         uncheckable_anyvar

Ok, we so already know that there are various problems
with HPDEVCONTROL.

The "SERIOUS" problem I refer to is:  system failure.
HPDEVCONTROL had (and still has) a bug that can result
in a system failure (even on MPE/iX 5.5 PowerPatch 1).

As the above notes, the intrinsic definition of HPDEVCONTROL
was wrong for a couple of releases of MPE, which resulted
in it being even easier to kill the system.

Here are other things I've found:

   HP7978B tape drives cannot be put on-line programmatically.
   Using ONLINE for an HP7978B will result in an "LDEV NOT READY"
   message on the system console, and will probably require you
   to <break>/ABORT ONLINE.

   HP7980XC tape drives may require that you break/abort ONLINE
   and run it a second time if tape data compression is enabled.

   If the tape is not mounted, this program will hang until it is
   mounted, or an ABORTIO is done on the ldev (or until you hit
   <break> and enter: ABORT).  Sorry, but this is a shortcoming
   in the design of the awkward HP intrinsic ONLINE calls.  If an
   ABORTIO is done, the intrinsic returns the incorrect
   "warning": "The operation was successful with retries.",
   which, of course, it wasn't.

   If the ldev you specify is not a tape drive, ONLINE may
   generate a misleading error.  Again, this is the fault of the
   intrinsic.  ONLINE attempts to avoid this by using simple
   privileged code to check the type of ldev you specify. (#1)

   If you try to place a tape on-line after another process has
   already "grabbed" the drive, your request will be rejected
   with error -3/$8f, and the tape may have to be placed on-line
   manually.  (Again, due to the intrinsic.)  (If you do an
   ABORTIO after running ONLINE in this case, the online-request
   may be belatedly honored by the drive.)

The above hard-won information, and more, is reflected in the
following pseudo-code:

   hpdevcontrol (status, ldevname', i'online, dummy);

   if status = $ffdf0071 then
      begin       ! seen when trying to put tape on-line after SCSIDDS
                  ! diagnostic used it ... then, a second attempt worked
                  ! SS 930916
      wait'secs := 1.0;
      pause (wait'secs);
      status := 0d;
      hpdevcontrol (status, buf', i'online, dummy);
      end;

   if status <> 0d then
      begin
      if status = $ffdd0071 then
         begin
                     ! $ffdd0071 not reportable via hperrmsg :(
         "LLIO Internal error # -35"
         " "
         "The above error seems to occur when an HP7978 tape drive is"
         "placed on-line manually."
         end

      else if status = $ffff0071 then
         begin
         hperrmsg (2d, 1d, , status, , , hperrmsg'status);
         " "
      "The above error/message is misleading.  It typically is returned
         "when an ABORTIO command cancelled the on-line request."
         end

      else if status = $fffd008f then
         begin
         hperrmsg (2d, 1d, , status, , , hperrmsg'status);
         " "                                ! blank line
   "The above error is typically returned when you try to place on-line
        "a tape drive that has already been allocated to a process.  The
         "intrinsic ONLINE uses can't handle that situation."
         end

      else
         begin
         hperrmsg (2d, 1d, , status, , , hperrmsg'status);
         " "
         ...failed for unknown HPDEVCONTROL reason
         end
      end

   else
      begin
           ... "online" succeeded ...

      while remaining'avr'attempts > 0 do
         see if AVR done;
         if not, pause 1 second
         decrement remaining'avr'attempts
      end;

---------------------------------------------------------------

1991-05-17 notes...

Sample ldevs and hpdevcontrol results on Lisa (3000/917):

   Ldev Type   Result (hpdevcontrol status -> hperrmsg)
   ---- ----   ----------------------------------------
     1  Disc   There is marginal data on disc.     BAD INFO!

    99 (none)  Intrinsic layer; an undefined error occurred.

     7  DDS:   various:
               loaded & online:  ok (status = 0)
               loaded & offline: ok (status = 0)
               not loaded:  hang until loaded or I/O is aborted:
                  if loaded:     ok (status = 0)
                  if aborted:    The operation was successful
                                 with retries.     BAD INFO!
---------------------------------------------------------------

Because of the misleading information returned by HPDEVCONTROL
when a bad ldev is passed to it, I wrote:

   equate
            ! Values returned by io_device_class ...
            ! chosen by MPE, not me!
      io_not_configured          = 0,
      io_disc                    = 1,
      io_tape                    = 2,
      io_terminal                = 3,
      io_printer                 = 4,
      io_serial_printer          = 5,
      io_spooler                 = 6,
      io_data_comm               = 7,
      io_ds_term                 = 8,
      io_ds_printer              = 9,
      io_user_device             = 10,

   integer Procedure io_device_class (ldev);       ! an MPE internal
            value   ldev;                 ! must be in PM to call!
            integer ldev;
         option native, nocc, external;

   <<************************************************************>>
   procedure check'legal'ldev (ldev);
            value   ldev;
            integer ldev;
         option privileged, native, nocc;

         ! Makes sure "ldev" is a valid, configured tape...
         ! note the "privileged".  The COBOL equivalent would be
         ! something vaguely like:
         !     call intrinsic "GETPRIVMODE".
         !     call "io_device_class" with \ldev\ giving devclass.
         !     call intrinsic "GETUSERMODE".

      begin

      logical
         dc;


      if ldev <= 0 then
         begin
             "LDEV must be > 0" ;
         die (3);
         end;

      dc := io_device_class (ldev);

      if dc = io_not_configured then
         begin
             "LDEV not configured" ;
         die (5);
         end;

      if dc <> io_tape then
         begin
             "LDEV does not appear to be a tape drive" ;
         die (6);
         end;

      end <<check'legal'ldev proc>>;
   <<************************************************************>>

--
Stan Sieler                                          [log in to unmask]
                                     http://www.allegro.com/sieler.html

ATOM RSS1 RSS2