add DEL as an erase character
[unix-history] / usr / src / sys / vax / stand / drtest.c
index e354a89..757d042 100644 (file)
@@ -1,4 +1,10 @@
-/*     drtest.c        4.10    83/03/01        */
+/*
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)drtest.c    6.2 (Berkeley) %G%
+ */
 
 /*
  * Standalone program to test a disk and driver
 
 /*
  * Standalone program to test a disk and driver
@@ -29,18 +35,19 @@ again:
        if (debug < 0)
                debug = 0;
        fd = getdevice();
        if (debug < 0)
                debug = 0;
        fd = getdevice();
-       ioctl(fd, SAIODEVDATA, &st);
+       ioctl(fd, SAIODEVDATA, (char *)&st);
        printf("Device data: #cylinders=%d, #tracks=%d, #sectors=%d\n",
                st.ncyl, st.ntrak, st.nsect);
        printf("Device data: #cylinders=%d, #tracks=%d, #sectors=%d\n",
                st.ncyl, st.ntrak, st.nsect);
-       ioctl(fd, SAIODEBUG, &debug);
+       ioctl(fd, SAIODEBUG, (char *)debug);
        tracksize = st.nsect * SECTSIZ;
        tracksize = st.nsect * SECTSIZ;
+       bp = malloc(tracksize);
        printf("Reading in %d byte records\n", tracksize);
        printf("Start ...make sure drive is on-line\n");
        lseek(fd, 0, 0);
        printf("Reading in %d byte records\n", tracksize);
        printf("Start ...make sure drive is on-line\n");
        lseek(fd, 0, 0);
-       lastsector = st.ncyl * st.ntrak;
-       for (sector = 0; sector < lastsector; sector++) {
+       lastsector = st.ncyl * st.nspc;
+       for (sector = 0; sector < lastsector; sector += st.nsect) {
                if (sector && (sector % (st.nspc * 10)) == 0)
                if (sector && (sector % (st.nspc * 10)) == 0)
-                       printf("sector %d\n", sector);
+                       printf("cylinder %d\n", sector/st.nspc);
                read(fd, bp, tracksize);
        }
        goto again;
                read(fd, bp, tracksize);
        }
        goto again;