# "@(#)fujicertify	5.1	6/10/86"
echoln '################################################'
echoln '#               FUJICERTIFY                    #'
echoln '#  SUS Script for testing Fujitsu Disc Drives  #'
echoln '#    If number of units to test is one then    #'
echoln '#    the  user can  specify  the  number of    #'
echoln '#         times to certify the unit.           #'
echoln '################################################'
dec
eval u=0
unit u
repeat
echo 'Enter Number of Units to test : '
read y
until (y>0)&&(y<5)
pci
echo 'Enter Number of Pages  on Drive ' u ' : '
read a
echo 'Enter Number of Tracks per Head on Drive ' u ' : '
read b
if y==1
 do
  eval n=1
  echo 'Enter Number of times to Certify Disc : '
  read n
 done
fi
echoln
if y==1
 do
   echoln 'Insert BadBlock Floppy for this Fujitsu Drive'
   echo   ' Hit Return to Continue ... '
   read z
   echo   'Reading BadBlock file '
   rbb
   echoln
   echoln 'Reinsert SUS Floppy '
   echo   'Hit Return to Continue ...'
   read z
 done
else
 do
   echoln 'For Multiple Drive Certify the SUS floppy must'
   echoln ' contain a BadBlock file for each drive to be '
   echoln ' tested.  Each of these  file names should be '
   echoln ' appended with the unit number. BadBlocks[0-3]'
   echo   ' Type return to continue ...'
   read z
 done
fi
repeat
if y>1
 do
  echo 'Reading BadBlocks for Drive ' u ' ...'
  if u==0
   rbb BadBlocks0
  else
   if u==1
     rbb BadBlocks1
   else
     if u==2
       rbb BadBlocks2
     else
       rbb BadBlocks3
     fi
   fi
  fi
  echoln
 done
fi
echoln
echoln '***Starting Certify of Fujitsu Disc Drive ' u '***'
echoln '     Can be terminated with LoadEn Off      '
eval z=0
if y>1
  repeat
    seek rand>>16%b
    certify z 1
    eval z=z+1
  until (z>=a)||(!lden)
else
  for m=1 (m<=n)&&(lden) m=m+1
   do
     repeat
       seek rand>>16%b
       certify z 1
       eval z=z+1
     until (z>=a)||(!lden)
     echoln '-->End of pass ' m
     eval z=0
   done
fi
if y==1
  wsb suspectblocks
else 
 do
  if u==0
    wsb suspectblocks0
  else
    if u==1
      wsb suspectblocks1
    else
      if u==2
        wsb suspectblocks2
      else
        wsb suspectblocks3
      fi
    fi
  fi
 done
fi
if z>=a
  echoln '>>>>  Certify Complete on Drive ' u '  <<<<'
fi
lsp
eval u=u+1
if u<y 
  unit u
fi
until (u>=y)||(!lden)
unit 0
echoln 'If Page Count is not Zero then there are new Bad Spots on this Disc'
echoln 'which were not in the BadBlock file,  SuspectBlock file has been'
echoln 'written to floppy.'
