change handling of head count < 2, was a no-op since last commit...

... because heads was always at least 1.
This commit is contained in:
Bernd Boeckmann 2023-12-19 16:08:04 +01:00 committed by Kenneth J Davis
parent c20a97e844
commit b33afdbfad

View File

@ -757,14 +757,12 @@ StandardBios: /* old way to get parameters */
printf("BIOS reported 0 sectors/track, assuming 63!\n");
}
/* if heads==0, determine from disk size like LBA assisted BIOS translation
does, or default to 16 if LBA is not used */
if (driveParam->chs.Head == 0) {
driveParam->chs.Head = (driveParam->descflags & DF_LBA)
? BIOS_assisted_LBA_heads(driveParam->total_sectors)
: 16;
/* If heads < 2, this is probably wrong?!?
Then determine heads from disk size like BIOS assisted LBA does */
if (driveParam->chs.Head < 2) {
driveParam->chs.Head = BIOS_assisted_LBA_heads(driveParam->total_sectors);
if (firstPass && (InitKernelConfig.Verbose >= 0))
printf("BIOS reported 0 heads, assuming %u!\n", driveParam->chs.Head);
printf("BIOS reported <2 heads, assuming %u!\n", driveParam->chs.Head);
}
if (!(driveParam->descflags & DF_LBA))