/* drtest.c 4.1 82/12/26 */
* Standalone program to test a disk driver by reading
* every sector on the disk in chunks of CHUNK.
char buf
[50], buffer
[CHUNK
*512];
register struct upst
*st
;
printf("Testprogram for stand-alone hp or up driver\n");
printf("Enter device name (e.g, hp(0,0) ) or q to quit >");
unit
= (int)*(buf
+3) - '0';
if (unit
<0 || unit
> 3 ) {
printf("unit number out of range\n");
if ((fd
=open(buf
,0)) < 0) {
printf("Can't open %s \n",buf
);
st
= &upst
[up_type
[unit
]];
st
= (struct upst
*)&hpst
[hp_type
[unit
]];
printf("Illegal device name\n");
printf("Testing %s\n",buf
);
printf("Start ...Make sure %s is online\n",buf
);
for (i
=0;i
< st
->ncyl
;i
++) {
for (j
=8;j
<st
->ntrak
+8;j
++) {
lseek(fd
,(i
*st
->nspc
+((j
%st
->ntrak
)*st
->nsect
))*512,0);
read(fd
,buffer
, chunk
*512);