From b33afdbfadeee1b349f74c819e25c114c3c7d998 Mon Sep 17 00:00:00 2001 From: Bernd Boeckmann Date: Tue, 19 Dec 2023 16:08:04 +0100 Subject: [PATCH] change handling of head count < 2, was a no-op since last commit... ... because heads was always at least 1. --- kernel/initdisk.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/kernel/initdisk.c b/kernel/initdisk.c index 13253da..c6e6029 100644 --- a/kernel/initdisk.c +++ b/kernel/initdisk.c @@ -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))