mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-23 22:04:33 +02:00
simpler output in case of unpartitioned disks (don't repeat error messages)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1101 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
29dc31dfe2
commit
2fc18e7c33
@ -149,13 +149,7 @@ COUNT nUnits BSS_INIT(0);
|
|||||||
* CHS or LBA, strengthening its role as a rescue environment.
|
* CHS or LBA, strengthening its role as a rescue environment.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* #define DEBUG */
|
#include "debug.h"
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
#define DebugPrintf(x) printf x
|
|
||||||
#else
|
|
||||||
#define DebugPrintf(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LBA_to_CHS init_LBA_to_CHS
|
#define LBA_to_CHS init_LBA_to_CHS
|
||||||
|
|
||||||
@ -1029,6 +1023,15 @@ BOOL Read1LBASector(struct DriveParamS *driveParam, unsigned drive,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Load the Partition Tables and get information on all drives */
|
/* Load the Partition Tables and get information on all drives */
|
||||||
|
/* If scanType != SCAN_EXTENDED then we return with the
|
||||||
|
lower four bits set (valid partition, drive added) or clear
|
||||||
|
(unhandled or invalid) for each partition entry in the
|
||||||
|
partition table, or 0 when scanType == SCAN_EXTENDED.
|
||||||
|
If we are unable to obtain the disk parameters for drive,
|
||||||
|
then we return -1 (usually means BIOS returned a count
|
||||||
|
higher than drives that exists; ISOLINUX may do this and
|
||||||
|
from RBIL may occur in some BIOSes).
|
||||||
|
*/
|
||||||
int ProcessDisk(int scanType, unsigned drive, int PartitionsToIgnore)
|
int ProcessDisk(int scanType, unsigned drive, int PartitionsToIgnore)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1047,8 +1050,9 @@ int ProcessDisk(int scanType, unsigned drive, int PartitionsToIgnore)
|
|||||||
|
|
||||||
if (!LBA_Get_Drive_Parameters(drive, &driveParam))
|
if (!LBA_Get_Drive_Parameters(drive, &driveParam))
|
||||||
{
|
{
|
||||||
|
if (scanType == SCAN_PRIMARYBOOT) /* only display 1st time through */
|
||||||
printf("can't get drive parameters for drive %02x\n", drive);
|
printf("can't get drive parameters for drive %02x\n", drive);
|
||||||
return PartitionsToIgnore;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
RelSectorOffset = 0; /* boot sector */
|
RelSectorOffset = 0; /* boot sector */
|
||||||
@ -1079,7 +1083,10 @@ strange_restart:
|
|||||||
if (++strangeHardwareLoop < 3)
|
if (++strangeHardwareLoop < 3)
|
||||||
goto strange_restart;
|
goto strange_restart;
|
||||||
|
|
||||||
printf("illegal partition table - drive %02x sector %lu\n", drive,
|
if (scanType == SCAN_PRIMARYBOOT) /* only display 1st time through */
|
||||||
|
printf("corrupt or unpartitioned drive %02x\n", drive);
|
||||||
|
else if (RelSectorOffset /* && (scanType == SCAN_EXTENDED) */)
|
||||||
|
printf("illegal extended partition table - drive %02x sector %lu\n", drive,
|
||||||
RelSectorOffset);
|
RelSectorOffset);
|
||||||
return PartitionsToIgnore;
|
return PartitionsToIgnore;
|
||||||
}
|
}
|
||||||
@ -1316,6 +1323,9 @@ COUNT dsk_init()
|
|||||||
foundPartitions[HardDrive] =
|
foundPartitions[HardDrive] =
|
||||||
ProcessDisk(SCAN_PRIMARY, HardDrive, 0);
|
ProcessDisk(SCAN_PRIMARY, HardDrive, 0);
|
||||||
}
|
}
|
||||||
|
/* ignore last drive if can't get info about it; can't use anyway */
|
||||||
|
if ((nHardDisk>1) && (foundPartitions[nHardDisk-1]==(UBYTE)-1))
|
||||||
|
nHardDisk--;
|
||||||
|
|
||||||
/* Process extended partition table */
|
/* Process extended partition table */
|
||||||
for (HardDrive = 0; HardDrive < nHardDisk; HardDrive++)
|
for (HardDrive = 0; HardDrive < nHardDisk; HardDrive++)
|
||||||
@ -1357,6 +1367,9 @@ COUNT dsk_init()
|
|||||||
foundPartitions[HardDrive] =
|
foundPartitions[HardDrive] =
|
||||||
ProcessDisk(SCAN_PRIMARY, HardDrive, 0);
|
ProcessDisk(SCAN_PRIMARY, HardDrive, 0);
|
||||||
}
|
}
|
||||||
|
/* ignore last drive if can't get info about it; can't use anyway */
|
||||||
|
if ((nHardDisk>1) && (foundPartitions[nHardDisk-1]==(UBYTE)-1))
|
||||||
|
nHardDisk--;
|
||||||
|
|
||||||
/* Process extended partition table */
|
/* Process extended partition table */
|
||||||
ProcessDisk(SCAN_EXTENDED, HardDrive, 0);
|
ProcessDisk(SCAN_EXTENDED, HardDrive, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user