Index: boot/freeldr/freeldr/arch/i386/hardware.c =================================================================== --- boot/freeldr/freeldr/arch/i386/hardware.c (revision 74511) +++ boot/freeldr/freeldr/arch/i386/hardware.c (working copy) @@ -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 */ Index: boot/freeldr/freeldr/arch/i386/hwdisk.c =================================================================== --- boot/freeldr/freeldr/arch/i386/hwdisk.c (revision 74511) +++ boot/freeldr/freeldr/arch/i386/hwdisk.c (working copy) @@ -25,6 +25,8 @@ #include DBG_DEFAULT_CHANNEL(HWDETECT); +#undef TRACE +#define TRACE ERR /* * This is the common code for harddisk for both the PC and the XBOX. @@ -44,6 +46,7 @@ static CHAR Hex[] = "0123456789abcdef"; +/* Data cache for BIOS disks pre-enumeration */ UCHAR PcBiosDiskCount = 0; static CHAR PcDiskIdentifier[32][20]; @@ -323,8 +326,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 +343,8 @@ memset(DiskReadBuffer, 0xcd, DiskReadBufferSize); } DiskReportError(TRUE); + + PcBiosDiskCount = DiskCount; TRACE("BIOS reports %d harddisk%s\n", (int)DiskCount, (DiskCount == 1) ? "" : "s"); @@ -384,12 +389,9 @@ reactos_disk_count++; FsRegisterDevice(BootPath, &DiskVtbl); - DiskCount++; + DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS drives! + TRACE("Additional boot drive detected: 0x%02x\n", (int)FrldrBootDrive); } - PcBiosDiskCount = DiskCount; - TRACE("BIOS reports %d harddisk%s\n", - (int)DiskCount, (DiskCount == 1) ? "": "s"); - return (DiskCount != 0); }