diff --git a/source/Cosmos.HAL2/BlockDevice/AtaPio.cs b/source/Cosmos.HAL2/BlockDevice/AtaPio.cs index 36bfda339..028b4c42c 100644 --- a/source/Cosmos.HAL2/BlockDevice/AtaPio.cs +++ b/source/Cosmos.HAL2/BlockDevice/AtaPio.cs @@ -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)