SCCS-vsn: sys/vax/stand/format.c 6.2
-/* format.c 6.1 83/07/29 */
+/* format.c 6.2 83/09/18 */
/*
* Standalone program to do media checking
* and record bad block information on any
/*
* Standalone program to do media checking
* and record bad block information on any
- * disk with the appropriate driver.
+ * disk with the appropriate driver and RM03-style headers.
*/
#include "../h/param.h"
#include "../h/fs.h"
*/
#include "../h/param.h"
#include "../h/fs.h"
#define NERRORS 6
static char *
errornames[NERRORS] = {
#define NERRORS 6
static char *
errornames[NERRORS] = {
-#define FE_WCE 0
- "Write check",
-#define FE_BSE 1
+#define FE_WCE 1
+ "Write check",
#define FE_ECC 2
"ECC",
#define FE_HARD 3
#define FE_ECC 2
"ECC",
#define FE_HARD 3
bb_buf.header2 = btp->bt_trksec;
bn = st->nspc * btp->bt_cyl +
st->nsect * (btp->bt_trksec >> 8) +
bb_buf.header2 = btp->bt_trksec;
bn = st->nspc * btp->bt_cyl +
st->nsect * (btp->bt_trksec >> 8) +
- (btp->bt_trksec & 0x1f);
+ (btp->bt_trksec & 0xff);
lseek(fd, bn * SECTSIZ, 0);
ioctl(fd, SAIOHDR, (char *)0);
write(fd, &bb_buf, sizeof (bb_buf));
lseek(fd, bn * SECTSIZ, 0);
ioctl(fd, SAIOHDR, (char *)0);
write(fd, &bb_buf, sizeof (bb_buf));
* If skip sector, mark all remaining
* sectors on the track.
*/
* If skip sector, mark all remaining
* sectors on the track.
*/
- for (j = (btp->bt_trksec & 0x1f) + 1; j < st->nsect; j++) {
+ for (j = (btp->bt_trksec & 0xff) + 1; j < st->nsect; j++) {
bb_buf.header1 = j | HDR1_FMT22 | HDR1_SSF;
ioctl(fd, SAIOHDR, (char *)0);
write(fd, &bb_buf, sizeof (bb_buf));
bb_buf.header1 = j | HDR1_FMT22 | HDR1_SSF;
ioctl(fd, SAIOHDR, (char *)0);
write(fd, &bb_buf, sizeof (bb_buf));
printf("Too many skip sector errors\n");
return;
}
printf("Too many skip sector errors\n");
return;
}
- if (errno <= ECMD || errno > EHER)
+ if (errno < EBSE || errno > EHER)
errors[errno]++;
cn = bn / st->nspc;
sn = bn % st->nspc;
errors[errno]++;
cn = bn / st->nspc;
sn = bn % st->nspc;
cn = -cn;
}
/* record the bad sector address and continue */
cn = -cn;
}
/* record the bad sector address and continue */
- dkbad.bt_bad[errors[FE_TOTAL]++].bt_cyl = cn;
+ dkbad.bt_bad[errors[FE_TOTAL]].bt_cyl = cn;
dkbad.bt_bad[errors[FE_TOTAL]++].bt_trksec = (tn << 8) + sn;
}
dkbad.bt_bad[errors[FE_TOTAL]++].bt_trksec = (tn << 8) + sn;
}