home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / nduk-v37.lha / V37 / include / devices / hardblocks.i < prev    next >
Text File  |  1991-11-27  |  9KB  |  206 lines

  1.     IFND    DEVICES_HARDBLOCKS_I
  2. DEVICES_HARDBLOCKS_I    SET    1
  3. **
  4. **    $Filename: devices/hardblocks.i $
  5. **    $Release: 2.04 Includes, V37.4 $
  6. **    $Revision: 36.3 $
  7. **    $Date: 91/08/23 $
  8. **
  9. **    File System identifier blocks for hard disks
  10. **
  11. **    (C) Copyright 1988-1991 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. **
  14.  
  15.     IFND    EXEC_TYPES_I
  16.     INCLUDE    "exec/types.i"
  17.     ENDC
  18.  
  19.  
  20. ;---------------------------------------------------------------------
  21. ;
  22. ;    This file describes blocks of data that exist on a hard disk
  23. ;    to describe that disk.    They are not generically accessable to
  24. ;    the user as they do not appear on any DOS drive.  The blocks
  25. ;    are tagged with a unique identifier, checksummed, and linked
  26. ;    together.  The root of these blocks is the RigidDiskBlock.
  27. ;
  28. ;    The RigidDiskBlock must exist on the disk within the first
  29. ;    RDB_LOCATION_LIMIT blocks.  This inhibits the use of the zero
  30. ;    cylinder in an AmigaDOS partition: although it is strictly
  31. ;    possible to store the RigidDiskBlock data in the reserved
  32. ;    area of a partition, this practice is discouraged since the
  33. ;    reserved blocks of a partition are overwritten by "Format",
  34. ;    "Install", "DiskCopy", etc.  The recommended disk layout,
  35. ;    then, is to use the first cylinder(s) to store all the drive
  36. ;    data specified by these blocks: i.e. partition descriptions,
  37. ;    file system load images, drive bad block maps, spare blocks,
  38. ;    etc.
  39. ;
  40. ;    Though only 512 byte blocks are currently supported by the
  41. ;    file system, this proposal tries to be forward-looking by
  42. ;    making the block size explicit, and by using only the first
  43. ;    256 bytes for all blocks but the LoadSeg data.
  44. ;
  45. ;---------------------------------------------------------------------
  46.  
  47. ;
  48. ;   NOTE
  49. ;    optional block addresses below contain $ffffffff to indicate
  50. ;    a NULL address
  51. ;
  52.  STRUCTURE    RigidDiskBlock,0
  53.     ULONG   rdb_ID        ; 4 character identifier
  54.     ULONG   rdb_SummedLongs    ; size of this checksummed structure
  55.     LONG    rdb_ChkSum        ; block checksum (longword sum to zero)
  56.     ULONG   rdb_HostID        ; SCSI Target ID of host
  57.     ULONG   rdb_BlockBytes    ; size of disk blocks
  58.     ULONG   rdb_Flags        ; see below for defines
  59.     ; block list heads
  60.     ULONG   rdb_BadBlockList    ; optional bad block list
  61.     ULONG   rdb_PartitionList    ; optional first partition block
  62.     ULONG   rdb_FileSysHeaderList ; optional fule system header block
  63.     ULONG   rdb_DriveInit    ; optional drive-specific init code
  64.                 ; DriveInit(lun,rdb,ior): "C" stk & d0/a0/a1
  65.     STRUCT  rdb_Reserved1,6*4    ; set to $ffffffff
  66.     ; physical drive characteristics
  67.     ULONG   rdb_Cylinders    ; number of drive cylinders
  68.     ULONG   rdb_Sectors        ; sectors per track
  69.     ULONG   rdb_Heads        ; number of drive heads
  70.     ULONG   rdb_Interleave    ; interleave
  71.     ULONG   rdb_Park        ; landing zone cylinder
  72.     STRUCT  rdb_Reserved2,3*4
  73.     ULONG   rdb_WritePreComp    ; starting cylinder: write precompensation
  74.     ULONG   rdb_ReducedWrite    ; starting cylinder: reduced write current
  75.     ULONG   rdb_StepRate    ; drive step rate
  76.     STRUCT  rdb_Reserved3,5*4
  77.     ; logical drive characteristics
  78.     ULONG   rdb_RDBBlocksLo    ; low block of range reserved for hardblocks
  79.     ULONG   rdb_RDBBlocksHi    ; high block of range for these hardblocks
  80.     ULONG   rdb_LoCylinder    ; low cylinder of partitionable disk area
  81.     ULONG   rdb_HiCylinder    ; high cylinder of partitionable data area
  82.     ULONG   rdb_CylBlocks    ; number of blocks available per cylinder
  83.     ULONG   rdb_AutoParkSeconds    ; zero for no auto park
  84.     ULONG   rdb_HighRDSKBlock    ; highest block used by RDSK
  85.                 ; (not including replacement bad blocks)
  86.     STRUCT  rdb_Reserved4,1*4
  87.     ; drive identification
  88.     STRUCT  rdb_DiskVendor,8
  89.     STRUCT  rdb_DiskProduct,16
  90.     STRUCT  rdb_DiskRevision,4
  91.     STRUCT  rdb_ControllerVendor,8
  92.     STRUCT  rdb_ControllerProduct,16
  93.     STRUCT  rdb_ControllerRevision,4
  94.     STRUCT  rdb_Reserved5,10*4
  95.  
  96.     LABEL   RigidDiskBlock_SIZEOF
  97.  
  98. IDNAME_RIGIDDISK    EQU    (('R'<<24)!('D'<<16)!('S'<<8)!('K'))
  99.  
  100. RDB_LOCATION_LIMIT    EQU    16
  101.  
  102.     BITDEF  RDBF,LAST,0        ; no disks exist to be configured after
  103.                 ;   this one on this controller
  104.     BITDEF  RDBF,LASTLUN,1    ; no LUNs exist to be configured greater
  105.                 ;   than this one at this SCSI Target ID
  106.     BITDEF  RDBF,LASTTID,2    ; no Target IDs exist to be configured
  107.                 ;   greater than this one on this SCSI bus
  108.     BITDEF  RDBF,NORESELECT,3    ; don't bother trying to perform reselection
  109.                 ;   when talking to this drive
  110.     BITDEF  RDBF,DISKID,4    ; rdb_Disk... identification valid
  111.     BITDEF  RDBF,CTRLRID,5    ; rdb_Controller... identification valid
  112.                 ; added 7/20/89 by commodore:
  113.     BITDEF  RDBF,SYNCH,6    ; drive supports scsi synchronous mode
  114.                 ; CAN BE DANGEROUS TO USE IF IT DOESN'T!
  115.  
  116. ;---------------------------------------------------------------------
  117.  STRUCTURE    BadBlockEntry,0
  118.     ULONG   bbe_BadBlock    ; block number of bad block
  119.     ULONG   bbe_GoodBlock    ; block number of replacement block
  120.     LABEL   BadBlockEntry_SIZEOF
  121.  
  122.  STRUCTURE    BadBlockBlock,0
  123.     ULONG   bbb_ID        ; 4 character identifier
  124.     ULONG   bbb_SummedLongs    ; size of this checksummed structure
  125.     LONG    bbb_ChkSum        ; block checksum (longword sum to zero)
  126.     ULONG   bbb_HostID        ; SCSI Target ID of host
  127.     ULONG   bbb_Next        ; block number of the next BadBlockBlock
  128.     ULONG   bbb_Reserved
  129.     STRUCT  bbb_BlockPairs,61*BadBlockEntry_SIZEOF ; bad block entry pairs
  130.     ; note 61 assumes 512 byte blocks
  131.     ; there is no BadBlockBlock_SIZEOF: try rdb_BlockBytes
  132.  
  133. IDNAME_BADBLOCK        EQU    (('B'<<24)!('A'<<16)!('D'<<8)!('B'))
  134.  
  135. ;---------------------------------------------------------------------
  136.  STRUCTURE    PartitionBlock,0
  137.     ULONG   pb_ID        ; 4 character identifier
  138.     ULONG   pb_SummedLongs    ; size of this checksummed structure
  139.     LONG    pb_ChkSum        ; block checksum (longword sum to zero)
  140.     ULONG   pb_HostID        ; SCSI Target ID of host
  141.     ULONG   pb_Next        ; block number of the next PartitionBlock
  142.     ULONG   pb_Flags        ; see below for defines
  143.     STRUCT  pb_Reserved1,2*4
  144.     ULONG   pb_DevFlags        ; preferred flags for OpenDevice
  145.     STRUCT  pb_DriveName,32    ; preferred DOS device name: BSTR form
  146.                 ; (not used if this name is in use)
  147.     STRUCT  pb_Reserved2,15*4    ; filler to 32 longwords
  148.     STRUCT  pb_Environment,17*4    ; environment vector for this partition
  149.     STRUCT  pb_EReserved,15*4    ; reserved for future environment vector
  150.     LABEL   PartitionBlock_SIZEOF
  151.  
  152. IDNAME_PARTITION    EQU    (('P'<<24)!('A'<<16)!('R'<<8)!('T'))
  153.  
  154.     BITDEF  PBF,BOOTABLE,0    ; this partition is intended to be bootable
  155.                 ;   (expected directories and files exist)
  156.     BITDEF  PBF,NOMOUNT,1    ; do not mount this partition (e.g. manually
  157.                 ;   mounted, but space reserved here)
  158.  
  159. ;---------------------------------------------------------------------
  160.  STRUCTURE    FileSysHeaderBlock,0
  161.     ULONG   fhb_ID        ; 4 character identifier
  162.     ULONG   fhb_SummedLongs    ; size of this checksummed structure
  163.     LONG    fhb_ChkSum        ; block checksum (longword sum to zero)
  164.     ULONG   fhb_HostID        ; SCSI Target ID of host
  165.     ULONG   fhb_Next        ; block number of the next FileSysHeaderBlock
  166.     ULONG   fhb_Flags        ; see below for defines
  167.     STRUCT  fhb_Reserved1,2*4
  168.     ULONG   fhb_DosType        ; file system description: match this with
  169.                 ; partition environment's DE_DOSTYPE entry 
  170.     ULONG   fhb_Version        ; release version of this code
  171.     ULONG   fhb_PatchFlags    ; bits set for those of the following that
  172.                 ;   need to be substituted into a standard
  173.                 ;   device node for this file system: e.g.
  174.                 ;   $180 to substitute SegList & GlobalVec
  175.     ULONG   fhb_Type        ; device node type: zero
  176.     ULONG   fhb_Task        ; standard dos "task" field: zero
  177.     ULONG   fhb_Lock        ; not used for devices: zero
  178.     ULONG   fhb_Handler        ; filename to loadseg: zero placeholder
  179.     ULONG   fhb_StackSize    ; stacksize to use when starting task
  180.     LONG    fhb_Priority    ; task priority when starting task
  181.     LONG    fhb_Startup        ; startup msg: zero placeholder
  182.     LONG    fhb_SegListBlocks    ; first of linked list of LoadSegBlocks:
  183.                 ;   note that this entry requires some
  184.                 ;   processing before substitution
  185.     LONG    fhb_GlobalVec    ; BCPL global vector when starting task
  186.     STRUCT  fhb_Reserved2,23*4    ; (those reserved by PatchFlags)
  187.     STRUCT  fhb_Reserved3,21*4
  188.     LABEL   FileSysHeader_SIZEOF
  189.  
  190. IDNAME_FILESYSHEADER    EQU    (('F'<<24)!('S'<<16)!('H'<<8)!('D'))
  191.  
  192. ;---------------------------------------------------------------------
  193.  STRUCTURE    LoadSegBlock,0
  194.     ULONG   lsb_ID        ; 4 character identifier
  195.     ULONG   lsb_SummedLongs    ; size of this checksummed structure
  196.     LONG    lsb_ChkSum        ; block checksum (longword sum to zero)
  197.     ULONG   lsb_HostID        ; SCSI Target ID of host
  198.     ULONG   lsb_Next        ; block number of the next FileSysBlock
  199.     STRUCT  lsb_LoadData,123*4    ; data for "loadseg"
  200.     ; note 123 assumes 512 byte blocks
  201.     ; there is no LoadSegBlock_SIZEOF: try rdb_BlockBytes
  202.  
  203. IDNAME_LOADSEG        EQU    (('L'<<24)!('S'<<16)!('E'<<8)!('G'))
  204.  
  205.     ENDC
  206.