[sebhc] HUG disk mismatch
Dan Lanciani
ddl-cctech at danlan.com
Wed Sep 1 17:41:05 CDT 2004
"Steven Parker" <sp11 at hotmail.com> wrote:
|>Which one failed to match?
|
|885-1020. Download the one from the archives and compare it to yours. It's
|possible the differences might only be due to a change in the manufacturing
|process and appear only in unused sectors, but I haven't confirmed that yet.
I don't have 885-1020, so I'm going to assume you mean 1120. I checked this
and while the disk differs, the files are identical. By the way, there is
no need to load the images on a real or virtual disk. I wrote this little
utility to verify an HDOS disk and (optionally with the -e switch) extract
the files:
#include <stdio.h>
unsigned char buf[2560], z[256], gl[256], grt[256], buf2[2048];
int diag, extract;
main(argc, argv)
char **argv;
{
register int i, j;
int t = 0, dirsec, grtsec, spg, n;
char nbuf[16];
register char *p;
again:
if(argc > 1 && !strcmp(argv[1], "-d")) {
diag = 1;
argc--;
argv++;
goto again;
}
if(argc > 1 && !strcmp(argv[1], "-e")) {
extract = 1;
argc--;
argv++;
goto again;
}
for(i = 0; i < 256; i += 2) {
gl[i] = 'G';
gl[i+1] = 'L';
}
while(read(0, buf, sizeof(buf)) == sizeof(buf)) {
if(t == 0) {
printf("ver = %x, spg = %d, type = %d, size = %d, ssize = %d, dir = %d, grt = %d\n",
buf[9*256+9], spg = buf[9*256+7], buf[9*256+8],
buf[9*256+12] + 256*buf[9*256+13],
buf[9*256+14] + 256*buf[9*256+15],
dirsec = buf[9*256+3] + 256*buf[9*256+4],
grtsec = buf[9*256+5] + 256*buf[9*256+6]);
}
if(diag) {
for(i = 0; i < 10; i++)
if(!memcmp(buf + 256*i, z, 256))
printf("track %d sector %d is zero\n", t, i);
for(i = 0; i < 9; i++)
for(j = i + 1; j < 10; j++)
if(!memcmp(buf + 256*i, buf + 256*j, 256) &&
memcmp(buf + 256*i, z, 256) &&
memcmp(buf + 256*i, gl, 256))
printf("track %d sector %d=%d %c %c\n",
t, i, j, buf[256*i],
buf[256*i+1]);
}
t++;
}
lseek(0, 256L*grtsec, 0);
read(0, grt, 256);
while(dirsec) {
printf("Directory sector = %d\n", dirsec);
lseek(0, 256L*dirsec, 0);
if(read(0, buf, 512) != 512) {
perror("directory read");
exit(1);
}
if(dirsec != (i = buf[508] + 256*buf[509])) {
fprintf(stderr, "Bad directory self ptr = %d\n", i);
exit(1);
}
for(i = 0; i < 22; i++) {
if(buf[23*i] == 0377 || buf[23*i] == 0376)
continue;
p = nbuf;
for(j = 0; j < 8; j++) {
printf("%c", *p = buf[23*i+j]);
if(*p > ' ')
p++;
}
*p++ = '.';
printf(".");
for(j = 8; j < 11; j++) {
printf("%c", *p = buf[23*i+j]);
if(*p > ' ')
p++;
}
*p = 0;
printf(" first=%d last=%d tail=%d ", j=buf[23*i+16],
buf[23*i+17], buf[23*i+18]);
if(buf[23*i+18] > spg) {
fprintf(stderr, "\nTail too big\n");
exit(1);
}
if(extract) {
if((n = creat(nbuf, 0666)) < 0) {
fprintf(stderr, "\n");
perror(nbuf);
exit(1);
}
}
while(j != buf[23*i+17]) {
printf("[%d] ", j);
lseek(0, j*256L*spg, 0);
if(read(0, buf2, 256*spg) != 256*spg) {
perror("file read");
exit(1);
}
if(extract)
write(n, buf2, 256*spg);
j = grt[j];
}
printf("[%d]\n", j);
if(grt[j])
fprintf(stderr, "Non-zero grt on last group\n");
lseek(0, j*256L*spg, 0);
if(read(0, buf2, 256*buf[23*i+18]) != 256*buf[23*i+18]){
perror("file tail read");
exit(1);
}
if(extract) {
write(n, buf2, 256*buf[23*i+18]);
close(n);
}
}
dirsec = buf[510] + 256*buf[511];
}
}
--
Delivered by the SEBHC Mailing List
More information about the Sebhc
mailing list