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.

svn path=/trunk/; revision=28899
This commit is contained in:
Andrew Munger 2007-09-06 12:36:05 +00:00
parent f63bea010c
commit 77a5b5a508

View file

@ -687,6 +687,22 @@ static NTSTATUS NTAPI InitController(PCONTROLLER_INFO ControllerInfo)
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 */