#include #include #include #include #include #include main(int argc, char ** argv) { int disk; struct fs *ufs; struct dk_label label; short i; unsigned short sum, *word; if ( -1 == ( disk = open( argv[1], O_RDONLY ))) { perror(argv[1]); exit(1); } else { if ( sizeof(label) != read( disk, &label, sizeof(label) )) perror("read label"); close(disk); fprintf(stdout,"%s\n",label.dkl_asciilabel); /* dkl_pad */ fprintf(stdout,"%u\trotations per minute\n",label.dkl_rpm); fprintf(stdout,"%u\tphysical cylinders\n",label.dkl_pcyl); fprintf(stdout,"%u\talternates per cylinder\n",label.dkl_apc); fprintf(stdout,"%u\tinterleave factor\n",label.dkl_intrlv); fprintf(stdout,"%u\tdata cylinders\n",label.dkl_ncyl); fprintf(stdout,"%u\talternate cylinders\n",label.dkl_acyl); fprintf(stdout,"%u\theads in this partition\n",label.dkl_nhead); fprintf(stdout,"%u\t512 byte sectors per track\n",label.dkl_nsect); fprintf(stdout,"\t(This makes a %d Mb disk)\n", label.dkl_ncyl * label.dkl_nhead * label.dkl_nsect * 512 / 1024 / 1024); for( i=0; i