Dec Device Interigation Problem

Dec Device Interigation Problem

Post by Calyx UK Developmen » Thu, 02 Oct 1997 04:00:00



I am having a few problems accessing a Digital TSZ07 tape drive
connected to an AlphaServer 1000 running DEC UNIX 4.0. It is being
accessed using low UNIX system calls i.e. open, close and ioctl.

A simple example would be :-

#include <stdio.h>
#include <unistd.h>
#include <sys/mtio.h>
#include <sys/ioctl.h>
#include <sys/devio.h>
#include <sys/ioctl_compat.h>
#include <stdlib.h>
#include <string.h>

int main ( int argc , char **argv )
{

  char deviceId[256] , errStr[256];
  int deviceFd;
  int result , error;
  struct mtop tapeCmd;

  strcpy( deviceId , "/dev/rmt1h" );

  deviceFd = open( deviceId , O_RDWR | O_SYNC , 0666 );
  if ( deviceFd < 0 )
  {
    printf( "Failed to open tape device : %s\n", deviceId );
    error = errno;
    printf( "TapeIo Error - errno : %d : %s\n", error, strerror(error));
    return (-1);
  }

  printf( "Getting Tape drive status :-\n\n");

  result = ioctl (deviceId , DEVIOCGET , &tapeStatus);
  if ( result == -1 )
  {
    error = errno;
    printf ("TapeIo Error - errno : %d : %s\n", error, strerror(error));
  }
  else
  {
    printf( "Status is %ld \n" , tapeStatus.stat );
  }

  close ( deviceFd );

  return (1);

Quote:}

This program works fine provided that the tape drive is online, but if
the tape drive is offline the program fails on the open statement, which
is not much use if you wish to obtain the current status of the tape
drive from within a program.

If an 'mt' command is issued e.g.

mt -f /dev/rmt1h status

this will actually return with information telling you that the tape
drive is offline. Can anyone explain what is happening here.

MTIA    

Tim
--
Calyx UK Development

 
 
 

1. Problems with recognition of scsi devices on DEC Alpha

Hi all -

We've got a box with both a Seagate 9Gb hard drive and Exabyte 8505 8mm
tape drive mounted together on one of our DEC Alpha 3000-400's.  The
Seagate is always recognized - $dkb300, in this case.  However, I have never
been able to get the system to recognize the existence of the tape drive,
no matter how I have set the SCSI address (4,5,6..)  I don't think there's an
internal termination problem, but I haven't poked around inside the box to
check that out.  Before I do, does anyone have any suggestions as to other
problems which might cause the non-recognition of the Exabyte?

Todd

______________________________________________________________________________
Todd K. Pedlar                ! "Science walks forward on two feet, namely
Graduate Student              ! theory and experiment.  Sometimes it is one
High Energy Physics           ! foot which is put forward first, sometimes    
Northwestern University       ! the other, but continuous progress is only
------------------------------! made by the use of both..."


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

2. Installing and using ginastub.dll?

3. Palm Device / Wireless Device display simulator

4. LOWEST PRICE IN EUROPE, PSX,CD-R,DV

5. Non-DEC devices on HSC9X?

6. Relating dimensions to dimensions?

7. Device Control from VAX or DEC PC?

8. Way to Start PCPlus in 'Log On' mode?

9. DEC 3000/300 OSF/1 - Devices

10. Major/Minor Device Number for DAT drive on DEC 3100 Ultrix 2.1?

11. DEC Regis device driver for DOS?

12. Book about DEC and SCSI-devices.

13. Generic SCSI devices for DEC 5000