1 /*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * %sccs.include.noredist.c% 9 * 10 * @(#)dlbl.c 7.1 (Berkeley) 04/24/90 11 */ 12 13 #include "../h/param.h" 14 #include "../h/inode.h" 15 #include "../h/fs.h" 16 #include "../h/dkbad.h" 17 #include "../h/disk.h" 18 19 struct bb { 20 char bufr[LABELOFFSET]; 21 struct disklabel w; 22 } xx,yy; 23 struct disklabel *dlp; 24 extern struct disklabel wdsizes[2]; 25 26 27 struct dkbad dkbad; 28 29 main() { 30 int fi,x; 31 32 xx.bufr[0] = 126; 33 xx.bufr[LABELOFFSET-1] = 125; 34 xx.w.dk_magic = 0xabc; 35 xx.w.dk_type = 1; 36 xx.w.dk_secsize = 512; 37 xx.w.dk_nsectors = 17; 38 xx.w.dk_ntracks = 8; 39 xx.w.dk_ncylinders = 615; 40 xx.w.dk_secpercyl = 17*8; 41 xx.w.dk_secperunit = (612-290)*17*8; 42 xx.w.dk_precompcyl = 616; 43 xx.w.dk_partition[0].nblocks = (611-290)*17*8; 44 xx.w.dk_partition[0].cyloff = 290; 45 xx.w.dk_partition[1].nblocks = (611-290)*17*8; 46 xx.w.dk_partition[1].cyloff = 290; 47 xx.w.dk_partition[2].nblocks = (611-290)*17*8; 48 xx.w.dk_partition[2].cyloff = 290; 49 xx.w.dk_name[0]= 'a'; 50 xx.w.dk_name[1]= 'b'; 51 xx.w.dk_name[2]= 'c'; 52 xx.w.dk_name[3]= '\0'; 53 dlp = &xx.w; 54 fi = open("wd0a:", 2); 55 wdsizes[0] = *dlp; 56 lseek(fi,0,0); 57 write(fi,&xx,512); 58 /*for (x=0; x <17; x++) */write(fi,&xx, 512); 59 /*for (x=0; x <17; x++)*/ read(fi,&yy, 512); 60 exit(-1); 61 } 62