mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 19:52:44 +00:00
The newfs_msdos utility does not store the boot signature in the
correct place on large sector disks. The boot signature should be at offset 0x1fe in the BPB; newfs_msdos currently stores it 2 bytes from the end of the sector. Taken from: NetBSD
This commit is contained in:
parent
1ecf009e5c
commit
93c26a8293
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170166
@ -54,7 +54,7 @@ static const char rcsid[] =
|
||||
#define NPB 2 /* nibbles per byte */
|
||||
|
||||
#define DOSMAGIC 0xaa55 /* DOS magic number */
|
||||
#define MINBPS 128 /* minimum bytes per sector */
|
||||
#define MINBPS 512 /* minimum bytes per sector */
|
||||
#define MAXSPC 128 /* maximum sectors per cluster */
|
||||
#define MAXNFT 16 /* maximum number of FATs */
|
||||
#define DEFBLK 4096 /* default block size */
|
||||
@ -623,17 +623,17 @@ main(int argc, char *argv[])
|
||||
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 + MINBPS - 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 + MINBPS - 28, 0x61417272);
|
||||
mk4(img + MINBPS - 24, 0xffffffff);
|
||||
mk4(img + MINBPS - 20, bpb.rdcl);
|
||||
mk2(img + MINBPS - 2, DOSMAGIC);
|
||||
} else if (lsn >= bpb.res && lsn < dir &&
|
||||
!((lsn - bpb.res) %
|
||||
(bpb.spf ? bpb.spf : bpb.bspf))) {
|
||||
|
Loading…
Reference in New Issue
Block a user