Check for floating bus

Fixes #1056: Does not boot if there is no IDE Secondary Master
(VirtualBox)
This commit is contained in:
Sijmen J. Mulder 2018-10-11 23:00:03 +02:00
parent 2ca4b2adb8
commit 87a233ab3f

View file

@ -163,6 +163,14 @@ namespace Cosmos.HAL.BlockDevice
public SpecLevel DiscoverDrive()
{
SelectDrive(0);
// Read status before sending command. If 0xFF, it's a floating
// bus (nothing connected)
if (IO.Status.Byte == 0xFF)
{
return SpecLevel.Null;
}
var xIdentifyStatus = SendCmd(Cmd.Identify, false);
// No drive found, go to next
if (xIdentifyStatus == Status.None)