mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-21 21:04:43 +02:00
If FAT32 and a "backup boot sector" exists, also update the
backup boot sector to the contents of the main boot sector. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1356 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
b08c612f36
commit
0b8ae53670
20
sys/sys.c
20
sys/sys.c
@ -898,7 +898,7 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
{
|
{
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("writing new bootsector to drive %c:\n", drive + 'A');
|
printf("Writing new bootsector to drive %c:\n", drive + 'A');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* write newboot to a drive */
|
/* write newboot to a drive */
|
||||||
@ -907,6 +907,22 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
printf("Can't write new boot sector to drive %c:\n", drive + 'A');
|
printf("Can't write new boot sector to drive %c:\n", drive + 'A');
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fs==FAT32)
|
||||||
|
{
|
||||||
|
bs32 = (struct bootsectortype32 *)&newboot;
|
||||||
|
if ((bs32->bsBackupBoot > 0) && (bs32->bsBackupBoot < bs32->bsResSectors))
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("Writing backup of new bootsector to drive %c:\n", drive + 'A');
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* write backup of newboot to a drive (errors acceptable here) */
|
||||||
|
if (MyAbsReadWrite(drive, 1, bs32->bsBackupBoot, newboot, 1) != 0)
|
||||||
|
printf("Can't write backup of new boot sector to drive %c:\n", drive + 'A');
|
||||||
|
} /* backup*/
|
||||||
|
} /* fat32 */
|
||||||
} /* if write boot sector */
|
} /* if write boot sector */
|
||||||
|
|
||||||
if (bsFile != NULL)
|
if (bsFile != NULL)
|
||||||
@ -914,7 +930,7 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("writing new bootsector to file %s\n", bsFile);
|
printf("Writing new bootsector to file %s\n", bsFile);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* write newboot to bsFile */
|
/* write newboot to bsFile */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user