SCSI/EIDE

From: J.A. Gutierrez <spd_at_gtc1.cps.unizar.es>
Date: Fri, 27 Jul 2001 12:27:15 +0200

        Hello


        I have a DS10 (COMPAQ AlphaServer DS10 466 MHz DEC6600)
        which should have SCSI disks:

    Run on Thu May 17 10:40:30 MEST 2001 Script sys_check Version: 114.0
  13: connection pci0slot13
  33: ide_adapter ata0
  34: scsi_bus scsi0
  37: disk bus-0-targ-0-lun-0 dsk0


        But while I was working on a "prtoc" program I found
        label->d_type is EIDE instead of SCSI:

# ./prtoc /dev/rdisk/dsk0c
280 sizeof(*label)
0x82564557 d_magic (should be 0x82564557)
9 type (EIDE)

        
        where

- prtoc.c -----------------------------------------------------------------
#include <stdio.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define DKTYPENAMES
#define STANDALONE

#include <sys/param.h>
#include <sys/disklabel.h>

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

        struct fs *ufs;
        unsigned char b[DEV_BSIZE];
        struct disklabel *label;
        short i;
        unsigned short sum, *word;


        if ( -1 == ( disk = open( argv[1], O_RDONLY )))
        {
                perror(argv[1]);
                exit(1);
        }
        else
        {

                fprintf(stdout,"%d\tsizeof(*label)\n",sizeof(*label));
                for (i=0; i<=LABELSECTOR; i++)
                {
                if ( sizeof(b) != read( disk, &b[0], sizeof(b) ))
                        perror("read label");
                }
                close(disk);

                label=(struct disklabel *)(&b[LABELOFFSET]);


                fprintf(stdout,"0x%X\td_magic (should be 0x%X)\n",label->d_magic,DISKMAGIC);
                fprintf(stdout,"%u\ttype (%s)\n",label->d_type,dktypenames[label->d_type]);

        }
        exit ( 0 );
}
---------------------------------------------------------------------------



-- 
finger spd_at_gtc1.cps.unizar.es for PGP       /              So be easy and free
.mailcap tip of the day:                   /      when you're drinking with me
application/ms-tnef; cat '%s' > /dev/null / I'm a man you don't meet every day
text/x-vcard; cat '%s' > /dev/null       /            (the pogues)
Received on Fri Jul 27 2001 - 10:28:48 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:42 NZDT