/* drtest.c 4.7 83/02/04 */
/* Standalone program to test a disk driver by reading every sector on
* the disk in chunks of CHUNK.
char diskname
[] = "xx(00,0)";
char buf
[50], buffer
[CHUNK
*SECTSIZ
];
printf("Testprogram for stand-alone hp or up driver\n\n");
printf("Enter disk name [ type(adapter,unit), e.g, hp(1,3) ] > ");
unit
= (*(buf
+3) - '0')*8 + *(buf
+5)-'0';
diskname
[3] = '0' + unit
/10;
diskname
[4] = '0' + unit
%10;
if ((fd
=open(diskname
,0)) < 0) {
ioctl(fd
,SAIODEVDATA
,&st
);
printf("Device data: #cylinders=%d, #tracks=%d, #sectors=%d\n",
st
.ncyl
, st
.ntrak
, st
.nsect
);
chunk
= st
.nsect
*SECTSIZ
;
printf("Testing %s, chunk size is %d bytes\n",buf
, chunk
);
printf("Start ...Make sure %s is online\n",buf
);
for (i
=0;i
< st
.ncyl
*st
.ntrak
; i
++) {
/* for (j=8;j<st.ntrak+8;j++) {
lseek(fd,(i*st.nspc+((j%st.ntrak)*st.nsect))*SECTSIZ,0);
if (i
%(st
.ntrak
*5) == 0) printf("%d\r",i
/st
.ntrak
);