Author: amunger
Date: Thu Sep 6 16:36:05 2007
New Revision: 28899
URL:
http://svn.reactos.org/svn/reactos?rev=28899&view=rev
Log:
Gracefully handle the case where the BIOS insists there is a floppy drive, but there is no
controller. Patch by Cameron Gutman (aicommander at gmail dot com) from Bug 1508.
Modified:
trunk/reactos/drivers/storage/floppy/floppy.c
Modified: trunk/reactos/drivers/storage/floppy/floppy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/flo…
==============================================================================
--- trunk/reactos/drivers/storage/floppy/floppy.c (original)
+++ trunk/reactos/drivers/storage/floppy/floppy.c Thu Sep 6 16:36:05 2007
@@ -687,6 +687,22 @@
return STATUS_IO_DEVICE_ERROR;
}
+/* Check if floppy drive exists */
+ if(HwSenseInterruptStatus(ControllerInfo) != STATUS_SUCCESS)
+ {
+ DPRINT("floppy: Floppy drive not detected! Returning
STATUS_IO_DEVICE_ERROR\n");
+ return STATUS_IO_DEVICE_ERROR;
+ }
+
+DPRINT("floppy: InitController: resetting the controller after floppy
detection\n");
+
+ /* Reset the controller */
+ if(HwReset(ControllerInfo) != STATUS_SUCCESS)
+ {
+ DPRINT("floppy: InitController: unable to reset controller\n");
+ return STATUS_IO_DEVICE_ERROR;
+ }
+
DPRINT("floppy: InitController: setting data rate\n");
/* Set data rate */