home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / IncPOS.lzx / Device / Hardblocks.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-18  |  8.4 KB  |  204 lines

  1. #ifndef __INC_POS_DEVICE_HARDBLOCKS_H
  2. #define __INC_POS_DEVICE_HARDBLOCKS_H
  3. /*******************************************************************
  4.  Includes Release 24
  5.  (C) Copyright 1995-1997 proDAD
  6.      All Rights Reserved
  7.  
  8.  $AUT Holger Burkarth
  9.  $DAT >>Hardblocks.h<<   10 Jan 1997    08:47:20 - (C) ProDAD
  10. *******************************************************************/
  11. #ifndef __INC_POS_PEXEC_TYPES_H
  12. #include <pExec/Types.h>
  13. #endif
  14.  
  15.  
  16. /*\
  17. *** Note
  18. *** optional block addresses below contain $ffffffff to indicate
  19. *** a NULL address, as zero is a valid address
  20. \*/
  21.  
  22. /*----------------------------------
  23. -----------------------------------*/
  24. struct pOS_RigidDiskBlock
  25. {
  26.   ULONG rdb_ID;             /* 4 character identifier */
  27.   ULONG rdb_SummedLongs;    /* size of this checksummed structure */
  28.   ULONG rdb_ChkSum;         /* block checksum (longword sum to zero) */
  29.   ULONG rdb_HostID;         /* SCSI Target ID of host */
  30.   ULONG rdb_BlockBytes;     /* size of disk blocks */
  31.   ULONG rdb_Flags;          /* (enum pOS_RigidDiskBlockFlags) */
  32.  
  33. /* block list heads */
  34.   ULONG rdb_BadBlockList;   /* optional bad block list */
  35.   ULONG rdb_PartitionList;  /* optional first partition block */
  36.   ULONG rdb_FSHeaderList;   /* optional file system header block */
  37.   ULONG rdb_DriveInit;      /* optional drive-specific init code */
  38.   ULONG rdb_Reserved1[6];   /* set to $ffffffff */
  39.  
  40. /* physical drive characteristics */
  41.   ULONG rdb_Cylinders;      /* number of drive cylinders */
  42.   ULONG rdb_Sectors;        /* sectors per track */
  43.   ULONG rdb_Heads;          /* number of drive heads */
  44.   ULONG rdb_Interleave;     /* interleave */
  45.   ULONG rdb_Park;           /* landing zone cylinder */
  46.   ULONG rdb_Reserved2[3];
  47.   ULONG rdb_WritePreComp;   /* starting cylinder: write precompensation */
  48.   ULONG rdb_ReducedWrite;   /* starting cylinder: reduced write current */
  49.   ULONG rdb_StepRate;       /* drive step rate */
  50.   ULONG rdb_Reserved3[5];
  51.  
  52. /* logical drive characteristics */
  53.   ULONG rdb_RDBBlocksLo;    /* low block of range reserved for hardblocks */
  54.   ULONG rdb_RDBBlocksHi;    /* high block of range for these hardblocks */
  55.   ULONG rdb_LoCylinder;     /* low cylinder of partitionable disk area */
  56.   ULONG rdb_HiCylinder;     /* high cylinder of partitionable data area */
  57.   ULONG rdb_CylBlocks;      /* number of blocks available per cylinder */
  58.   ULONG rdb_AutoParkSeconds; /* zero for no auto park */
  59.   ULONG rdb_HighRDSKBlock;  /* highest block used by RDSK */
  60.                               /* (not including replacement bad blocks) */
  61.   ULONG rdb_Reserved4;
  62.  
  63. /* drive identification */
  64.   UBYTE rdb_DiskVendor[8];
  65.   UBYTE rdb_DiskProduct[16];
  66.   UBYTE rdb_DiskRevision[4];
  67.   UBYTE rdb_ControllerVendor[8];
  68.   UBYTE rdb_ControllerProduct[16];
  69.   UBYTE rdb_ControllerRevision[4];
  70.   ULONG rdb_Reserved5[10];
  71. };
  72.  
  73. #define IDNAME_RIGIDDISK   0x5244534B /* 'RDSK' */
  74. #define RDB_LOCATION_LIMIT 16
  75.  
  76. enum pOS_RigidDiskBlockFlags /** rdb_Flags **/
  77. {
  78.   RDBFB_Last      =0,       /* no disks exist to be configured after */
  79.   RDBFF_Last      =0x01,    /*   this one on this controller */
  80.   RDBFB_LastLun   =1,       /* no LUNs exist to be configured greater */
  81.   RDBFF_LastLun   =0x02,    /*   than this one at this SCSI Target ID */
  82.   RDBFB_LasttID   =2,       /* no Target IDs exist to be configured */
  83.   RDBFF_LasttID   =0x04,    /*   greater than this one on this SCSI bus */
  84.   RDBFB_NoReselect=3,       /* don't bother trying to perform reselection */
  85.   RDBFF_NoReselect=0x08,    /*   when talking to this drive */
  86.   RDBFB_DiskID    =4,       /* rdb_Disk... identification valid */
  87.   RDBFF_DiskID    =0x10,
  88.   RDBFB_CtrlRID   =5,       /* rdb_Controller... identification valid */
  89.   RDBFF_CtrlRID   =0x20,
  90.   RDBFB_Synch     =6,       /* drive supports scsi synchronous mode */
  91.   RDBFF_Synch     =0x40,    /* CAN BE DANGEROUS TO USE IF IT DOESN'T! */
  92. };
  93.  
  94.  
  95. /*----------------------------------
  96. -----------------------------------*/
  97. struct pOS_BadBlockEntry
  98. {
  99.   ULONG bbe_BadBlock;  /* block number of bad block */
  100.   ULONG bbe_GoodBlock; /* block number of replacement block */
  101. };
  102.  
  103.  
  104. /*----------------------------------
  105. -----------------------------------*/
  106. struct pOS_BadBlockBlock
  107. {
  108.   ULONG   bbb_ID;             /* 4 character identifier */
  109.   ULONG   bbb_SummedLongs;    /* size of this checksummed structure */
  110.   ULONG   bbb_ChkSum;         /* block checksum (longword sum to zero) */
  111.   ULONG   bbb_HostID;         /* SCSI Target ID of host */
  112.   ULONG   bbb_Next;           /* block number of the next BadBlockBlock */
  113.   ULONG   bbb_Reserved;
  114.   struct pOS_BadBlockEntry bbb_BlockPairs[61]; /* bad block entry pairs */
  115.   /* note [61] assumes 512 byte blocks */
  116. };
  117.  
  118. #define IDNAME_BADBLOCK 0x42414442 /* 'BADB' */
  119.  
  120.  
  121. /*----------------------------------
  122. -----------------------------------*/
  123. struct pOS_PartitionBlock
  124. {
  125.   ULONG pb_ID;              /* 4 character identifier */
  126.   ULONG pb_SummedLongs;     /* size of this checksummed structure */
  127.   ULONG pb_ChkSum;          /* block checksum (longword sum to zero) */
  128.   ULONG pb_HostID;          /* SCSI Target ID of host */
  129.   ULONG pb_Next;            /* block number of the next PartitionBlock */
  130.   ULONG pb_Flags;           /* (enum pOS_PartitionBlockFlags) */
  131.   ULONG pb_Reserved1[2];
  132.   ULONG pb_DevFlags;        /* preferred flags for OpenDevice */
  133.   UBYTE pb_DriveName[32];   /* preferred DOS device name: BSTR form */
  134.                             /* (not used if this name is in use) */
  135.   ULONG pb_Reserved2[15];   /* filler to 32 longwords */
  136.  
  137.   struct {
  138.     ULONG pbde_TableSize;       /* Size of pb_Env */
  139.     ULONG pbde_SizeBlock;       /* in longwords: standard value is 128 */
  140.     ULONG pbde_Pad1;            /* 0 */
  141.     ULONG pbde_Surfaces;        /* # of heads (surfaces). drive specific */
  142.     ULONG pbde_Pad2;            /* 1 */
  143.     ULONG pbde_BlocksPerTrack;  /* blocks per track. drive specific */
  144.     ULONG pbde_Reserved;        /* DOS reserved blocks at start of partition. */
  145.     ULONG pbde_PreAlloc;        /* DOS reserved blocks at end of partition */
  146.     ULONG pbde_Interleave;      /* usually 0 */
  147.     ULONG pbde_LowCyl;          /* starting cylinder. typically 0 */
  148.     ULONG pbde_HighCyl;         /* max cylinder. drive specific */
  149.     ULONG pbde_NumBuffers;      /* Initial # DOS of buffers.  */
  150.     ULONG pbde_BufMemType;      /* type of mem to allocate for buffers */
  151.     ULONG pbde_MaxTransfer;     /* Max number of bytes to transfer at a time */
  152.     ULONG pbde_Mask;            /* Address Mask to block out certain memory */
  153.     SLONG pbde_BootPri;         /* Boot priority for autoboot */
  154.   } pb_Env;
  155.  
  156.   ULONG pb_EReserved[16];   /* reserved for future environment vector */
  157. };
  158.  
  159. #define IDNAME_PARTITION 0x50415254 /* 'PART' */
  160.  
  161.  
  162. enum pOS_PartitionBlockFlags /** pb_Flags **/
  163. {
  164.   PBFB_Bootable=0,       /* this partition is intended to be bootable */
  165.   PBFF_Bootable=0x01,    /*   (expected directories and files exist) */
  166.   PBFB_NoMount =1,       /* do not mount this partition (e.g. manually */
  167.   PBFF_NoMount =0x02,    /*   mounted, but space reserved here) */
  168. };
  169.  
  170.  
  171. /*----------------------------------
  172. -----------------------------------*/
  173. struct pOS_FileSysHeaderBlock
  174. {
  175.   ULONG   fhb_ID;             /* 4 character identifier */
  176.   ULONG   fhb_SummedLongs;    /* size of this checksummed structure */
  177.   ULONG   fhb_ChkSum;         /* block checksum (longword sum to zero) */
  178.   ULONG   fhb_HostID;         /* SCSI Target ID of host */
  179.   ULONG   fhb_Next;           /* block number of next FileSysHeaderBlock */
  180.   ULONG   fhb_Flags;          /* see below for defines */
  181.   ULONG   fhb_Reserved1[2];
  182.   ULONG   fhb_DosType;        /* file system description: match this with */
  183.                               /* partition environment's DE_DOSTYPE entry */
  184.   ULONG   fhb_Version;        /* release version of this code */
  185.   ULONG   fhb_PatchFlags;     /* bits set for those of the following that */
  186.                               /*   need to be substituted into a standard */
  187.                               /*   device node for this file system: e.g. */
  188.                               /*   0x180 to substitute SegList & GlobalVec */
  189.   ULONG   fhb_Type;           /* device node type: zero */
  190.   ULONG   fhb_Task;           /* standard dos "task" field: zero */
  191.   ULONG   fhb_Pad0;
  192.   ULONG   fhb_Handler;        /* filename to loadseg: zero placeholder */
  193.   ULONG   fhb_StackSize;      /* stacksize to use when starting task */
  194.   SLONG   fhb_Priority;       /* task priority when starting task */
  195.   ULONG   fhb_Pad[3];
  196.   ULONG   fhb_Reserved2[23];
  197.   ULONG   fhb_Reserved3[21];
  198. };
  199.  
  200. #define IDNAME_FILESYSHEADER 0x46534844 /* 'FSHD' */
  201.  
  202.  
  203. #endif
  204.