summaryrefslogtreecommitdiffstats
path: root/lib/libdisk
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-10-31 04:25:17 +0000
committerjake <jake@FreeBSD.org>2002-10-31 04:25:17 +0000
commit3523a0f8a2e470ddbcd793e5f85b8634e82ad631 (patch)
tree38450cdfb6b6c8be88f1a68a5820b4e5f3f6dc5f /lib/libdisk
parent4b5486a5f607d3ccf2c1fd497a98ce2c10c7dbfa (diff)
downloadFreeBSD-src-3523a0f8a2e470ddbcd793e5f85b8634e82ad631.zip
FreeBSD-src-3523a0f8a2e470ddbcd793e5f85b8634e82ad631.tar.gz
Actually save the bootblock in the disk structure. Write the bootblock
to the right place on the disk instead of srewn all over it.
Diffstat (limited to 'lib/libdisk')
-rw-r--r--lib/libdisk/disk.c7
-rw-r--r--lib/libdisk/write_sparc64_disk.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c
index bc4ce3d..1c67115 100644
--- a/lib/libdisk/disk.c
+++ b/lib/libdisk/disk.c
@@ -425,6 +425,13 @@ Set_Boot_Blocks(struct disk *d, const u_char *b1, const u_char *b2)
d->boot1 = malloc(15 * 512);
if(!d->boot1) return -1;
memcpy(d->boot1, b1, 15 * 512);
+#elif defined(__sparc64__)
+ if (d->boot1 != NULL)
+ free(d->boot1);
+ d->boot1 = malloc(16 * 512);
+ if (d->boot1 == NULL)
+ return (-1);
+ memcpy(d->boot1, b1, 16 * 512);
#elif defined(__ia64__)
/* nothing */
#else
diff --git a/lib/libdisk/write_sparc64_disk.c b/lib/libdisk/write_sparc64_disk.c
index 87b67a5..657b947 100644
--- a/lib/libdisk/write_sparc64_disk.c
+++ b/lib/libdisk/write_sparc64_disk.c
@@ -90,8 +90,8 @@ Write_Disk(const struct disk *d1)
write_block(fd, 0, sl, sizeof *sl);
- for(i = 1; i < 16; i++)
- write_block(fd, i * 512, d1->boot1 + 512 * (i - 1), 512);
+ for (i = 1; i < 16; i++)
+ write_block(fd, i, d1->boot1 + (i * 512), 512);
close(fd);
return 0;
OpenPOWER on IntegriCloud