***********************************************************
*       HARD DISK PHYSICAL COMMANDS VERIFICATION SCRIPT   *
*                                                         *
*   Directions for use:                                   *
*                                                         *
*     - Execute the Device Driver Test Tool against this  *
*       script:  DDTT DASDSTD1.SCR                        *
*                                                         *
*     - Enter target physical hard drive number for test  *
*       in DDTT response window when prompted.            *
*       (Such as 1: for primary drive.)                   *
*                                                         *
*     - Check log file DASDSTD1.LOG to ensure that no     *
*       failures occurred.                                *
*                                                         *
*     - Check log to ensure that physical parameters for  *
*       head, cylinder, and sector count match those for  *
*       each physical drive.                              *
***********************************************************
@thread DASDSTD1.LOG
@NewAlias fd DASD.GRA
fd set HDR="========================================================"
fd OUT $KWD=HDR
fd LOG $PROMPT="        HARD DISK TEST SCRIPT:  PHYSICAL COMMANDS"
fd OUT $KWD=HDR
*
*fd RESPONSE $PROMPT="ENTER TARGET DISK NUMBER WITH COLON" $PAUSE=-1 $RESPONSE=DISKNUMBER
fd SET DISKNUMBER="1:"
fd SET CMD="OPEN FOLLOWING PHYSICAL DISK - "
fd OUT $KWD=CMD
fd OUT $KWD=DISKNUMBER
*
fd OPEN_PHYSICAL
*
fd SET CMD="GET PHYSICAL DISK COUNT"
fd OUT $KWD=CMD
fd GET_DISK_COUNT
*
fd SET CMD="READ PHYSICAL DISK PARAMETERS"
fd OUT $KWD=CMD
fd GET_PHYSICAL_PARAMS
fd OUT $KWD=CYLINDERCOUNT
fd OUT $KWD=TRACKSIZE
fd OUT $KWD=HEADCOUNT
*
fd SET HEAD=0         \
       CYLINDER=0     \
       SECTORSTART=1  \
       SECTORCOUNT=1  \
       SECTORSIZE=512 \
       $BUFFER=ALPHA
*
fd SET MSG="READ DISK AT 0-0-1"
fd OUT $KWD=MSG
fd CLEAR $BUFFER=ALPHA
fd READ_PHYSICAL
*
fd SET HEAD=0         \
       CYLINDER=1     \
       SECTORSTART=0
*
fd SET MSG="READ DISK AT 0-1-0"
fd OUT $KWD=MSG
fd CLEAR $BUFFER=ALPHA
fd READ_PHYSICAL
*
fd SET HEAD=1         \
       CYLINDER=0     \
       SECTORSTART=0
*
fd SET MSG="READ DISK AT 1-0-0"
fd OUT $KWD=MSG
fd CLEAR $BUFFER=ALPHA
fd READ_PHYSICAL
*
fd SET $COUNT = $(CYLINDERCOUNT)
fd DECREMENT
fd SET CYLINDER=$($COUNT)
fd SET $COUNT = $(TRACKSIZE)
fd DECREMENT
fd SET SECTORSTART=$($COUNT)
fd SET HEAD=1
*
fd SET MSG="READ DISK AT HEADCOUNT=1, CYLINDERCOUNT-1, TRACKSIZE-1"
fd OUT $KWD=MSG
fd OUT $KWD=HEAD
fd OUT $KWD=CYLINDER
fd OUT $KWD=SECTORSTART
fd CLEAR $BUFFER=ALPHA
fd READ_PHYSICAL
*
fd SET HEAD=5         \
       SECTORSTART=0  \
       CYLINDER=20    \
       SECTORCOUNT=2  \
       SECTORSIZE=512 \
       $BUFFER=ALPHA  \
       $COUNT=10
*
fd SET MSG="READ DISK IN A CYLINDER LOOP OF 10"
fd OUT $KWD=MSG
@loop 10
fd CLEAR $BUFFER=ALPHA
fd SET CYLINDER=$($COUNT)
fd OUT $KWD=CYLINDER
fd READ_PHYSICAL
fd INCREMENT
@endloop
*
fd SET CMD="CLOSE PHYSICAL DISK"
fd OUT $KWD=CMD
fd CLOSE_PHYSICAL
*
fd SET MS="============================================================"
fd OUT $KWD=MS
*
fd SET CMD="OPEN PHYSICAL DISK"
fd OUT $KWD=CMD
fd OPEN_PHYSICAL
*
fd SET CMD="READ PHYSICAL DISK PARAMETERS"
fd OUT $KWD=CMD
fd GET_PHYSICAL_PARAMS
fd OUT $KWD=CYLINDERCOUNT
fd OUT $KWD=TRACKSIZE
fd OUT $KWD=HEADCOUNT
*
fd SET CYLINDER=20    \
       SECTORSTART=1  \
       SECTORCOUNT=8  \
       SECTORSIZE=512 \
       $BUFFER=BETA   \
       $COUNT=1
*
fd SET MSG="VERIFY DISK IN A HEAD LOOP OF 10"
fd OUT $KWD=MSG
@loop 10
fd SET HEAD=$($COUNT)
fd OUT $KWD=HEAD
fd VERIFY_PHYSICAL
fd INCREMENT
@endloop
*
fd SET $COUNT = $(CYLINDERCOUNT)
fd DECREMENT
fd SET CYLINDER=$($COUNT)
fd SET SECTORCOUNT=1  \
       SECTORSIZE=512 \
       $BUFFER=GAMMA
fd SET HEAD=10
fd SET $COUNT=0
*
fd SET MSG="READ/WRITE DISK IN A SECTOR LOOP OF 10"
fd OUT $KWD=MSG
@loop 10
fd CLEAR $BUFFER=GAMMA
fd SET SECTORSTART=$($COUNT)
fd OUT $KWD=SECTORSTART
fd READ_PHYSICAL
fd WRITE_PHYSICAL
fd INCREMENT
@endloop
*
fd SET CMD="UNLOCK PHYSICAL DISK"
fd OUT $KWD=CMD
fd UNLOCK_PHYSICAL
*
fd SET CMD="CLOSE PHYSICAL DISK"
fd OUT $KWD=CMD
fd CLOSE_PHYSICAL
*
@flush fd
