Author: hbelusca
Date: Tue May 9 19:33:46 2017
New Revision: 74515
URL:
http://svn.reactos.org/svn/reactos?rev=74515&view=rev
Log:
[FREELDR]: Report the correct number of BIOS (hard) disk drives detected, that is, without
any possible extra boot drive that went enumerated afterwards.
This fixes the list of disks enumerated in
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\DiskController\0\DiskPeripheral\
and we now behave in this regards similarly to Windows 2003 & co.
I thank Lesan Ilie for reporting & testing, and Serge Gautherie and Peter Hater for
reviewing.
This fixes a bug introduced in commit r59079.
CORE-13131
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Tue May 9
19:33:46 2017
@@ -35,6 +35,8 @@
#define LATCH (CLOCK_TICK_RATE / HZ)
static unsigned int delay_count = 1;
+
+/* Used for BIOS disks pre-enumeration performed when detecting the boot devices in
InitializeBootDevices() */
extern UCHAR PcBiosDiskCount;
/* This function is slightly different in its PC and XBOX versions */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c [iso-8859-1] Tue May 9 19:33:46
2017
@@ -44,6 +44,7 @@
static CHAR Hex[] = "0123456789abcdef";
+/* Data cache for BIOS disks pre-enumeration */
UCHAR PcBiosDiskCount = 0;
static CHAR PcDiskIdentifier[32][20];
@@ -323,8 +324,8 @@
}
if (!Changed)
{
- TRACE("BIOS reports success for disk %d but data didn't
change\n",
- (int)DiskCount);
+ TRACE("BIOS reports success for disk %d (0x%02X) but data didn't
change\n",
+ (int)DiskCount, DriveNumber);
break;
}
@@ -340,6 +341,8 @@
memset(DiskReadBuffer, 0xcd, DiskReadBufferSize);
}
DiskReportError(TRUE);
+
+ PcBiosDiskCount = DiskCount;
TRACE("BIOS reports %d harddisk%s\n",
(int)DiskCount, (DiskCount == 1) ? "" : "s");
@@ -384,12 +387,9 @@
reactos_disk_count++;
FsRegisterDevice(BootPath, &DiskVtbl);
- DiskCount++;
- }
-
- PcBiosDiskCount = DiskCount;
- TRACE("BIOS reports %d harddisk%s\n",
- (int)DiskCount, (DiskCount == 1) ? "": "s");
+ DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS
drives!
+ TRACE("Additional boot drive detected: 0x%02X\n",
(int)FrldrBootDrive);
+ }
return (DiskCount != 0);
}