summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/write_disk.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-07-12 18:05:18 +0000
committerjhb <jhb@FreeBSD.org>2000-07-12 18:05:18 +0000
commitb4c0d6aa68030b0d552c9dc5ca7eb8f0c83657ee (patch)
treebb22442a95d7324f2129888d91a7b8c5faed272e /lib/libdisk/write_disk.c
parent97196fa3a13e134bf65ff8bebbe8203fd3660634 (diff)
downloadFreeBSD-src-b4c0d6aa68030b0d552c9dc5ca7eb8f0c83657ee.zip
FreeBSD-src-b4c0d6aa68030b0d552c9dc5ca7eb8f0c83657ee.tar.gz
- Allow support for MBR boot loaders that are longer than one sector. As
with fdisk, ensure that they are a multiple of the sector size in length. - Axe all the 1024 cylinder checks as they are no longer relevant with the fixed bootstrap.
Diffstat (limited to 'lib/libdisk/write_disk.c')
-rw-r--r--lib/libdisk/write_disk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index d839f63..80ef12a 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -354,6 +354,9 @@ Write_Disk(struct disk *d1)
mbr[512-2] = 0x55;
mbr[512-1] = 0xaa;
write_block(fd,WHERE(0,d1),mbr);
+ if (d1->bootmgr && d1->bootmgr_size > 512)
+ for(i = 1; i * 512 <= d1->bootmgr_size; i++)
+ write_block(fd,WHERE(i,d1),&d1->bootmgr[i * 512]);
#endif
#endif
OpenPOWER on IntegriCloud