diff --git a/freeldr/freeldr/arch/i386/hardware.c b/freeldr/freeldr/arch/i386/hardware.c index 3493fd8b6cc..ca9410c1e2c 100644 --- a/freeldr/freeldr/arch/i386/hardware.c +++ b/freeldr/freeldr/arch/i386/hardware.c @@ -342,6 +342,10 @@ DetectPnpBios(HKEY SystemKey, U32 *BusNumber) DeviceNode->Node, DeviceNode->Size, DeviceNode->Size)); +// printf("Node: %u Size %u (0x%x)\n", +// DeviceNode->Node, +// DeviceNode->Size, +// DeviceNode->Size); memcpy (Ptr, DeviceNode, @@ -548,11 +552,13 @@ DetectBiosDisks(HKEY SystemKey, S32 Error; /* Count the number of visible drives */ + DiskReportError(FALSE); DiskCount = 0; - while (DiskGetDriveParameters(0x80 + DiskCount, &Geometry)) + while (DiskReadLogicalSectors(0x80 + DiskCount, 0ULL, 1, (PVOID)DISKREADBUFFER)) { DiskCount++; } + DiskReportError(TRUE); DbgPrint((DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n", (int)DiskCount, (DiskCount == 1) ? "": "s")); @@ -711,13 +717,15 @@ DetectIsaBios(HKEY SystemKey, U32 *BusNumber) /* Detect ISA/BIOS devices */ DetectBiosDisks(SystemKey, BusKey); -// DetectBiosFloppyDisks(SystemKey, BusKey); +#if 0 + DetectBiosFloppyDisks(SystemKey, BusKey); -// DetectBiosSerialPorts -// DetectBiosParallelPorts + DetectBiosSerialPorts(); + DetectBiosParallelPorts(); -// DetectBiosKeyboard -// DetectBiosMouse + DetectBiosKeyboard(); + DetectBiosMouse(); +#endif /* FIXME: Detect more ISA devices */ } @@ -744,23 +752,29 @@ DetectHardware(VOID) return; } -// DetectSystemData (); - DetectCPUs (SystemKey); +#if 0 + DetectSystemData(); +#endif + DetectCPUs(SystemKey); /* Detect buses */ - -// DetectPciBios (&BusNumber); -// DetectApmBios (&BusNumber); - DetectPnpBios (SystemKey, &BusNumber); - DetectIsaBios (SystemKey, &BusNumber); -// DetectAcpiBios (&BusNumber); +#if 0 + DetectPciBios(&BusNumber); + DetectApmBios(&BusNumber); +#endif + DetectPnpBios(SystemKey, &BusNumber); + DetectIsaBios(SystemKey, &BusNumber); +#if 0 + DetectAcpiBios(&BusNumber); +#endif + DbgPrint((DPRINT_HWDETECT, "DetectHardware() Done\n")); - DbgPrint ((DPRINT_HWDETECT, "DetectHardware() Done\n")); - -// printf ("*** System stopped ***\n"); -// for (;;); +#if 0 + printf("*** System stopped ***\n"); + for (;;); +#endif } /* EOF */ diff --git a/freeldr/freeldr/disk/disk.c b/freeldr/freeldr/disk/disk.c index c2e3a9f66c2..c298b51079e 100644 --- a/freeldr/freeldr/disk/disk.c +++ b/freeldr/freeldr/disk/disk.c @@ -28,14 +28,24 @@ #undef UNIMPLEMENTED #define UNIMPLEMENTED BugCheck((DPRINT_WARNING, "Unimplemented\n")); +static BOOL bReportError = TRUE; + ///////////////////////////////////////////////////////////////////////////////////////////// // FUNCTIONS ///////////////////////////////////////////////////////////////////////////////////////////// +VOID DiskReportError (BOOL bError) +{ + bReportError = bError; +} + VOID DiskError(PUCHAR ErrorString, U32 ErrorCode) { UCHAR ErrorCodeString[200]; + if (bReportError == FALSE) + return; + sprintf(ErrorCodeString, "%s\n\nError Code: 0x%x\nError: %s", ErrorString, ErrorCode, DiskGetErrorCodeString(ErrorCode)); DbgPrint((DPRINT_DISK, "%s\n", ErrorCodeString)); diff --git a/freeldr/freeldr/include/disk.h b/freeldr/freeldr/include/disk.h index e29172fe204..147bf4de862 100644 --- a/freeldr/freeldr/include/disk.h +++ b/freeldr/freeldr/include/disk.h @@ -123,6 +123,7 @@ BOOL DiskGetExtendedDriveParameters(U32 DriveNumber, PVOID Buffer, U16 BufferSiz // FreeLoader Disk Functions // /////////////////////////////////////////////////////////////////////////////////////// +VOID DiskReportError (BOOL bError); VOID DiskError(PUCHAR ErrorString, U32 ErrorCode); PUCHAR DiskGetErrorCodeString(U32 ErrorCode); BOOL DiskGetDriveGeometry(U32 DriveNumber, PGEOMETRY DriveGeometry);