Index: src/sbin/newfs_msdos/newfs_msdos.c =================================================================== RCS file: /cvs/private/src/sbin/newfs_msdos/newfs_msdos.c,v retrieving revision 1.1.3.1 retrieving revision 1.1.3.1.2.1 diff -u -r1.1.3.1 -r1.1.3.1.2.1 --- src/sbin/newfs_msdos/newfs_msdos.c 2000/08/07 12:24:19 1.1.3.1 +++ src/sbin/newfs_msdos/newfs_msdos.c 2000/09/14 15:04:32 1.1.3.1.2.1 @@ -65,6 +65,8 @@ #define MAXCLS16 0xfff5 /* maximum FAT16 clusters */ #define MAXCLS32 0xffffff5 /* maximum FAT32 clusters */ +#define MBR_SIZE 512 /* size of MBR */ + #define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) @@ -615,17 +617,17 @@ setstr(bs->oem, opt_O ? opt_O : "BSD 4.4", sizeof(bs->oem)); memcpy(img + x1, bootcode, sizeof(bootcode)); - mk2(img + bpb.bps - 2, DOSMAGIC); + mk2(img + MBR_SIZE - 2, DOSMAGIC); } } else if (fat == 32 && bpb.infs != MAXU16 && (lsn == bpb.infs || (bpb.bkbs != MAXU16 && lsn == bpb.bkbs + bpb.infs))) { mk4(img, 0x41615252); - mk4(img + bpb.bps - 28, 0x61417272); - mk4(img + bpb.bps - 24, 0xffffffff); - mk4(img + bpb.bps - 20, bpb.rdcl); - mk2(img + bpb.bps - 2, DOSMAGIC); + mk4(img + MBR_SIZE - 28, 0x61417272); + mk4(img + MBR_SIZE - 24, 0xffffffff); + mk4(img + MBR_SIZE - 20, bpb.rdcl); + mk2(img + MBR_SIZE - 2, DOSMAGIC); } else if (lsn >= bpb.res && lsn < dir && !((lsn - bpb.res) % (bpb.spf ? bpb.spf : bpb.bspf))) {