Actually save the bootblock in the disk structure. Write the bootblock

to the right place on the disk instead of srewn all over it.
This commit is contained in:
Jake Burkholder 2002-10-31 04:25:17 +00:00
parent cbde04a9b7
commit e03494dd17
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106232
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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;