home *** CD-ROM | disk | FTP | other *** search
- (**************************************************************************
-
- $RCSfile: HardBlocks.mod $
- Description: File system identifier blocks for hard disks
-
- Created by: fjc (Frank Copeland)
- $Revision: 3.7 $
- $Author: fjc $
- $Date: 1995/01/26 02:39:55 $
-
- $VER: hardblocks.h 36.3 (23.8.91)
- Includes Release 40.15
-
- (C) Copyright 1985-1993 Commodore-Amiga, Inc.
- All Rights Reserved
-
- Oberon-A interface Copyright © 1994-1995, Frank Copeland.
- This file is part of the Oberon-A Interface.
- See Oberon-A.doc for conditions of use and distribution.
-
- ***************************************************************************)
-
- <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
-
- MODULE [2] HardBlocks;
-
- <*$ CaseChk- IndexChk- LongVars+ NilChk- *>
- <*$ RangeChk- StackChk- TypeChk- OvflChk- *>
-
- IMPORT e := Exec;
-
-
- (*
- ** File System identifier blocks for hard disks
- *)
-
-
- (* --------------------------------------------------------------------
- *
- * This file describes blocks of data that exist on a hard disk
- * to describe that disk. They are not generically accessable to
- * the user as they do not appear on any DOS drive. The blocks
- * are tagged with a unique identifier, checksummed, and linked
- * together. The root of these blocks is the RigidDiskBlock.
- *
- * The RigidDiskBlock must exist on the disk within the first
- * rdbLocationLIMIT blocks. This inhibits the use of the zero
- * cylinder in an AmigaDOS partition: although it is strictly
- * possible to store the RigidDiskBlock data in the reserved
- * area of a partition, this practice is discouraged since the
- * reserved blocks of a partition are overwritten by "Format",
- * "Install", "DiskCopy", etc. The recommended disk layout,
- * then, is to use the first cylinder(s) to store all the drive
- * data specified by these blocks: i.e. partition descriptions,
- * file system load images, drive bad block maps, spare blocks,
- * etc.
- *
- * Though only 512 byte blocks are currently supported by the
- * file system, this proposal tries to be forward-looking by
- * making the block size explicit, and by using only the first
- * 256 bytes for all blocks but the LoadSeg data.
- *
- *------------------------------------------------------------------*)
-
- (*
- * NOTE
- * optional block addresses below contain $ffffffff to indicate
- * a NULL address, as zero is a valid address
- *)
-
- TYPE
-
- RigidDiskBlockPtr * = POINTER TO RigidDiskBlock;
- RigidDiskBlock * = RECORD
- id * : e.ULONG; (* 4 character identifier *)
- summedLongs * : e.ULONG; (* size of this checksummed structure *)
- chkSum * : LONGINT; (* block checksum (longword sum to zero) *)
- hostID * : e.ULONG; (* SCSI Target ID of host *)
- blockBytes * : e.ULONG; (* size of disk blocks *)
- flags * : e.ULONG; (* see below for defines *)
- (* block list heads *)
- badBlockList * : e.ULONG; (* optional bad block list *)
- partitionList * : e.ULONG; (* optional first partition block *)
- fileSysHeaderList * : e.ULONG; (* optional file system header block *)
- driveInit * : e.ULONG; (* optional drive-specific init code *)
- (* DriveInit(lun,rdb,ior): "C" stk & d0/a0/a1 *)
- reserved1 * : ARRAY 6 OF e.ULONG;
- (* set to $ffffffff *)
- (* physical drive characteristics *)
- cylinders * : e.ULONG; (* number of drive cylinders *)
- sectors * : e.ULONG; (* sectors per track *)
- heads * : e.ULONG; (* number of drive heads *)
- interleave * : e.ULONG; (* interleave *)
- park * : e.ULONG; (* landing zone cylinder *)
- reserved2 * : ARRAY 3 OF e.ULONG;
- writePreComp * : e.ULONG; (* starting cylinder: write precompensation *)
- reducedWrite * : e.ULONG; (* starting cylinder: reduced write current *)
- stepRate * : e.ULONG; (* drive step rate *)
- reserved3 * : ARRAY 5 OF e.ULONG;
- (* logical drive characteristics *)
- rdbBlocksLo * : e.ULONG; (* low block of range reserved for hardblocks *)
- rdbBlocksHi * : e.ULONG; (* high block of range for these hardblocks *)
- loCylinder * : e.ULONG; (* low cylinder of partitionable disk area *)
- hiCylinder * : e.ULONG; (* high cylinder of partitionable data area *)
- cylBlocks * : e.ULONG; (* number of blocks available per cylinder *)
- autoParkSeconds * : e.ULONG; (* zero for no auto park *)
- highRDSKBlock * : e.ULONG; (* highest block used by RDSK *)
- (* (not including replacement bad blocks) *)
- reserved4 * : e.ULONG;
- (* drive identification *)
- diskVendor * : ARRAY 8 OF CHAR;
- diskProduct * : ARRAY 16 OF CHAR;
- diskRevision * : ARRAY 4 OF CHAR;
- controllerVendor * : ARRAY 8 OF CHAR;
- controllerProduct * : ARRAY 16 OF CHAR;
- controllerRevision * : ARRAY 4 OF CHAR;
- reserved5 * : ARRAY 10 OF e.ULONG;
- END; (* RigidDiskBlock *)
-
- CONST
-
- idNameRigidDisk * = 5244534BH; (* 'RDSK' *)
-
- locationLimit * = 16;
-
- last * = 0; (* no disks exist to be configured after *)
- (* this one on this controller *)
- lastLun * = 1; (* no LUNs exist to be configured greater *)
- (* than this one at this SCSI Target ID *)
- lastTID * = 2; (* no Target IDs exist to be configured *)
- (* greater than this one on this SCSI bus *)
- lsatTID * = lastTID; (* typo *)
- noReselect * = 3; (* don't bother trying to perform reselection *)
- (* when talking to this drive *)
- diskID * = 4; (* rdbDisk... identification valid *)
- ctrlrID * = 5; (* rdbController... identification valid *)
-
- (* added 7/20/89 by commodore: *)
- synch * = 6; (* drive supports scsi synchronous mode *)
- (* CAN BE DANGEROUS TO USE IF IT DOESN'T! *)
-
- (* ------------------------------------------------------------------*)
-
- TYPE
-
- BadBlockEntryPtr * = POINTER TO BadBlockEntry;
- BadBlockEntry * = RECORD
- badBlock * : e.ULONG; (* block number of bad block *)
- goodBlock * : e.ULONG; (* block number of replacement block *)
- END; (* BadBlockEntry *)
-
- BadBlockBlockPtr * = POINTER TO BadBlockBlock;
- BadBlockBlock * = RECORD
- id * : e.ULONG; (* 4 character identifier *)
- summedLongs * : e.ULONG; (* size of this checksummed structure *)
- chkSum * : LONGINT; (* block checksum (longword sum to zero) *)
- hostID * : e.ULONG; (* SCSI Target ID of host *)
- next * : e.ULONG; (* block number of the next BadBlockBlock *)
- reserved * : e.ULONG;
- blockPairs * : ARRAY 61 OF BadBlockEntry;
- (* bad block entry pairs *)
- (* note [61] assumes 512 byte blocks *)
- END; (* BadBlockBlock *)
-
- CONST
-
- idNameBadBlock * = 42414442H; (* 'BADB' *)
-
- (* ------------------------------------------------------------------*)
-
- TYPE
-
- PartitionBlockPtr * = POINTER TO PartitionBlock;
- PartitionBlock * = RECORD
- id * : e.ULONG; (* 4 character identifier *)
- summedLongs * : e.ULONG; (* size of this checksummed structure *)
- chkSum * : LONGINT; (* block checksum (longword sum to zero) *)
- hostID * : e.ULONG; (* SCSI Target ID of host *)
- next * : e.ULONG; (* block number of the next PartitionBlock *)
- flags * : e.ULONG; (* see below for defines *)
- reserved1 * : ARRAY 2 OF e.ULONG;
- devFlags * : e.ULONG; (* preferred flags for OpenDevice *)
- driveName * : ARRAY 32 OF CHAR; (* preferred DOS device name: BSTR form *)
- (* (not used if this name is in use) *)
- reserved2 * : ARRAY 15 OF e.ULONG; (* filler to 32 longwords *)
- environment * : ARRAY 17 OF e.ULONG; (* environment vector for this partition *)
- eReserved * : ARRAY 15 OF e.ULONG; (* reserved for future environment vector *)
- END; (* PartitionBlock *)
-
- CONST
-
- idNamePartition * = 50415254H; (* 'PART' *)
-
- bootable * = 0; (* this partition is intended to be bootable *)
- (* (expected directories and files exist) *)
- noMount * = 1; (* do not mount this partition (e.g. manually *)
- (* mounted, but space reserved here) *)
-
- (* ------------------------------------------------------------------*)
-
- TYPE
-
- FileSysHeaderBlockPtr * = POINTER TO FileSysHeaderBlock;
- FileSysHeaderBlock * = RECORD
- id * : e.ULONG; (* 4 character identifier *)
- summedLongs * : e.ULONG; (* size of this checksummed structure *)
- chkSum * : LONGINT; (* block checksum (longword sum to zero) *)
- hostID * : e.ULONG; (* SCSI Target ID of host *)
- next * : e.ULONG; (* block number of next FileSysHeaderBlock *)
- flags * : e.ULONG; (* see below for defines *)
- reserved1 * : ARRAY 2 OF e.ULONG;
- dosType * : e.ULONG; (* file system description: match this with *)
- (* partition environment's deDOSTYPE entry *)
- version * : e.ULONG; (* release version of this code *)
- patchFlags * : e.ULONG; (* bits set for those of the following that *)
- (* need to be substituted into a standard *)
- (* device node for this file system: e.g. *)
- (* 180H to substitute SegList & GlobalVec *)
- type * : e.ULONG; (* device node type: zero *)
- task * : e.ULONG; (* standard dos "task" field: zero *)
- lock * : e.ULONG; (* not used for devices: zero *)
- handler * : e.ULONG; (* filename to loadseg: zero placeholder *)
- stackSize * : e.ULONG; (* stacksize to use when starting task *)
- priority * : LONGINT; (* task priority when starting task *)
- startup * : LONGINT; (* startup msg: zero placeholder *)
- segListBlocks * : LONGINT; (* first of linked list of LoadSegBlocks: *)
- (* note that this entry requires some *)
- (* processing before substitution *)
- globalVec * : LONGINT; (* BCPL global vector when starting task *)
- reserved2 * : ARRAY 23 OF e.ULONG; (* (those reserved by PatchFlags) *)
- reserved3 * : ARRAY 21 OF e.ULONG;
- END; (* FileSysHeaderBlock *)
-
- CONST
-
- idNameFileSysHeader * = 46534844H; (* 'FSHD' *)
-
- (* ------------------------------------------------------------------*)
-
- TYPE
-
- LoadSegBlockPtr * = POINTER TO LoadSegBlock;
- LoadSegBlock * = RECORD
- id * : e.ULONG; (* 4 character identifier *)
- summedLongs * : e.ULONG; (* size of this checksummed structure *)
- chkSum * : LONGINT; (* block checksum (longword sum to zero) *)
- hostID * : e.ULONG; (* Target ID of host *)
- next * : e.ULONG; (* block number of the next LoadSegBlock *)
- loadData * : ARRAY 123 OF e.ULONG; (* data for "loadseg" *)
- (* note [123] assumes 512 byte blocks *)
- END; (* LoadSegBlock *)
-
- CONST
-
- idNameLoadSeg * = 4C534547H; (* 'LSEG' *)
-
-
- END HardBlocks.
-